Posted at 2006-04-12 04:00
by Wictor Wilén
in
WiX
,
Scripting with
7 comments.
Here are some small tips when using VBScript CustomActions using WIX.
Creating a script CustomAction First 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 CustomAction ID_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 file Create a .VBS file with a function or sub that should be executed.
Sub DoThis MsgBox "Hello there..." End Sub
Add a Binary to the WXS file After 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 id Local_Path is a local path (relative to the wxs file)
Add the action to the install sequence After 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.
#
re: WIX - CustomActions using VBScript by anonymous
#
re: WIX - CustomActions using VBScript by Wictor
#
WIX - accessing properties in script CustomActions by Trackback
#
How to take screenshots using VB Script? by jack
|
Latest Tweet...
""
Categories
.NET,
AJAX,
Business,
Business Intelligence,
C#,
CodePlex,
Downloads,
Hardware,
Internet and the Web,
Internet Explorer,
Live Mesh,
LiveID,
Microsoft,
Microsoft Expression,
Microsoft Office,
msfeedicon,
Network,
Office Open XML,
Oslo,
PDC 08,
Performance Point,
Personal,
Presentations,
Scripting,
Security,
SharePoint,
SharePoint 2010,
SharePoint 2010 Web Parts in Action,
Silverlight,
Software,
SQL Server,
Upset posts,
Virtual PC,
Virtual Server,
Visual Studio,
VMWare,
Web Parts,
Website,
Windows 7,
Windows Azure,
Windows Live,
Windows Live Writer,
Windows Media Center,
Windows Mobile,
Windows Server 2003,
Windows Server 2008,
Windows Server 2008 R2,
Windows Vista,
Windows XP,
WinFX,
WiX,
XML,
XPS,
msfeedicon The one and only feed enhancement utility for Internet Explorer
7.
Read more...
Copyright © Wictor Wilén, 2006-2010.
These postings are provided "AS IS" with no warranties, and confers no rights. The
content of this site are my own personal opinions and do not represent my employer's
view in anyway. In addition, my thoughts and opinions open to change. Therefore
you should not consider past posts to necessarily reflect my current thoughts and
opinions.
Microsoft is a registered trademark of Microsoft Corporation in the United States
and/or other countries.