On 1/17/12 7:49 PM, Christopher Painter wrote:
> I find it more elegant to have the custom action only set a property and
> return. Then on the remaining control events use the property in a
> condition to perform a SpawnDialog on a custom dialog that displayes the
> error message. This way MSI continues to handle the UI.
Thank you for your suggestion, Christopher. I wish I wouldn't need to
deal with GUI. This particular code is for testing/debugging, and so
having this come out under the wizard window is OK. But I would
eventually need to have a dialog to let user choose a file. Because the
stock custome controls don't include a file dialog, I think I need to
use scripting. Would there be any other way around that hopefully
doesn't involve writing a DLL?
I have another (hopefully the last) related question. After searching
the Internet, I came up with this VBScript
<CustomAction Id="AskLicense" Script="vbscript">
<![CDATA[
Dim ObjFSO
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "License File|*.xml"
ObjFSO.FilterIndex = 3
ObjFSO.InitialDir = "C:\"
Session.Property("SELECTEDRLPLICENSEFILE") = ObjFSO.FileName
]]>
</CustomAction>
This didn't work. I got an error pop up, and the MSI log has this entry:
MSI (s) (4C:C8) [18:29:53:667]: Hello, I'm your 32bit Impersonated
custom action server.
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 AskLicense
script error -2146827859, Microsoft VBScript runtime error: ActiveX
component can't create object: 'UserAccounts.CommonDialog' Line 2,
Column 1,
Apparently, CreateObject("UserAccounts.CommonDialog") couldn't create
the window. Do I use some other mean to create a dialog under MSI?
Kuro
> ----------------------------------------
>
> From: "T. Kuro Kurosaka"<[email protected]>
>
> Sent: Tuesday, January 17, 2012 7:20 PM
>
> To: [email protected]
>
> Subject: [WiX-users] How to bring a VBScript window in front of the wizard
> window?
>
>
> I have this wix code that calls a VBScript code to show a window:
>
>
> <CustomAction Id="AskLicense" Script="vbscript">
>
> <![CDATA[
>
> MsgBox "The License File Path will be asked here by a file dialog
>
> eventually.", 1, "License File Needed"
>
> Session.Property("SELECTEDRLPLICENSEFILE") =
>
> "C:/dummy/location/foo.txt"
>
> ]]>
>
> </CustomAction>
>
>
> <InstallExecuteSequence>
>
> <Custom Action="AskLicense" After="InstallValidate">Not Installed</Custom>
>
> </InstallExecuteSequence>
>
>
> The window is shown but it's hidden under the wizard window.
>
> How can I bring it to the front, or else side of the wizard window?
>
>
> Kuro
>
>
> ----------------------------------------------------------------------------
> --
>
> Keep Your Developer Skills Current with LearnDevNow!
>
> The most comprehensive online learning library for Microsoft developers
>
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>
> Metro Style Apps, more. Free future releases when you subscribe now!
>
> http://p.sf.net/sfu/learndevnow-d2d
>
> _______________________________________________
>
> WiX-users mailing list
>
> [email protected]
>
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users