Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ended up bundling elevate.exe from wintellect, deploy it to some temp folder and supply it with a path to command-line script which created all symbolic links. Than it was invoked via the custom action. Command line file in turn has some goodness inside to detect proper program files folder. or get it from the command line, if needed. It appears that even though WiX correctly elevates the custom action, msi (or Windows Installer) itself doesn't grant it sufficient rights to properly run mklink command.</p> <p>Also note that <strong>Impersonate="yes"</strong> in the CA. I believe that's what will let msi to show elevation dialog box when it executes the action.</p> <p><strong>command line file:</strong></p> <pre><code>cd /D %~p0 IF EXIST "%PROGRAMFILES(x86)%" SET PROGFILES=%PROGRAMFILES(x86)% IF "%PROGFILES%".=="". SET PROGFILES=%PROGRAMFILES% SET INSTALLPATH=%PROGFILES%\MyGreatProduct SET DATAPATH=%PROGRAMDATA%\MyGreatProduct IF NOT "%~1."=="." SET INSTALLPATH=%~1 IF NOT "%~2."=="." SET DATAPATH=%~2 IF EXIST "%INSTALLPATH%" mklink "%INSTALLPATH%\veryimportant.ini" "%DATAPATH%\veryimportant.ini" </code></pre> <p><strong>in the wxs file:</strong></p> <pre><code>&lt;Component Directory="TempFolder" Id='Comp_Temp_Makesymlinks' Guid='47a58219-1291-4321-4321-176987154921'&gt; &lt;File Id='makesymlinks_cmd' Source='makesymlinks.cmd'&gt; &lt;Permission User='Everyone' GenericAll='yes' /&gt; &lt;/File&gt; &lt;File Id='elevate_exe' Source='elevate.exe'&gt; &lt;Permission User='Everyone' GenericAll='yes' /&gt; &lt;/File&gt; &lt;/Component&gt; &lt;SetProperty Id="CA_MakeSymLinksCmd" Before="CA_MakeSymLinksCmd" Sequence="execute" Value="&amp;quot;[TempFolder]\elevate.exe&amp;quot; &amp;quot;[TempFolder]\makesymlinks.cmd&amp;quot;" /&gt; &lt;CustomAction Id="CA_MakeSymLinksCmd" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="yes" /&gt; &lt;InstallExecuteSequence&gt; &lt;Custom Action="CA_MakeSymLinksCmd" Before="InstallFinalize"&gt;&lt;![CDATA[NOT Installed AND VersionNT &gt;= 600 ]]&gt;&lt;/Custom&gt; &lt;/InstallExecuteSequence&gt; </code></pre>
    singulars
    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.
    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