Note that there are some explanatory texts on larger screens.

plurals
  1. POWiX - How to create an uninstall shortcut for all users?
    primarykey
    data
    text
    <p>This is not a question, but rather an answer.<br> One part of the issue is available here: <a href="https://stackoverflow.com/questions/751000/how-to-install-program-shortcuts-for-all-users">How to install program shortcuts for all users?</a><br> Quote:<br> "... How do I let the installer create a shortcut under the All Users profile, so that everyone on the machine has the shortcut?"<br> Another - here: <a href="https://stackoverflow.com/questions/2058230/wix-create-non-advertised-shortcut-for-all-users-per-machine">Wix create non advertised shortcut for all users / per machine</a><br> Quote:<br> "... In the tutorials I've seen use a registry value for the keypath of a shortcut. The problem is they use HKCU as the root ..."</p> <p>The main difficulty in creating an uninstall shortcut.</p> <p>The solution is based on Rob Menching's blog post <a href="http://robmensching.com/blog/posts/2007/4/27/how-to-create-an-uninstall-shortcut-and-pass-all-the" rel="nofollow noreferrer">How to create an uninstall shortcut (and pass all the ICE validation)</a>. </p> <pre><code>&lt;!-- Script from Rob Menching's blog post --&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt; &lt;Product Id="PUT-GUID-HERE" UpgradeCode="PUT-GUID-HERE" Name="TestUinstallShortcut" Language="1033" Version="1.0.0" Manufacturer="Microsoft Corporation"&gt; &lt;Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /&gt; &lt;Media Id="1" /&gt; &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt; &lt;Directory Id="ProgramMenuFolder"&gt; &lt;Directory Id="ShortcutFolder" Name="My Application"&gt; &lt;Component Id="UninstallShortcutComponent" Guid="PUT-GUID-HERE"&gt; &lt;RegistryKey Root="HKCU" Key="Software\[UpgradeCode]"&gt; &lt;RegistryValue Value="RobMen Was Here." Type="string" KeyPath="yes" /&gt; &lt;/RegistryKey&gt; &lt;Shortcut Id="UninstallProduct" Name="Uninstall My Application" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" Directory="ShortcutFolder" Description="Uninstalls My Application" /&gt; &lt;RemoveFolder Id="RemoveShorcutFolder" On="uninstall" /&gt; &lt;/Component&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;/Directory&gt; &lt;Feature Id="TestUninstallShortcut" Title="Test Uninstall Shortcut Feature" Level="1"&gt; &lt;ComponentRef Id="UninstallShortcutComponent" /&gt; &lt;/Feature&gt; &lt;CustomAction Id="LaunchApp" Directory="TARGETDIR" ExeCommand="[System64Folder]reg.exe Delete HKCU\Software\[UpgradeCode] /f" /&gt; &lt;InstallExecuteSequence&gt; &lt;Custom Action="LaunchApp" After="InstallFinalize"&gt;(NOT Installed) OR UPGRADINGPRODUCTCODE&lt;/Custom&gt; &lt;/InstallExecuteSequence&gt; &lt;/Product&gt; &lt;/Wix&gt; </code></pre> <p>In this example:<br> In the item "Package" added <code>InstallScope ="perMachine"</code><br> Changed the registry key to <code>"Software\[UpgradeCode]"</code><br> Added CustomAction <code>LaunchApp</code> to remove the unwanted registry key. </p> <p>Tested on WinXP 32bit and Win7 64bit.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload