We're providing a .msi file, built with Advanced Installer, for integration into a larger install package. This larger install package detects whether or not our installation succeeded by the following method:
a) at the start of install, we write the binary value Success/Fail = 0 to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<ProductCode>.
b) when install completes successfully, we set Success/Fail = 1.
I'm not sure how to use Advanced Installer to do this. Do I have to use a Custom Action? If so, can you suggest the VBScript or JavaScript that I should use?
In order to write in the registry those values you have to create two custom actions.
1. In case of success, in order to write the value 1:
- place under "Commit" section a "New Attached Custom Action". This will be a VBScript file. See bellow.
- Choose the source path for the VBScript file (on the disk).
- Select source type as VBScript and edit the "Function Name" field to "WriteReg1"
- Choose "Deffered" as type of execution.
2. In case of failure, create in the same way a custom action under "Rollback". The difference is that the "Function Name" is "WriteReg0" and the type is "Rollback".
The VBScript is:
Function WriteReg1()
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Dim pathToUninstall, productCode
pathToUninstall = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\"
FOLLOW US
Get the latest news in Application Packaging