Custom Action Help
Ok... I've found a few references to this question on this site as well as a few others but I'm not sure how to apply a resolution to the issue I'm having.
I have this script in my MSI as a custom action. The custom action is in 'Execute Deferred' and located before 'InstallFinalize'.
If you look at the following script, it works fine when I remove the 'WScript.shell' line. When I place it into the MSI as it is below, I get a 1720.
Set oXLShell = CreateObject("WScript.Shell")
Dim oXL, oAddin
Set objWshShell = CreateObject("WScript.Shell")
Set oXL = CreateObject("Excel.Application")
oXL.Application.DisplayAlerts = False
oXL.Workbooks.Add
oXL.AddIns("FEmatoolkit").Installed = False
Set oAddin = oXL.AddIns.Add("FEMCredit.emAddin", True)
oAddin.Installed = True
Set oAddin2 = oXL.AddIns.Add("C:\Program Files\xandersoft\FEMA\Addins\FEMAToolkit.xla", True)
oAddin2.Installed = True
oXL.Quit
Set oXL = Nothing
What am I doing wrong here?
I have this script in my MSI as a custom action. The custom action is in 'Execute Deferred' and located before 'InstallFinalize'.
If you look at the following script, it works fine when I remove the 'WScript.shell' line. When I place it into the MSI as it is below, I get a 1720.
Set oXLShell = CreateObject("WScript.Shell")
Dim oXL, oAddin
Set objWshShell = CreateObject("WScript.Shell")
Set oXL = CreateObject("Excel.Application")
oXL.Application.DisplayAlerts = False
oXL.Workbooks.Add
oXL.AddIns("FEmatoolkit").Installed = False
Set oAddin = oXL.AddIns.Add("FEMCredit.emAddin", True)
oAddin.Installed = True
Set oAddin2 = oXL.AddIns.Add("C:\Program Files\xandersoft\FEMA\Addins\FEMAToolkit.xla", True)
oAddin2.Installed = True
oXL.Quit
Set oXL = Nothing
What am I doing wrong here?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
aogilmor
17 years ago
Posted by:
Secondlaw
17 years ago
Posted by:
AngelD
17 years ago
Please have a look at the last note on this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/scripts.asp regarding using Windows Script Host in custom actions.
The only object your code are referring to is the Excel.Application object, so the other CreateObject lines you don't need.
The only object your code are referring to is the Excel.Application object, so the other CreateObject lines you don't need.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.