wpfinstallshieldbasic-msi

Set executable run order in Basic MSI project with installShield


I created a Basic MSI installer project with InstallShield 2016 professional using the project assistant. I did not created any components/features (just the deafulkt features has been created). The installer should run a console application first (I added as part of the installer, but it won't be installed) and, if no errors arise, simply copy a WPF application (DLLs and .exe) to the client location.

Ideally the steps would be, after the interview dialogs proposed:

  1. Prompt the used if he/she want to proceed
  2. If [no] close the process, if [yes], display a custom dialog accepting three fields for a SQL connection string
  3. Then, with the given parameters as input, run the console app. The console app just runs some SQL scripts, but it will not be installed and it is part of the installer
  4. After this step (how can I check it is finished and no errors occurred?) copy the files (wpf .exe and DLLs) as set in the project assistant.

In the documentation I read that with custom actions it is possible to run executables, but I cannot understand or find details on how to pass parameters (except from command line) to the console application or to get the final status produced by the console application.

Can anyone suggest me how can I achieve those steps?

UPDATE

In InstallShield it is possible to create properties among custom actions and then call those values like: [PropertyName] in other places where needed.

I could do this to add the three properties for the executable command line parameters:
i=[DB_CONN_INSTANCE_NAME] u=[DB_CONN_USER_NAME] p=[DB_CONN_PWD]


Solution

  • how can I check it is finished and no errors occurred?

    Your console application should return ExitCode. 0 (zero) would indicate success and any other number would be failure. Inside your custom action (CA) properties you should choose "Synchronous (Check exit code)" for "Return Processing" property. As you want to run this CA at installation time, you should choose "Deferred Execution" for "In-Script Execution" property. You should write condition at least because you want this happen only during installation, and not when user will remove the product, are you? In this case complete "Install Exec Condition". If you set all of the above I believe the MSI Type Number for this CA will be 1026.

    where I can find some more detailed documentation?

    Here you go: Custom Actions

    EDIT:

    If I test the application I do not get any hint that the console app ran. Plus how can I then specify to proceed with the second custom function (that should install the WPF app) if the executable is successful?

    You need to set "Install Exec Sequence" in order to run your CA at the certain time. The deferred type of CA has to be scheduled somewhere after "InstallFiles". More on how to schedule CA read over there: Sequencing Custom Actions. When you schedule your console app CA with "Synchronous (Check exit code)" property, installer will wait while your CA exits and only after that continue sequence. Your second CA should be scheduled after the first CA. Very simple, you are definitely on the right track.

    Is it possible to debug the steps for a Basic MSI?

    I am not sure what are you asking over here. As far as I understand you are using InstallShield Studio, so run debug and step through. If you ask about debugging CA itself you should look at the following resource: Debugging Custom Actions