Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove "Change" and "Repair" buttons in Add or Remove Programs

Tags:

wix

I have created a Wix installer and have packed it in a bootstrap program.

When I execute the bootstrap program it creates the following entries in the registry :

alt text http://n2.nabble.com/file/n4011693/Up.jpg

When I run the bootstrap program it installs well and when I run the Add/Remove programs it shows "Change" button and "Repair" button. My requirement is that

  • I want these two buttons to be one as "Change/Repair" like in other applications
  • When I select this button I want my bootstrap program (setup.exe) to run and not the msi

This is my code area :

<Property Id="EXTUNINSTALL" Value="0"/>
<Property Id="UNINSTALLEXE" Value="msiexec.exe"/>

<!-- The Uninstall shortcut target executable & arguments-->
<CustomAction Id="SetUNINSTALLEXE_EXT" Property="UNINSTALLCMD"
                     Value="[INSTALLEREXEDIR][INSTALLEREXE]"/>
<CustomAction Id="SetUNINSTALLARG_EXT"
              Property="UNINSTALLARG"
              Value="/MAINTENANCE /SILENT="SGWLRPFCE"  
                     /LANG="[ProductLanguage]""/>
<CustomAction Id="SetSYSTEMARPCOMPONENT"
              Property="ARPSYSTEMCOMPONENT"
              Value="1"/>

<CustomAction Id="SetUNINSTALLARG"
              Property="UNINSTALLARG"
              Value="/x [ProductCode]"/>
<CustomAction Id="SetUNINSTALLEXE"
              Property="UNINSTALLCMD"
              Value="[SystemFolder]msiexec.exe"/>

<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION"
         Value="[MAININSTALLERFOLDER]" />

<InstallExecuteSequence>
  <RemoveExistingProducts Before="InstallInitialize" />
  <Custom Action="SetARPINSTALLLOCATION" After="CostFinalize"/>
  <Custom Action="SetUNINSTALLEXE_EXT"
          After="SetARPINSTALLLOCATION"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetUNINSTALLARG_EXT"
          After="SetUNINSTALLEXE_EXT"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetSYSTEMARPCOMPONENT"
          After="SetUNINSTALLARG_EXT"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetUNINSTALLARG"
          After="SetSYSTEMARPCOMPONENT"><![CDATA[EXTUNINSTALL=0]]></Custom>
  <Custom Action="SetUNINSTALLEXE"
          After="SetUNINSTALLARG"><![CDATA[EXTUNINSTALL=0]]></Custom>
</InstallExecuteSequence>
like image 652
user187023 Avatar asked Nov 16 '09 12:11

user187023


3 Answers

You can set the ARPNOMODIFY and ARPNOREPAIR properties in wix, which will disable the "change" and "repair" options for your product in the "add/remove programs" list. (This is actually equivalent to leppie's answer, but it's a better idea to use the Windows Installer properties rather than hacking at the registry directly.)

<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> 
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
like image 63
Wim Coenen Avatar answered Nov 18 '22 00:11

Wim Coenen


As per @Wim Coenen To disable Remove “Change” and “Repair” buttons in Add or Remove Programs set following property.

ARPNOREPAIR and ARPNOMODIFY

This is sample code for disable Repair and Upgrade option.

<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> 
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
like image 28
Rikin Patel Avatar answered Nov 17 '22 22:11

Rikin Patel


Suggestion for the first part of the question:

"I want these two buttons to be one as "Change/Repair" like in other applications"

I am running Windows 7 and the only thing close to this option is some applications having 'Uninstall/Change' merged together.

To accomplish ONE button (existing in Wix 3.7) 'Uninstall/Change' instead of 'Uninstall' and 'Change' separately the bundle tag has to be adjusted as below.

<Bundle ...
        DisableModify="button">
like image 24
Henrik Avatar answered Nov 17 '22 22:11

Henrik