I've been working on migrating our company's product to a WIX-based
installer.  We're approaching release, and there's one nasty problem I can't
seem to address.

During the application of a major upgrade (the new WIX-built MSI), I fully
remove the old installation, and install anew.  However, I need to preserve
the registry values from the old installation.  So the install sequence goes
as follows:

...
InstallValidate
ExportReg
InstallInitialize
RemoveExistingProducts
...
InstallUtilLib.install
...
ImportReg
...
InstallFinalize


Both ExportReg and ImportReg custom actions are set with "Return='check'",
so they should wait for completion before the install process continues. 
I'm hoping to Export the reg key, uninstall the product, install the new
product, and import the reg key.  The VBS code for the ExportReg and
ImportReg CA's looks like this:


function exportReg
        Dim outfile, key, userDir, oShell
        Set oShell = CreateObject("WScript.Shell")
        userDir = oShell.ExpandEnvironmentStrings("%USERPROFILE%")              
        outfile = userDir & "\Local Settings\Temp\tempkey.reg"
        key = "HKEY_LOCAL_MACHINE\SOFTWARE\ourCompany"
        Return = oShell.Run("regedit /s /e """ & outfile & """ """ & key &
"""",0,True)
        userDir = ""
end function

function importReg
        Dim regfile, userDir, oShell
        Set oShell = CreateObject("WScript.Shell")
        userDir = oShell.ExpandEnvironmentStrings("%USERPROFILE%")              
        regfile = userDir & "\Local Settings\Temp\tempkey.reg"
        Return = oShell.Run("regedit /s """ & regfile & """",0,True)
        userDir = ""
end function


The problem is that after the major upgrade is completed, the registry
appears empty.  Looking at the verbose msiexec install log shows that both
exportreg and importreg fire off successfully, and I can confirm that the
.reg file generated by the exportReg custom action is good.  What I imagine
is happening is that the .reg file is being imported too early (before the
uninstallation process is complete, and the registry key is being removed by
removexistingproducts somehow) or too late (and the machine is rebooting
before the registry import has a chance to complete).  However, it looks
like everything should be running synchronously.  

Any ideas?
-- 
View this message in context: 
http://www.nabble.com/Registry-import-CA-custom-action-tf4105501.html#a11675776
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to