Following content is directly reprinted from-MSI to WiX, part 2-arp support
Author:alex Shevchuk
Adding add/remove Program (ARP) support
Subset of properties stored in the property table defines the information operating system would show in Add/remove program Control Panel applet for the installed application.
Here is the list of arp-related properties:
- Arpcomments
- Arpcontact
- Arpproducticon
- Arphelplink
- Arpreadme
- Arpurlinfoabout
- Arpurlupdateinfo
- Arphelptelephone
- Arpauthorizedcdfprefix
- Arpsize
- Arpinstalllocation
Some ARP Properties would change the the-the-application can be updated:
- Arpnomodify
- Arpnoremove
- Arpnorepair
- Arpsystemcomponent
Setting the Arpsystemcomponent property to 1 (actually, just has it in the property table with any value) would hide the Application from Add/remove Programs.
Setting the Arpnoremove property to 1 would hide or disable (on Windows $ and Windows XP) the Remove button in Add/remove Programs.
Setting the Arpnomodify property to 1 would disable the Modify ( change on Windows $) button in Add/rem Ove Programs.
Setting the Arpnorepair property to 1 would disable the Repair button in Add/remove Programs.
Because I don ' t want to clutter my main project file, I decided to put all arp-related information in the separate include File (CONTROLPANEL.WXI). The content of this file:
<Include> < PropertyId= "Arpcomments"Value= "Acme Corporation Comments" /> < PropertyId= "Arpcontact"Value= "Put your name in here" /> < PropertyId= "Arpproducticon"Value= "Mainicon.ico" /> < PropertyId= "Arphelplink"Value= "Your Help link" /> < PropertyId= "Arpreadme"Value= "Your README link" /> < PropertyId= "Arpurlinfoabout"Value= "Your ' about' Information " /> < PropertyId= "Arpurlupdateinfo"Value= "Your ' update' URL " /> < PropertyId= "Arphelptelephone"Value= "URL where users can find your support phone number" /> < PropertyId= "Arpauthorizedcdfprefix"Value= "URL of the update channel for the application" /> < PropertyId= "Arpsize"Value= "3" /> <!--<property id= "arpnomodify" value= "0"/> <property id= "Arpnorepair" value= "0"/> <property Id= "ARPNO REMOVE "value=" 0 "/> <property id=" arpsystemcomponent "value=" 0 "/> - <IconId= "Mainicon.ico"sourcefile= "Mainicon.ico" /> <!--Set up Arpinstalllocation Property - <CustomActionId= "Setarpinstalllocation" Property= "Arpinstalllocation"Value= "[INSTALLDIR]" /> <!--sequences - <InstallExecuteSequence> <CustomAction= "Setarpinstalllocation" After= "Installvalidate"></Custom> </InstallExecuteSequence></Include>
As you can see, in many cases, setting the value of the property is just simple declaration of the <Property> Elemen T, where Id attribute is set to the name of the property in the property table and the value attribute defines its value.
Situation is slightly more complicated when we set the product icon. We need to add the <Icon> element and make sure this Id attribute of the <Icon> element has the same value as The Value attribute of the <Property> element with the Id attribute of Arpproducticon. SourceFile attribute of the <Icon> element points to an actual Icon file.
Even more complicated was setting the value of the Arpinstalllocation property. Because installation directory can be changed by the user either through user interface or command line, we can be sure AB Out it is only after installation path would be validated by the installer (more details on this process when we'll talk About standard and custom actions). To set the value of Arpinstalllocation property we need to create a record in the CustomAction table with the custom actio n which would set the value of Arpinstalllocation property to the value of INSTALLDIR property. We also need to schedule this custom action to run after the standard installvalidate action.
Here is the updated Minimal.wxs file:
<?XML version= "1.0" encoding= "UTF-8"?><Wixxmlns= "Http://schemas.microsoft.com/wix/2003/01/wi"> <ProductId= "{1effdcd2-4b4b-439e-8296-651795ee02d9}"Name= "Minimal Windows Installer Sample"Language= "1033"Codepage= "1252"Version= "1.0.0"manufacturer= "Acme Corporation"UpgradeCode= "{15f9543c-1c8d-45d6-b587-86e65f914f20}"> < PackageId= "{909A6CE7-2739-4522-92C2-03AD7D7EE4CD}"Description= "Minimal Windows Installer Sample"Comments= "This installer database contains the logic and data required to install Minimal Windows installer Sample."installerversion= "$"Languages= "1033"Summarycodepage= "1252"Platforms= "Intel"ReadOnly= "No"Compressed= "Yes"Adminimage= "No"Keywords= "Installer"Shortnames= "No"manufacturer= "Acme Corporation" /> <?include Controlpanel.wxi?> <MediaId= "1" /> <DirectoryId= "TARGETDIR"Name= "SourceDir"> <DirectoryId= "ProgramFilesFolder"> <DirectoryId= "INSTALLDIR"Name= "Minimal"longname= "Minimalinstallation"> <ComponentId= "Component1"Guid= "{a77c5b06-132d-4884-8e17-ea10a83c812d}"> <CreateFolder/> </Component> </Directory> </Directory> </Directory> <FeatureId= "Feature1"Title= "Feature1 title"Description= "Feature1 description" Level= "1"configurabledirectory= "INSTALLDIR" > <ComponentrefId= "Component1" /> </Feature> </Product></Wix>
Install it and take a look at the ARP properties for our package.
Whats Next
Next time we'll take a look at the application search and launch conditions.
From MSI to WiX, part 2-arp support, by Alex Shevchuk