Page 1 of 1

Run Program command not working

Posted: Sat Aug 05, 2006 1:32 pm
by Alwin van Driel
The run program command does not start the program.

I have debugged the script and the Run statement is executed but the program is not started (also checked with taskmanager).

I have also checked if the program can be started by hand from any working folder with the absoloute path so being in c:\\ and then run c:\\program files\\testapp\\TestApp.exe and this works.

I also tried the Run As command in your script but also doesn't work.

Any clues?

<<Code Folding Region>>
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
if Variable SILENT Equals FALSE
if Variable REBOOTCOMPUTER Equals TRUE
if Variable SUCCESS Equals REBOOT
Reboot Computer
end
end
if Variable RUNAPP Equals TRUE
if Variable REMOVE Equals FALSE
if Variable SUCCESS Equals COMPLETE
Run Program $TARGETDIR$\\TestApp.exe
Comment: TO-DO: Insert command that starts your application here
end
end
end
end
<<Code Folding Region>>

Posted: Sat Aug 05, 2006 2:13 pm
by Gizm0
Is your program, a .net program?
Does it need the initial directory set?You have to set the working directory to $TARGETDIR$.

Posted: Sun Aug 06, 2006 4:56 am
by Alwin van Driel
Its a .Net program but actually does not needs the current folder to be the Targetfolder. Anyway I know used the following statement, but still does not work.

Run Program $TARGETDIR$\\TestApp.exe , startup in folder $TARGETDIR$

The links (desktop, startup, quicklaunch) do work after installation. These shortcuts are exactly the same as above.

(the .Net app is using framework v2.0.50727)

Any clue?

Posted: Sun Aug 06, 2006 7:31 am
by MichaelNesmith
I guess you set working directory to $TARGETDIR$?

You can also try to call SetCurrentDirectoryA in kernel32.dll using Call DLL Function to force-change the current directory to $TARGETDIR$.

Posted: Sun Aug 06, 2006 12:17 pm
by Gizm0
Alwin van Driel wrote:Its a .Net program but actually does not needs the current folder to be the Targetfolder. Anyway I know used the following statement, but still does not work.

Run Program $TARGETDIR$\\TestApp.exe , startup in folder $TARGETDIR$

The links (desktop, startup, quicklaunch) do work after installation. These shortcuts are exactly the same as above.

(the .Net app is using framework v2.0.50727)

Any clue?


It's a known issue with the .Net programs. Some of them, for some reason, need the you to call the API Michael noticed above. Try it and it should work.

Posted: Sun Aug 06, 2006 3:57 pm
by Alwin van Driel
Tried the above and doesn't work.

The SetCurrentDirectory returns True and the Run Program returns the code -11. Before I used the SetCurrentDirectory the returncode was -2146232576.

I have multiple versions of the .Net framework on my machine (required by other programs). Maybe it has somethine to do with the environment this process is created in?

Currently using the following code (from another topic)

if Variable RUNAPP Equals TRUE
if Variable REMOVE Equals FALSE
if Variable SUCCESS Equals COMPLETE
Set Variable INSTALLDIR to $TARGETDIR$
Convert to Short Path: INSTALLDIR
Call DLL Function kernel32.dll->SetCurrentDirectoryA (get result into variable LASTERROR)
Run Program $INSTALLDIR$\\TestApp.exe
Comment: TO-DO: Insert command that starts your application here
end
end
end


I even tried to make a run.cmd with the .net executable in it, but that also doesn't work.

So still not working, any help I would appreciate (prob wrong spelling :wink: )

Posted: Wed Aug 16, 2006 3:36 am
by Ton_B
This might be a stupid question,
but dit you preform the "Apply Install" before you use the run program?


just asking...

RUN Program as command not working

Posted: Wed Aug 16, 2006 11:26 pm
by GavinSmith
What are the requirements to use to Run Program As command. After spend way to long trying to get RUN command to work, I ended up recreating the very simple package again and it finally started working. Running an external setup program in silent mode. Very simple.
Next step was to replace the RUN Program with the RUN Program As version and it no longer works again.

How do I debug this?

Have used several accounts, rights aren’t the issues. Using another tool I can package the external setup which will evaluate the permissions itself when installing, switched back to using the using the RUN Program command and it works fine.

I’m at a lost.

Posted: Thu Aug 17, 2006 4:37 pm
by MichaelNesmith
Run Program As has more fields which lets you run programs under different user accounts. It might have stopped working if you provided an invalid account, or other invalid settings for the program, in the expanded range that Run Program As offers over Run Program.