PDA

View Full Version : action run exe and argument


jenny62
09-23-2004, 07:19 PM
Hi I was just looking at a trial of this new version and ran into a problem trying to duplicate something that worked in the 6 trial.

With version 6 - for Actions "After Install" I had
an Execute command such as this example:

File to Execute: %WinDir%\FileOne.exe
Command Line Arguments /a /p %WinDir%\FileTwo.abc
Working Directory: %WinDir%

The above worked perfectly. (FileOne was an exe used to run FileTwo a picture show)

But I just can't successfully duplicate it in 7.
There is no Execute in the Actions so I tried the Run action but I just can't get it to work. I get an error that FileTwo cannot be found when I run the setup. Can someone show me exactly what the proper commands should look like to duplicate the above three successful commands that worked in 6.

Oh and when I tried entering the working directory, I get an error too about invalid characters.

thanks for any help - this is driving me dizzy!

jenn

JXBURNS
09-23-2004, 07:31 PM
Bit late at night (er.. early morning) so excuse if not quite right but something like:

File.Run(_WindowsFolder.."\\FileOne.exe", "/a /p %WindowsFolder%\FileTwo.abc", _WindowsFolder, SW_SHOWNORMAL, false);

would probably do it.

Best thing to do is look at the examples in the help file and use the ACTION button on the Actions screen to help build the syntax. Commands are case sensitive and you do need the "\\" to denote folder divider.

John

SUF6NEWBIE
09-23-2004, 07:52 PM
Hi there, if you hav'nt its well worth a read of the help documentation...
Due to the Great addition of 'LUA' actions scripting some things have
changed..like some of the variables etc are now a little different.

Once you get the general idea..things will come quickly.

for each action eg: the file.run action there is a quick help link you can
use to get an idea of how that action functions in SUF7.

To help get you started:

SUF6
File to Execute: %WinDir%\FileOne.exe
Command Line Arguments /a /p %WinDir%\FileTwo.abc
Working Directory: %WinDir%

SUF7:
%WinDir% is now %WindowsFolder% ..so keep this in mind.
you can even use _WindowsFolder

so try this:

MyFolderFile = SessionVar.Expand("%WindowsFolder%").."\\FileTwo.abc";
File.Run(_WindowsFolder.."\\FileOne.exe", "/a /p MyFolderFile" , _WindowsFolder, SW_SHOWNORMAL, true);

Hope helps a little.

BTW: John beat me to it but you have several ways of doing things..

jenny62
09-24-2004, 07:52 AM
Thanks guys! Finally got it right though both methods did not work.
With John code nothing would happen after the setup.exe was run.
With Suf6Newbie code I would get a "cannot find MyFolderFile" error
but I got it to work with just one line like this:

File.Run(_WindowsFolder.."\\file1.exe", "/a /b file2.abc", _WindowsFolder, SW_SHOWNORMAL, true);

Thanks again, you guys have been a great help and I'm already starting to get the hang of it now though still don't know why I can't get the icon to change yet! Nothin in help about that problem but I'l keep tryin.

jenn

Brett
09-24-2004, 09:23 AM
Or, even:

File.Run(SessionVar.Expand("%WindowsFolder%\\FileOne.exe"),SessionVar.Expand("/a /p %WindowsFolder%\FileTwo.abc"));

SUF6NEWBIE
09-24-2004, 01:46 PM
Glad you got it to work Jenn, as we are all learning there are a few ways
to acheive the same thing and yes with a goal to keeping lines of
code to a minimum is great !

Bretts one is a goodie ...

Martin