VBScript custom action failing - error hard to decipher

4 messages Options
Embed this post
Permalink
Scott Palmer-3

VBScript custom action failing - error hard to decipher

Reply Threaded More More options
Print post
Permalink
I'm having trouble getting a VBScript custom action to work.  It's
purpose it so backup some files that the major upgrade may otherwise
delete.


My WiX source looks like this:

    <Binary Id='project_backup.vbs' SourceFile='project_backup.vbs'/>
    <CustomAction Id='setProjectFolder' Property='USERPROJECTFOLDER'
Value='[MyProduct_Projects]'/>
    <CustomAction Id='makeProjBackups' BinaryKey='project_backup.vbs'
VBScriptCall='backupProjects' Execute='immediate' Return='check'/>
    <InstallExecuteSequence>
      <Custom Action='setProjectFolder' Before='makeProjBackups'/>
      <Custom Action='makeProjBackups'
Before='InstallFinalize'><![CDATA[NOT Installed]]></Custom>
    </InstallExecuteSequence>


My script (project_backup.vbs) looks like:

' VBScript source code
Function backupProjects
Dim proj_folder, backup_proj_folder
Set proj_folder = Session.Property("USERPROJECTFOLDER")
MsgBox "The project folder is "+proj_folder
Set backup_proj_folder = proj_folder+"backup"
MsgBox "The project backup folder is "+backup_proj_folder
Dim objFSO, objFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
if not objFSO.FolderExists(backup_proj_folder) then
    Set objFolder = objFSO.CreateFolder(backup_proj_folder)
