Solved

How do I run a command from Installshield?

Posted on 2008-10-20
6
10,112 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
If you don't know how to downgrade, my instructions below should be helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now