Run solution exe after installtion using installshield

空扰寡人 提交于 2019-12-17 20:08:03

问题


I want to run my exe after installation using InstallShield. InstallShield completes the setup correctly but do not run the exe.

I found another way to add an exe in startup but it runs after restart. I would like it to run without restart.

Is it possible ?


回答1:


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'.




回答2:


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.


来源:https://stackoverflow.com/questions/10698145/run-solution-exe-after-installtion-using-installshield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!