/build/static/layout/Breadcrumb_cap_w.png

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?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: aogilmor 17 years ago
9th Degree Black Belt
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")
Posted by: Secondlaw 17 years ago
Third Degree Blue Belt
0
From what I've read, you have to have:

CreateObject("WScript.Shell")

in the code. Is this not true in some cases?
Posted by: AngelD 17 years ago
Red Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