Set the folder to ALLUSERS (not a shortcut!) Using WiX

I have an MSI file in which a folder with a bunch of files inside it is installed. I have a location where I put the files:

Windows XP: C: \ Documents and Settings \ All Users \ Documents \ MyFolder

Windows 7: C: \ Users \ Public \ Documents \ MyFolder

The problem is that I don’t want to hard code these paths, but no matter where I look, I can’t figure out how to do it, because, everywhere, I look what they say about creating shortcuts for all users, and this is not what I'm trying to do. How to set the folder to the "All Users" folder?

Something like that:

<PropertyRef Id="WIX_DIR_COMMON_DOCUMENTS" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="WIX_DIR_COMMON_DOCUMENTS"> <Directory Id="MyFolder" Name="MyFolder"> 
+4
source share
1 answer

Windows Installer does not have a property for this folder, but the custom action provided by WiX is performed.

In the OSInfo Custom Actions documentation :

  • Link to the WixUtilExtension extension for the linker.
  • Define the property through the link:

     <PropertyRef Id="WIX_DIR_COMMON_DOCUMENTS" /> 

Then define the directory somewhere in the TARGETDIR directory. For instance:

  <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="WIX_DIR_COMMON_DOCUMENTS">` <Directory Id="MyFolder" Name="MyFolder" />` </Directory>` </Directory>` 
+6
source

Source: https://habr.com/ru/post/1489116/


All Articles