Run Program As not working

Got a problem you cannot solve? Try here.
richard
Posts: 3
Joined: Wed Jan 18, 2006 12:34 am

Run Program As not working

Postby richard » Wed Jan 18, 2006 12:40 am

Hi,

When i use the "Run Program" command the app runs fine except that i need the startup dir to be set.

When i use the "Run Program As" setting the startup directory the app does not start.

I have checked the command has been added to the code in the correct place.

Any help here greatly appreciated

Cheers
Richard

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Jan 18, 2006 9:17 am

For some applications (ex: .NET applications), setting this startup field does not seem to be sufficient, but an actual SetCurrentDirectoryA call is required to set the current directory on the system before calling Run Program or Run Program As. This is not a Run Program As bug, but apparently a limitation in either the API or the applications in question.

Just call SetCurrentDirectoryA Win32 API using Call DLL Function to work around this issue - this function is found in kernel32.dll, takes a single pointer to string parameter (the directory to switch to, such as $TARGETDIR$), and returns a bool.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: Bing [Bot] and 162 guests