Solved

How do I run a command from Installshield?

Posted on 2008-10-20
6
10,366 Views
Last Modified: 2013-11-14
I need to run a command after installshield has finished installing our software, is this possible? If not, how do I launch a program, for instance a batch file?


Any help would be great!



Ian
0
Comment
Question by:jjumpm2
6 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 22763139
Hi, if you run the setup task waiting for completion, the next line in the batch file would only execute once it is finished....something like this....

Regards,

Rob.
@echo off
start /wait c:\software\Setup.exe /qn
C:\Software\BatchToRun.bat

Open in new window

0
 

Author Comment

by:jjumpm2
ID: 22765463
Hi,

Thank you for your reply. I will try and make it clearer what I am trying to do..

I have a Installshield project that installs our software. After it has installed the files, I need it to run a command (like you would from the start menu using "Run"). If this is not possible, I could also do it using a batch file, so I would need the installer to run that after the install has finished..


Ian
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 22770754
Hi, you're InstallShield would still be able to be started by using a command line, right?  So you could just relplace this line in the code above

start /wait c:\software\Setup.exe /qn

with a command that would start your InstallShield install, then the line after that would run when the install is finished.

Regards,

Rob.
0
 
LVL 1

Expert Comment

by:ISCopernicus
ID: 22783759
If you have an InstallScript based Setup you can use the built-in LaunchAppAndWait function to launch an external program via InstallScript code.
Make sure that you set the current directory to a path that actualy exists on the target computer before calling the LaunchAppAndWait function, for example:
szCurrent = WINSYSDIR;
LAAW_PARAMETERS.lpCurrentDirectory = &szCurrent;
LaunchAppAndWait ( szProgram, szCmdLine, nOptions );

In case you need to run a program with multiple command line parameters it's a good idea to use cmd.exe as szProgram, and to specify the executable in szCmdLine:
szCurrent = TARGETDIR;
LAAW_PARAMETERS.lpCurrentDirectory = &szCurrent;
szProgram = TARGETDIR ^ "MyProgram.exe";
LongPathToQuote(szProgram, TRUE);
szCmdLine = "\"" + szProgram + " -param1 -param2\""
nResult = LaunchAppAndWait ( "cmd.exe /c", szCmdLine, nOptions );

You can even customize the _LaunchAppEx InstallScript function by using the version available at http://www.installsite.org:
http://www.installsite.org/files/LaunchAppEx.zip
0
 
LVL 3

Expert Comment

by:MSI_installer_expert
ID: 23911018
If you are using Installshield to edit your setup project file, you can simply navigate into the custom actions tab. There you will find all kinds of custom actions to run, like:
new vb script, new exe, new dll
I recommend using new exe since you only need to execute a setup commmand, and depending on the command line, you have more options to select.

If you are using install shield and cannot find this easily, I can upload a screenshot.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
If you don't know how to downgrade, my instructions below should be helpful.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question