end if
Dim objShell
Set objShell = CreateObject("WScript.Shell")
cmdLine = "cmd.exe /C move /Y """ + proj_folder + "*.prj"" """ +
backup_proj_folder + """"
WScript.echo(cmdLine)
objShell.Run(cmdLine)
End Function


The message boxes are in there strictly for debugging/testing at this point.

The install fails with an error when it tries to run my
makeProjBackups action:  Here is the relevant section of the log:

Action start 9:35:17: PublishProduct.
PublishProduct:
Action ended 9:35:17: PublishProduct. Return value 1.
MSI (s) (6C:3C) [09:35:17:726]: Doing action: setProjectFolder
MSI (s) (6C:3C) [09:35:17:726]: Note: 1: 2205 2:  3: ActionText
Action 9:35:17: setProjectFolder.
Action start 9:35:17: setProjectFolder.
MSI (s) (6C:3C) [09:35:17:726]: PROPERTY CHANGE: Adding
USERPROJECTFOLDER property. Its value is 'C:\Documents and
Settings\All Users\Documents\MyCompany\MyProduct\Projects\'.
Action ended 9:35:17: setProjectFolder. Return value 1.
MSI (s) (6C:3C) [09:35:17:726]: Doing action: makeProjBackups
MSI (s) (6C:3C) [09:35:17:726]: Note: 1: 2205 2:  3: ActionText
Action 9:35:17: makeProjBackups.
Action start 9:35:17: makeProjBackups.
MSI (s) (6C:4C) [09:35:17:726]: Generating random cookie.
MSI (s) (6C:4C) [09:35:17:726]: Created Custom Action Server with PID
3968 (0xF80).
MSI (s) (6C:40) [09:35:17:741]: Running as a service.
MSI (s) (6C:40) [09:35:17:741]: Hello, I'm your 32bit Impersonated
custom action server.
MSI (s) (6C:E0) [09:35:17:741]: Entering
MsiProvideComponentFromDescriptor. Descriptor:
AYR&1QHTd?I,.Gi%~HE%MobilinkLite_Files>M5KDYSUnf(HA*L[xeX)y, PathBuf:
C3F348, pcchPathBuf: C3F344, pcchArgsOffset: C3F2A4
MSI (s) (6C:E0) [09:35:17:741]: MsiProvideComponentFromDescriptor
called for component {997FA962-E067-11D1-9396-00A0C90F27F9}: returning
harcoded oleaut32.dll value
MSI (s) (6C:E0) [09:35:17:741]: MsiProvideComponentFromDescriptor is
returning: 0
MSI (s) (6C:E0) [09:35:17:741]: Note: 1: 2205 2:  3: Error
MSI (s) (6C:E0) [09:35:17:741]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1720
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.  Custom action
makeProjBackups script error -2146827864, Microsoft VBScript runtime
error: Object required: '[string: "C:\Documents and Set"]' Line 4,
Column 1,
MSI (s) (6C:E0) [09:35:32:101]: Note: 1: 2205 2:  3: Error
MSI (s) (6C:E0) [09:35:32:101]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (6C:E0) [09:35:32:101]: Product: MyCompany MyProduct -- 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.  Custom action makeProjBackups
script error -2146827864, Microsoft VBScript runtime error: Object
required: '[string: "C:\Documents and Set"]' Line 4, Column 1,

Action ended 9:35:32: makeProjBackups. Return value 3.
MSI (s) (6C:3C) [09:35:32:101]: Machine policy value 'DisableRollback' is 0


Any assistance it figuring out what exactly is going wrong is
appreciated.  Specifically I don't have a clue what all that
"MsiProvideComponentFromDescriptor" stuff is all about.

Thanks,

Scott

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Wilson, Phil

Re: VBScript custom action failing - error hard to decipher

Reply Threaded More More options
Print post
Permalink
The WScript.Echo won't work - that's supplied by the WSH object, not by MSI. Do you see that message?

MsiProvideComponent is normal - any of the entrypoints that have a Darwin descriptor (COM,file associations, shortcuts) use that to locate the target file (causing repair if needed).

Apart from that, I can't tell if the line number 4 of the error report corresponds with what I see in the email, it doesn't seem to.

Phil Wilson


-----Original Message-----
From: Scott Palmer [mailto:[hidden email]]
Sent: Monday, November 02, 2009 7:13 AM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] VBScript custom action failing - error hard to decipher

I'm having trouble getting a VBScript custom action to work.  It's
purpose it so backup some files that the major upgrade may otherwise
delete.


My WiX source looks like this:

    <Binary Id='project_backup.vbs' SourceFile='project_backup.vbs'/>
    <CustomAction Id='setProjectFolder' Property='USERPROJECTFOLDER'
Value='[MyProduct_Projects]'/>
    <CustomAction Id='makeProjBackups' BinaryKey='project_backup.vbs'
VBScriptCall='backupProjects' Execute='immediate' Return='check'/>
    <InstallExecuteSequence>
      <Custom Action='setProjectFolder' Before='makeProjBackups'/>
      <Custom Action='makeProjBackups'
Before='InstallFinalize'><![CDATA[NOT Installed]]></Custom>
    </InstallExecuteSequence>


My script (project_backup.vbs) looks like:

' VBScript source code
Function backupProjects
Dim proj_folder, backup_proj_folder
Set proj_folder = Session.Property("USERPROJECTFOLDER")
MsgBox "The project folder is "+proj_folder
Set backup_proj_folder = proj_folder+"backup"
MsgBox "The project backup folder is "+backup_proj_folder
Dim objFSO, objFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
if not objFSO.FolderExists(backup_proj_folder) then
    Set objFolder = objFSO.CreateFolder(backup_proj_folder)
end if
Dim objShell
Set objShell = CreateObject("WScript.Shell")
cmdLine = "cmd.exe /C move /Y """ + proj_folder + "*.prj"" """ +
backup_proj_folder + """"
WScript.echo(cmdLine)
objShell.Run(cmdLine)
End Function


The message boxes are in there strictly for debugging/testing at this point.

The install fails with an error when it tries to run my
makeProjBackups action:  Here is the relevant section of the log:

Action start 9:35:17: PublishProduct.
PublishProduct:
Action ended 9:35:17: PublishProduct. Return value 1.
MSI (s) (6C:3C) [09:35:17:726]: Doing action: setProjectFolder
MSI (s) (6C:3C) [09:35:17:726]: Note: 1: 2205 2:  3: ActionText
Action 9:35:17: setProjectFolder.
Action start 9:35:17: setProjectFolder.
MSI (s) (6C:3C) [09:35:17:726]: PROPERTY CHANGE: Adding
USERPROJECTFOLDER property. Its value is 'C:\Documents and
Settings\All Users\Documents\MyCompany\MyProduct\Projects\'.
Action ended 9:35:17: setProjectFolder. Return value 1.
MSI (s) (6C:3C) [09:35:17:726]: Doing action: makeProjBackups
MSI (s) (6C:3C) [09:35:17:726]: Note: 1: 2205 2:  3: ActionText
Action 9:35:17: makeProjBackups.
Action start 9:35:17: makeProjBackups.
MSI (s) (6C:4C) [09:35:17:726]: Generating random cookie.
MSI (s) (6C:4C) [09:35:17:726]: Created Custom Action Server with PID
3968 (0xF80).
MSI (s) (6C:40) [09:35:17:741]: Running as a service.
MSI (s) (6C:40) [09:35:17:741]: Hello, I'm your 32bit Impersonated
custom action server.
MSI (s) (6C:E0) [09:35:17:741]: Entering
MsiProvideComponentFromDescriptor. Descriptor:
AYR&1QHTd?I,.Gi%~HE%MobilinkLite_Files>M5KDYSUnf(HA*L[xeX)y, PathBuf:
C3F348, pcchPathBuf: C3F344, pcchArgsOffset: C3F2A4
MSI (s) (6C:E0) [09:35:17:741]: MsiProvideComponentFromDescriptor
called for component {997FA962-E067-11D1-9396-00A0C90F27F9}: returning
harcoded oleaut32.dll value
MSI (s) (6C:E0) [09:35:17:741]: MsiProvideComponentFromDescriptor is
returning: 0
MSI (s) (6C:E0) [09:35:17:741]: Note: 1: 2205 2:  3: Error
MSI (s) (6C:E0) [09:35:17:741]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1720
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.  Custom action
makeProjBackups script error -2146827864, Microsoft VBScript runtime
error: Object required: '[string: "C:\Documents and Set"]' Line 4,
Column 1,
MSI (s) (6C:E0) [09:35:32:101]: Note: 1: 2205 2:  3: Error
MSI (s) (6C:E0) [09:35:32:101]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (6C:E0) [09:35:32:101]: Product: MyCompany MyProduct -- 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.  Custom action makeProjBackups
script error -2146827864, Microsoft VBScript runtime error: Object
required: '[string: "C:\Documents and Set"]' Line 4, Column 1,

Action ended 9:35:32: makeProjBackups. Return value 3.
MSI (s) (6C:3C) [09:35:32:101]: Machine policy value 'DisableRollback' is 0


Any assistance it figuring out what exactly is going wrong is
appreciated.  Specifically I don't have a clue what all that
"MsiProvideComponentFromDescriptor" stuff is all about.

Thanks,

Scott

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users



*** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail [hidden email]. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates).



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Scott Palmer-3

Re: VBScript custom action failing - error hard to decipher

Reply Threaded More More options
Print post
Permalink
Thanks, I found that and fixed a few other VBScript problems and now I
have it working. (Only to discover other problems, however.)

Scott

On Mon, Nov 2, 2009 at 1:15 PM, Wilson, Phil <[hidden email]> wrote:
> The WScript.Echo won't work - that's supplied by the WSH object, not by MSI. Do you see that message?

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Rob Mensching-7

Re: VBScript custom action failing - error hard to decipher

Reply Threaded More More options
Print post
Permalink
There are a lot of reasons not to use script based custom actions due to
environmental issues. They have a tendency to fail significantly more often
than other types of custom actions (and custom actions have a tendency to
fail significantly more than the built in support).

Personally, I recommend not use script based custom actions.

On Mon, Nov 2, 2009 at 11:15 AM, Scott Palmer <[hidden email]> wrote:

> Thanks, I found that and fixed a few other VBScript problems and now I
> have it working. (Only to discover other problems, however.)
>
> Scott
>
> On Mon, Nov 2, 2009 at 1:15 PM, Wilson, Phil <[hidden email]>
> wrote:
> > The WScript.Echo won't work - that's supplied by the WSH object, not by
> MSI. Do you see that message?
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


--
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users