Hi,
Currently Advanced Installer does not support importing ".reg" files. This will be available in a future release. Until then, you have 2 alternatives:
- manually enter the registry data from the ".reg" file in the Registry page of AdvInst
- use a Custom Action that will "execute" the ".reg" file at install time
In what follows I shall explain the second approach:
1. In the Files and Folders page, add the ".reg" file in question to your project.
2. In the Custom Actions page, add a Property Set with Formatted Custom Action on the "InstallFinalize" stage. Set the following settings for this CA:
- Property Name : REGFILE
- Formatted Text: [#regfile.reg] (select the file from your package by clicking the "Edit" button and then the "File" button in the "Edit Custom Action Properties Parameters" dialog).
3. Create a new text file ("ImportRegFile.vbs") and copy the following code into it:
Code: Select all
strRegFile = Session.Property("REGFILE")
LaunchSomething(strRegFile),True
Function LaunchSomething(strPath, bWait)
Set WshShell = CreateObject("WScript.Shell")
strCmd = chr(34) & strPath & chr(34)
' MsgBox strCmd
ret = WshShell.Run(strCmd, 1, bWait)
End Function
4. Create a New Attached Custom Action scheduled on the "InstallFinalize" stage, after the previously defined Property Set with Formatted CA. Select the VBScript file created previously. Set the following properties for this CA:
- Function Name: (Must be blank)
- Execution Condition: (Not Installed)
Please note that if the ".reg" file is imported in this manner, the registry entries it contains will not be removed when the application is uninstalled.
Regards,
Denis
FOLLOW US
Get the latest news in Application Packaging