Run solution exe after installtion using installshield

ⅰ亾dé卋堺 提交于 2019-11-28 12:16:24

What version and edition of InstallShield are you using? Also what project type are you using? (InstallScript, InstallScript MSI, Basic MSI? )

Assuming Basic MSI, InstallShield has a built-in pattern to support this story:

1) Click on the Project Assistant Tab

2) Click on the Installation Interview Icon (Page)

3) Click Yes for "Do you want to give the users the option to launch your application when the installation completes?

4) Click the browse button to select the EXE that should be the target of the operation.

By default the checkbox (launch program) on the setup complete dialog will not be selected. To select it automatically add the property LAUNCHPROGRAM to the property table and set it to a value of '1'.

Christopher Painter's answer will work for you most of the time. Those are the initial steps to take, but there are some additional details if you find that isn't enough. For instance, skb reported that this didn't work for him. I found that I was in the same boat (even though I've built a dozen other installers which had this work!).

  1. Follow Christopher Painter's instructions.
  2. Click on the "Installation Designer" tab. Within "User Interface" select "Dialogs".
  3. Within "All Dialogs", expand "SetupCompleteSuccess", and select "Behavior".
  4. Select the "Ok" push button control. Then, select "Events". (look to the bottom of the screen where it says Events/Subscriptions/Conditions)
  5. You should have a "DoAction" event, with an "argument" equal to "IS_LAUNCH_MY_PROGRAM_PLEASE" and a "condition" of "LAUNCHPROGRAM". If not - add that. "LAUNCHPROGRAM" refers to the property of that name. It will have a value of 1 if the launch checkbox is selected, and thus meet this condition. IS_LAUNCH_MY_PROGRAM_PLEASE refers to the Custom Action which is launched. If you want, you can change that CA here to make any custom action fire instead. I opted to leave this alone, but replace the CA with one of my own.
  6. Open your list of Custom Actions (Behavior and logic... Custom actions and sequences). You should find a CA there named IS_LAUNCH_MY_PROGRAM_PLEASE. Delete it!
  7. Add your own IS_LAUNCH_MY_PROGRAM_PLEASE CA. Right-click "Custom Action" (the list header) and select the type of CA you want - or launch the wizard. Just be sure to name it "IS_LAUNCH_MY_PROGRAM_PLEASE" if you left the dialog behavior as it defaults.
  8. To launch an exe - with the WORKING DIRECTORY changed (which was the reason my app wouldn't appear, and apparently skb's as well based on the comments) Select "New EXE"..."Path referencing a directory". Change "Return processing" to "Asynchronous (no wait for completion)". Note the "MSI type number" becomes 226. Set the "Working directory" to INSTALLDIR(assuming the program you want to launch should be found in your new program's directory). Set "Filename & command line" to [INSTALLDIR]YourApp.exe.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!