Where can I create a custom action that executes after 'installfinalize' in Installshield 2013 Express?

StackOverflow https://stackoverflow.com/questions/23298516

  •  09-07-2023
  •  | 
  •  

Question

I've managed this in Wix but my colleague wants to replicate it in Installshield 2013 Express. We have found the 'custom actions' section in Installshield but we cannot see where we can make it run after Installfinalize, it needs to come after copyfiles AND have Execute="immediate". All of the options after copyfiles have Execute="Deferred".

In Wix I have a VBScript which reads the MSI Session.Property("OriginalDatabase") and then uses this to write to some config files which are installed by the MSI. The point being that if we rename the MSI then the config is adjusted to reflect the MSI filename.

I would have posted a screenshot of the IS custom actions UI but I need '10 reputation' to post images - So the link to the image is -> Here

Was it helpful?

Solution

Two possibilities here....

1) Since you say it's MyFile.cfg I'll assume it's not .INI or .XML format. In that case, use the InstallShield Text Files Changes view to author a search and replace on the files. The InstallShield custom actions support UAC and Rollback so you'll be good to go there. You will probably need a very simple InstallScript custom action to read the OriginalDatabase property, parse out the part you care about and assign it to another property. Then use that property in the Text Files Changes view.

2) Why have the entires in the .cfg file at all? What application reads these values? Refactor that to not need the cfg files. Windows Installer exposes an API that allows you to query the installer service for information related to installed products. You can ask MSI what the MSI name was for an installed application and then use that information for whatever you need it from. Put the logic in the application and simplify the deployment story for a more robust installer experience.

OTHER TIPS

You are going about this all wrong. Custom actions that modify the machine state should always be deferred and scheduled between install initialize and install finalize. Failure to do so will break in an UAC environment and also not support transactional rollback on failure.

Are these XML files? I'd use immeadiate custom actions scheduled just after installinitialize to emit temporary records into various MSI tables. The concept is to leverage DuplicateFiles to clone the file to a name based on the MSI name. You'd also have some work if you need to modify the files. Done correctly and your installer will still have full rollback functionality and work in an advertised / UAC scenario.

Also, VB/JScript custom actions are not reliable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top