Contents tagged with WiX
Rob Mensching blogs that the WiX version 2 is nearly done, just a few more bugs to slay. Two of the remaining bugs, about dropping/overwriting Sql databases, are important to me so when they are done I will be really happy!
I have been using it for some time now and it is really easy making installers for Windows and Microsoft.NET based applications.
I really look forward to the final release of version 2, and of course the upcoming version 3.
My last post showed how to use VBScript functions as CustomActions. More than often you need to access some of the properties you have defined in your WIX files, for example an installation directory, a connection string etc.To access these properties just use the Session object and it's a Property property.Here's an example with two properties used:
set adam = GetObject(Session.Property("ADSERVER") & "/" & Session.Property("ADSPATH"))The WIX file should contain two properties:
<Property Id="ADSERVER" Admin="yes" >LDAP://server</Property><Property Id="ADSPATH" Admin="yes" ></Property>The Property property is read/write so you can manipulate the properties within your code.
Here are some small tips when using VBScript CustomActions using WIX.Creating a script CustomActionFirst of all you have to create a CustomAction in your WXS file:
<CustomAction Id="Id_Of_ScriptAction" BinaryKey="Id_of_binary" VBScriptCall="Script_Name" />Id_Of_ScriptAction is a unique Id of your CustomActionID_of_binary is the unique Id of the binary that contains the vbs file.Script_Name is the name of the Sub or Function in your vbs file. Creating the VBS fileCreate a .VBS file with a function or sub that should be executed.
Sub DoThis MsgBox "Hello there..."End SubAdd a Binary to the WXS fileAfter creating the script you have to include it into your WXS file. This is done by creating a Binary element like this:
<Binary Id="Id_of_binary" src="Local_Path" />Id_of_binary is a unique idLocal_Path is a local path (relative to the wxs file) Add the action to the install sequenceAfter doing all this you have to tell the installer when and where to execute the custom action, this is done by adding the action to the InstallExecuteSequence element
<InstallExecuteSequence>...<Custom Action="Id_Of_ScriptAction" [After|Before|Sequence]="..." >Condition</Custom>...</InstallExecuteSequence>Id_Of_ScriptAction is your custom action.For more information on the Custom element and the After/Before/Sequence attributes, check out the WIX help file and/or this tutorial.Note: The Execute attribute of the Custom element should be Deferred to execute during the install sequence or Immediate to execute it while the install script is executed, see MSDN for more information on this.