Hi. I'm working on a WIX project where I need to set a directory path at msi run-time using VBScript. Right now, the msi installs correctly, but I receive an error when I attempt to uninstall from the Control Panel or the msi(Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor).
<?xml version='1.0' encoding='windows-1252'?> <Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'> <Product Name='Foobar 1.0' Id='03C41B1B-B39E-42e9-968E-6641B3F10B30' Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'> ... <Condition Message="You need to be an administrator to install this product."> AdminUser </Condition> ... <Directory Id='XLSTART' Name="SourceDir"> </Directory> <Directory Id='TARGETDIR' Name='SourceDir'> ... </Directory> ... <CustomAction Id="AssignXLSTART" Script="vbscript" Return="check"> <![CDATA[ const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." 'Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Set oReg=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "Software\Classes\Excel.Application\CLSID" oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, "", clsid strKeyPath = "Software\Classes\CLSID\" & clsid & "\LocalServer32" oReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, "", subkey peelOff = InStr(subkey, "/") - 11 subkey = Mid(subkey, 1, peelOff) & "XLSTART\" Session.TargetPath("XLSTART") = subkey ]]> </CustomAction> <InstallUISequence> <Custom Action="AssignXLSTART" After="CostFinalize"></Custom> </InstallUISequence> <InstallExecuteSequence> <Custom Action="AssignXLSTART" After="CostFinalize"></Custom> </InstallExecuteSequence> </Product> </Wix> The interesting thing is that if I run the uninstall in the administrator command prompt using msiexec, the uninstall works correctly. Any suggestions and help would be greatly appreciated. Thanks. En-jay Hsu ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users