open an exe after read ini file

Post here if you need help using Actiona
Post Reply
B Boy Breaker
Posts: 2
Joined: 12 Feb 2014, 12:14

open an exe after read ini file

Post by B Boy Breaker »

hi i am new here i try to open exe by using command and its work
the problem is : how i can run the path from ini
until now i read ini file and take the output but i don't know how to run it
this is my work

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<scriptfile>
    <settings program="actionaz" version="3.7.0" scriptVersion="1.0.0" os="Windows"/>
    <actions>
        <action name="ActionCommand" version="1.0.0"/>
        <action name="ActionReadIniFile" version="1.0.0"/>
    </actions>
    <parameters/>
    <script pauseBefore="0" pauseAfter="0">
        <action name="ActionReadIniFile">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <exception id="33" action="0" line=""/>
            <parameter name="section">
                <subParameter name="value" code="0">game</subParameter>
            </parameter>
            <parameter name="mode">
                <subParameter name="value" code="0">singleParameter</subParameter>
            </parameter>
            <parameter name="variable">
                <subParameter name="value" code="0">op</subParameter>
            </parameter>
            <parameter name="file">
                <subParameter name="value" code="0">C:/breakerbot/1.ini</subParameter>
            </parameter>
            <parameter name="parameter">
                <subParameter name="value" code="0">path</subParameter>
            </parameter>
        </action>
        <action name="ActionCommand">
            <exception id="0" action="0" line=""/>
            <exception id="1" action="0" line=""/>
            <exception id="2" action="1" line=""/>
            <exception id="32" action="0" line=""/>
            <parameter name="output">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="exitStatus">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="errorOutput">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="processId">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="parameters">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="exitCode">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
            <parameter name="command">
                <subParameter name="value" code="0">$op.open</subParameter>
            </parameter>
            <parameter name="workingDirectory">
                <subParameter name="value" code="0"></subParameter>
            </parameter>
        </action>
    </script>
</scriptfile>
another question :
every time i need to put the path with full lik : c:/blabla
i need to just put the file name and the path is in the same script folder
User avatar
Jmgr
Admin
Posts: 1651
Joined: 07 Dec 2005, 15:45
Contact:

Re: open an exe after read ini file

Post by Jmgr »

Hi,

What is the content of the "path" parameter in the "game" section ? I suppose it is a path to an executable ?
I that case, entering $op in the command parameter of the Command action should work. Also remember to set the working directory parameter if the executable you want to run needs it.
another question :
every time i need to put the path with full lik : c:/blabla
i need to just put the file name and the path is in the same script folder
The working directory depends on how you are running the script. If it's by opening it in Actionaz, then the working directory is set to the directory where Actionaz is installed. If you run your script by executing an SFX script, then the working directory is a temporary folder.
I will probably add an option to choose the working directory for a script, as its a frequently asked feature.
"My software never has bugs. It just develops random features."
B Boy Breaker
Posts: 2
Joined: 12 Feb 2014, 12:14

Re: open an exe after read ini file

Post by B Boy Breaker »

Jmgr wrote:Hi,

What is the content of the "path" parameter in the "game" section ? I suppose it is a path to an executable ?
I that case, entering $op in the command parameter of the Command action should work. Also remember to set the working directory parameter if the executable you want to run needs it.
yes its the path of exe but i didn't understand directory parameter !
and i try to put command with variable op but this give an error

[quote}
The working directory depends on how you are running the script. If it's by opening it in Actionaz, then the working directory is set to the directory where Actionaz is installed. If you run your script by executing an SFX script, then the working directory is a temporary folder.
I will probably add an option to choose the working directory for a script, as its a frequently asked feature.
[/quote]
from where i can set the working directory ?
and that mean if i put x.jpg the SFX will use that one in the same folder of th SFX folder ?
i try all this things and always have error not found

btw it seems i cant use 2 qoute in one post ... :(
User avatar
Jmgr
Admin
Posts: 1651
Joined: 07 Dec 2005, 15:45
Contact:

Re: open an exe after read ini file

Post by Jmgr »

yes its the path of exe but i didn't understand directory parameter !
You mean, the working directory? The working directory is used when you want to access a file without entering its full path.
As an example, if you have a file located in "C:\my stuff\other dir\blabla.txt" and your working directory is "C:\my stuff" then you can access the file using only "other dir\blabla.txt".
I don't know if the program you want to run uses the working directory or not, but by default I would suggest that you put the directory where your executable is as the working directory.
and i try to put command with variable op but this give an error
What error does this give?
from where i can set the working directory ?
Its the 3rd parameter from the Command action.
and that mean if i put x.jpg the SFX will use that one in the same folder of th SFX folder ?
No, as I said previously, if you run your script as an SFX then the working directory is a temporary folder, so you cannot copy file there because the will be removed later by the operating system.
But, you can try opening the SFX file using 7z (seven zip) because it is an archive. You can then add files to the archive, they will be extracted when you run the SFX script, and can be accessed directly.
btw it seems i cant use 2 qoute in one post ... :(
You can, its just that you wrote a } instead of a ] at the end of your last quote.
"My software never has bugs. It just develops random features."
Post Reply