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?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
looks like it doesnt' like these lines, which you can take out becuase it doens't seem like they are used later in the script.
Set oXLShell = CreateObject("WScript.Shell")
Set objWshShell = CreateObject("WScript.Shell")
Answered 12/15/2006 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
From what I've read, you have to have:

CreateObject("WScript.Shell")

in the code. Is this not true in some cases?
Answered 12/15/2006 by: Secondlaw
Third Degree Blue Belt

Please log in to comment
0
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.
Answered 12/15/2006 by: AngelD
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity