Following content is directly reprinted from 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 will show in Add/Remove Program Control Panel applet for the installed application.

Here is the list of ARP-related properties:

Some ARP properties will change the way how application can be updated:

Setting the ARPSYSTEMCOMPONENT property to 1 (actually, just having it in the Property table with any value) will hide the application from Add/Remove Programs.

Setting the ARPNOREMOVE property to 1 will hide or disable (on Windows 2000 and Windows XP) the Remove button in Add/Remove Programs.

Setting the ARPNOMODIFY property to 1 will disable the Modify (Change on Windows 2000) button in Add/Remove Programs.

Setting the ARPNOREPAIR property to 1 will 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).  Here is the content of this file:

<Include>
<Property Id="ARPCOMMENTS" Value="Acme Corporation Comments" />
<Property Id="ARPCONTACT" Value="Put your name in here" />
<Property Id="ARPPRODUCTICON" Value="MainIcon.ico" />
<Property Id="ARPHELPLINK" Value="Your help link" />
<Property Id="ARPREADME" Value="Your README link" />
<Property Id="ARPURLINFOABOUT" Value="Your &apos;About&apos; information" />
<Property Id="ARPURLUPDATEINFO" Value="Your &apos;Update&apos; URL" />
<Property Id="ARPHELPTELEPHONE" Value="URL where users can find your support phone number" />
<Property Id="ARPAUTHORIZEDCDFPREFIX" Value="URL of the update channel for the application" />
<Property Id="ARPSIZE" Value="3" /> <!--
<Property Id="ARPNOMODIFY" Value="0" />
<Property Id="ARPNOREPAIR" Value="0" />
<Property Id="ARPNOREMOVE" Value="0" />
<Property Id="ARPSYSTEMCOMPONENT" Value="0" />
--> <Icon Id="MainIcon.ico" SourceFile="MainIcon.ico" /> <!-- Set up ARPINSTALLLOCATION property -->
<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" /> <!-- Sequences -->
<InstallExecuteSequence>
<Custom Action="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> element, 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 that 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 is setting the value of ARPINSTALLLOCATION property.  Because installation directory can be changed by the user either through user interface or command line, we can be sure about it only after installation path will be validated by the installer (more details about this process when we will 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 action which will 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"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi"> <Product Id="{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}"> <Package Id="{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="200"
Languages="1033"
SummaryCodepage="1252"
Platforms="Intel"
ReadOnly="no"
Compressed="yes"
AdminImage="no"
Keywords="Installer"
ShortNames ="no"
Manufacturer="Acme Corporation" /> <?include ControlPanel.wxi ?> <Media Id="1" /> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="Minimal" LongName="MinimalInstallation"> <Component Id="Component1" Guid="{A77C5B06-132D-4884-8E17-EA10A83C812D}">
<CreateFolder />
</Component> </Directory>
</Directory>
</Directory> <Feature Id="Feature1"
Title="Feature1 title"
Description="Feature1 description"
Level="1"
ConfigurableDirectory="INSTALLDIR" > <ComponentRef Id="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的更多相关文章

  1. From MSI to WiX, Part 1 - Required properties, by Alex Shevchuk

    Following content is directly reprinted from From MSI to WiX, Part 1 - Required properties Author: A ...

  2. From MSI to WiX, Part 8 - Major Upgrade, by Alex Shevchuk

    Following content is reprinted from here, please go to the original website for more information. Au ...

  3. From MSI to WiX, Part 4 - Features and Components by Alex Shevchuk

    Following content is directly reprinted from : http://blogs.technet.com/b/alexshev/archive/2008/08/2 ...

  4. WIX Custom Action (immediate, deffered, rollback)

    Following content is directly reprinted from From MSI to WiX, Part 19 - The Art of Custom Action, Pa ...

  5. 【转】busybox分析——arp设置ARP缓存表中的mac地址

    [转]busybox分析——arp设置ARP缓存表中的mac地址 转自:http://blog.chinaunix.net/uid-26009923-id-5098083.html 1. 将arp缓存 ...

  6. Toad for Oracle 12.1下载地址

    32 位版: http://us-downloads.quest.com/Repository/support.quest.com/Toad for Oracle/12.1/Software/Toad ...

  7. Event filter with query "SELECT * FROM __InstanceModi

    Event filter with query "SELECT * FROM __InstanceModi     问题描述: Details -Event filter with quer ...

  8. Windows Server 2008 R2 报错事件ID:10之WMI报错

    问题描述: Details -Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHE ...

  9. Win7系统出现提示: “Windows已遇到关键问题,将在一分钟后自动重新启动。”

    1. 若用户在使用Win7系统时,遇到上述系统故障,建议重启电脑.等电脑开机自检一过,马上按键盘上的F8键,选择进入安全模式.在安全模式下,进行系统还原.其他的解决方法见下. 1.或者,在安全模式下, ...

随机推荐

  1. FormsAuthentication.GetRedirectUrl 方法

    https://msdn.microsoft.com/zh-cn/library/8a22t5t3(v=vs.80) FormsAuthentication.GetRedirectUrl 方法 .NE ...

  2. iOS- iPad UIPopoverController

    在IPAD开发中,有一个很有趣的视图控制器,UIPopoverControllr,它的初始化必须要设置一个"内容视图",相当于它本身只是作为一个“容器”,而显示的内容还需要另外一个 ...

  3. keystone之预备知识点

    1.webobwebob是一个用来封装http request和http response的一个库,都封装成实例,方便解析http request和构建http response.最佳教程地址: ht ...

  4. 继续推广我的新博客xysay:http://www.xysay.com/

    RT 博客收拾了一下,准备以后就在那里记录论文笔记啦,求交流,求推荐,求友链~~~ http://www.xysay.com/

  5. [React] Higher Order Components (replaces Mixins)

    Higher order components will allow you to apply behaviors to multiple React components. So the idea ...

  6. LINUX SHELL条件判断

    算术运算的条件判断 [] [[]]: -eq -ne -lt -le -gt -ge (( )):><>=<== [root@monitor ~]# if (( 2 == 3) ...

  7. iOS 常见知识点(三):Lock

    iOS 常见知识点(一):Runtime iOS 常见知识点(二):RunLoop 锁是最常用的同步工具.一段代码段在同一个时间只能允许被有限个线程访问,比如一个线程 A 进入需要保护代码之前添加简单 ...

  8. GCC生成的汇编代码

    假设我们写了一个C代码文件 code.c包含下面代码: int accum = 0; int sum(int x, int y){ int t = x + y; accum += t; return ...

  9. C语言---翻译过程

    c的实现中包括两种环境: 1.翻译环境(translation environment):源程序---->机器指令 2.执行环境(execution environment):执行机器指令 这两 ...

  10. linux系统学习(常用命令)

    今天调休,闲来无事,研究一下linux系统. Linux常用命令: 一:文件管理 ctrl+alt:在虚拟机与windows之间切换ctrl+g:进入linux输入模式 pwd:查看当前目录 ls:列 ...