Solved

How do I run a command from Installshield?

Posted on 2008-10-20
6
10,458 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINUX, CPANEL & WHM 5 55
Microsoft Word Add-in Start automatically 8 54
PHP installation issues 11 75
Non admin needs to install programs 17 65
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

789 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