I use WiX and want to create shortcut in user's start menu like
Start -> [CompanyName] -> [ProgramName] -> App.exe
I can do like
Start -> [ProgramName] -> App.exe
without any problem:
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="RoverSoft Test">
</Directory>
</Directory>
</Directory>
<DirectoryRef Id="ProgramMenuDir">
<Component Id="ProgramMenuDirComponent" Guid="{A9858D4C-085A-4132-AD2E-F90A1E5C64A6}">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes" />
</Component>
</DirectoryRef>
But if I add one more level of folders then I get error: Error 1 ICE64: The directory ProgramMenuSubDir is in the user profile but is not listed in the RemoveFile table.
as I understand, it means, that I should fully clear after a system uninstall (from registry in this case). How to do it?
For every folder in the user's profile, you'll want to ensure the folder is removed. So, you can adjust your example like so:
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuCompanyDir" Name="Company Name">
<Directory Id="ProgramMenuProgramDir" Name="ProgramName"/>
</Directory>
</Directory>
</Directory>
<Component Id="ProgramMenuCompanyDirComponent" Directory='ProgramMenuCompanyDir'>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name='InstallVersion'
Value="[ProductVersion]" Type="string" />
<RemoveFolder Id="RemoveProgramMenuCompanyDir" On="uninstall" />
</Component>
<Component Id="ProgramMenuProgramDirComponent" Directory='ProgramMenuProgramDir'>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name='InstallFolder'
Value='[INSTALLFOLDER]' Type="string" />
<RemoveFolder Id="RemoveProgramMenuProgramDir" On="uninstall" />
</Component>
That ensures that all the per-user folders have per-user key paths (the registry keys) and are correctly marked to be removed during uninstall.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With