Notice: I've prepared my scripts into this repository github: IS2WiX [5].
Preparation
Installing WiX Toolset will get you all the tools to compile all XML files in your WiX project. It will also install templates to Visual Studio and VS does automatically configure compilation options for you.
We need programming knowledge from XSLT/XPATH to operate on XML files, also some VB.NET knowledge to write customized custom actions.
Here is a list of all related tools and languages.
- WiX Toolset[1], documentation
- Visual Studio 2012
- Microsoft SDK (Orca.exe, Wilogutl.exe etc.[2])
- XSLT, XPath, XML
- VB.NET Custom Actions
- InstallShield, Help file
- Your InstallShield project file and Internet Explorer[3]
The Idea
WiX and InstallShield are tools to make .msi
packages, they all base on Microsoft Windows Installer technology. They all use .xml
files to represent their project, where .xml
is either handcrafted or auto-generated from parameters set from a graphic interface. So to build a bridge between the two, we seek XSLT
for help.
Example
Your Binary table shall look similar to this.<table name="Binary"> <col key="yes" def="s72">Name</col> <col def="V0">Data</col> <col def="S255">ISBuildSourcePath</col> <row><td>ISLockPermissions.dll</td><td/><td>[ISProductFolder]\redist\Language Independent\i386\ISLockPermissions.dll</td></row> <row><td>ISSCHRPL.DLL</td><td/><td>[ISProductFolder]\redist\language independent\i386\isschrpl.dll</td></row> <row><td>ISSetup.dll</td><td/><td>[ISProductFolder]\redist\language independent\i386\ISSetup.dll</td></row> ... </table>
Let's write a stylesheet to convert the above table to WiX format,
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/"> <xsl:for-each select="/table/row"> <Binary> <xsl:attribute name="Id"> <xsl:value-of select="td[1]" /></xsl:attribute> <xsl:attribute name="SourceFile"> <xsl:value-of select="td[3]" /></xsl:attribute> </Binary> </xsl:for-each> </xsl:template> </xsl:stylesheet>
The output shall look like,
<Binary Id="ISLockPermissions.dll" SourceFile="[ISProductFolder]\redist\Language Independent\i386\ISLockPermissions.dll" /> <Binary Id="ISSCHRPL.DLL" SourceFile="[ISProductFolder]\redist\language independent\i386\isschrpl.dll" /> <Binary Id="ISSetup.dll" SourceFile="[ISProductFolder]\redist\language independent\i386\ISSetup.dll" />
View the InstallShield Project
Your project is composed of tables. With the help of stylesheet written inis.xsl
[4], you could have a direct view of all these tables.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="is.xsl" ?>
From InstallShiled MSI tables to WiX
One can search help files provided by WiX to study how it is really mapped. The following is an incomplete list collected while I was working on a migration project.
IS/MSI | WiX Element | Parent | |
---|---|---|---|
ActionText | ProgressText | UI | |
AdminExecuteSequence | AdminExecuteSequence | Fragment | |
AdminUISequence | AdminUISequence | Fragment | |
AdvtExecuteSequence | AdvertiseExecuteSequence | Product | |
AppSearch | DirectorySearch | Property | |
Binary | Binary | Fragment | |
CheckBox | Control Type="CheckBox" CheckBoxValue="" | Dialog | |
Component | Component | Fragment, Directory | |
Control | Control | Dialog | |
ControlCondition | Condition | Control | |
ControlEvent | Publish | UI | |
CreateFolder | CreateFolder | Directory | |
CustomAction | CustomAction | Fragment | |
Dialog | Dialog | UI | |
Directory | Directory | Directoryref, Fragment | |
DrLocator | DirectorySearch | Property | |
Error | Error | UI | |
EventMapping | Subscribe | Control | |
Feature | Feature | FeatureGroup, Fragment | |
FeatureComponents | FeatureRef, ComponentRef, ComponentGroupRef | Fragment | |
File | File | Component | |
Font | File TrueType=yes | Component | |
ISString | String | WixLocalization | |
Icon | Icon | Shortcut | |
InstallExecuteSequence | InstallExecuteSequence | Product | |
InstallUISequence | InstallUISequence | UI | |
Property | Property | Product | |
RadioButton | RadioButton, RadioButtonGroup | Control | |
Registry | Registry | Component | |
ServiceControl | ServiceControl | Component | |
ServiceInstall | ServiceInstall | Component | |
Shortcut | Shortcut | Component | |
TextStyle | TextStyle | UI | |
UIText | UIText | UI | |
Upgrade | Upgrade, UpgradeVersion | Product |
Footnote
- WiX Toolset
- Windows Installer Development Tools
- Chrome will have problems viewing an
.xml
file referencing another.xsl
file locally due to the cross-origin security issue. - By default, the stylesheet file should be at
C:\Program Files (x86)\InstallShield\2011\Support\is.xsl
- Github: IS2WiX
Can you give examples how to convert .ism file to WiX using this tool?
ReplyDeleteHow to assemble them etc?
What kind of issue you run into and how to fix them?
I was not directly converting .ism to WiX xml file, but selectively. The code hosted on github is to facilitate the process. Some online xslt interpreter would run my code. I run into this issue since my past works involves such migration. After all, installshield is licensed and expensive.
DeleteThanks to mzt!! Here an informative post I got. Installsheild Installer is good. I think InstallAware is better then Installshield and others.
ReplyDeleteGoogle Cloud online training
ReplyDeleteIBM Intergration Bus online training
IBM Message Queue online training
Install shield online training