|
97 | 97 | <RegistrySearch Id="Local" Root="HKLM" Key="[%agent_regpath%]" Name="local" Type="raw"/>
|
98 | 98 | </Property>
|
99 | 99 | <SetProperty Id="CMDLINE_LOCAL" Before="AppSearch" Value="[LOCAL]" />
|
100 |
| - <SetProperty Id="LOCAL" After="AppSearch" Value="[CMDLINE_LOCAL]"><![CDATA[CMDLINE_LOCAL<>"" OR CMDLINE_CONFIG="reset"]]></SetProperty> |
| 100 | + <!-- Also compare to ProgramFiles64Folder to fix wrongly set LOCAL in 1.7.2 --> |
| 101 | + <SetProperty Id="LOCAL" After="AppSearch" Value="[CMDLINE_LOCAL]"><![CDATA[CMDLINE_LOCAL<>"" OR LOCAL=INSTALLDIR OR CMDLINE_CONFIG="reset"]]></SetProperty> |
| 102 | + <SetDirectory Id="_LOCALDIR" Before="CostFinalize" Value="[LOCAL]" /> |
101 | 103 |
|
102 | 104 | <Property Id="ADDITIONAL_CONTENT" Secure="yes">
|
103 | 105 | <RegistrySearch Id="AdditionalContent" Root="HKLM" Key="[%agent_regpath%]" Name="additional-content" Type="raw"/>
|
|
471 | 473 | <LaunchConditions Sequence="400" />
|
472 | 474 |
|
473 | 475 | [%- IF bits==32 %]
|
474 |
| - <Custom Action="SchedSecureObjects" After="CreateFolders"><![CDATA[NOT REMOVE~="ALL"]]></Custom> |
| 476 | + <Custom Action="SchedSecureObjects" After="CreateFolders"><![CDATA[NOT INSTALLDIR<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
| 477 | + <Custom Action="SetFixInstallDir" After="SchedSecureObjects"><![CDATA[NOT INSTALLDIR<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
| 478 | + <Custom Action="FixInstallDir" After="SetFixInstallDir"><![CDATA[NOT INSTALLDIR<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
| 479 | + <Custom Action="SetFixLocalDir" After="SchedSecureObjects"><![CDATA[LOCAL<>"" AND NOT LOCAL<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
| 480 | + <Custom Action="FixLocalDir" After="SetFixLocalDir"><![CDATA[LOCAL<>"" AND NOT LOCAL<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
475 | 481 | [%- ELSE %]
|
476 |
| - <Custom Action="SchedSecureObjects_x64" After="CreateFolders"><![CDATA[NOT REMOVE~="ALL"]]></Custom> |
| 482 | + <Custom Action="SchedSecureObjects_x64" After="CreateFolders"><![CDATA[NOT INSTALLDIR<<ProgramFiles64Folder AND NOT REMOVE~="ALL"]]></Custom> |
| 483 | + <Custom Action="SetFixInstallDir" After="SchedSecureObjects_x64"><![CDATA[NOT INSTALLDIR<<ProgramFiles64Folder AND NOT REMOVE~="ALL"]]></Custom> |
| 484 | + <Custom Action="FixInstallDir" After="SetFixInstallDir"><![CDATA[NOT INSTALLDIR<<ProgramFiles64Folder AND NOT REMOVE~="ALL"]]></Custom> |
| 485 | + <Custom Action="SetFixLocalDir" After="SchedSecureObjects_x64"><![CDATA[LOCAL<>"" AND NOT LOCAL<<ProgramFiles64Folder AND NOT REMOVE~="ALL"]]></Custom> |
| 486 | + <Custom Action="FixLocalDir" After="SetFixLocalDir"><![CDATA[LOCAL<>"" AND NOT LOCAL<<ProgramFilesFolder AND NOT REMOVE~="ALL"]]></Custom> |
477 | 487 | [%- END %]
|
478 |
| - <Custom Action="SetFixInstallDir" After="SchedSecureObjects"><![CDATA[NOT REMOVE~="ALL"]]></Custom> |
479 |
| - <Custom Action="FixInstallDir" After="SetFixInstallDir"><![CDATA[NOT REMOVE~="ALL"]]></Custom> |
480 | 488 | <Custom Action="UpdateLocalDir" Before="CostFinalize"><![CDATA[LOCAL<>"" AND NOT LOCAL>>"\" AND NOT REMOVE~="ALL"]]></Custom>
|
481 |
| - <Custom Action="SetFixLocalDir" After="SchedSecureObjects"><![CDATA[LOCAL<>"" AND NOT REMOVE~="ALL"]]></Custom> |
482 |
| - <Custom Action="FixLocalDir" After="SetFixLocalDir"><![CDATA[LOCAL<>"" AND NOT REMOVE~="ALL"]]></Custom> |
483 | 489 |
|
484 | 490 | <!-- Schedule custom action to always remove windows task if exists -->
|
485 | 491 | <Custom Action="SetEndTask" Before="EndTask" />
|
|
1037 | 1043 | </Directory> <!-- INSTALLDIR -->
|
1038 | 1044 | </Directory> <!-- ProgramFilesFolder -->
|
1039 | 1045 |
|
| 1046 | + <Directory Id="_LOCALDIR"> |
| 1047 | + <Component Id="LocalDir" Guid="$(var.LocalDirGuid)" KeyPath="yes" Feature="feat_AGENT"> |
| 1048 | + <CreateFolder> |
| 1049 | + <util:PermissionEx GenericAll="yes" User="CREATOR OWNER" /> |
| 1050 | + <util:PermissionEx GenericAll="yes" User="LocalSystem" /> |
| 1051 | + <util:PermissionEx GenericAll="yes" User="Administrators" /> |
| 1052 | + <util:PermissionEx GenericExecute="yes" GenericRead="yes" User="AuthenticatedUser" /> |
| 1053 | + </CreateFolder> |
| 1054 | + <RemoveFolder Id="rm.local" On="uninstall" /> |
| 1055 | + <Condition><![CDATA[LOCAL<>""]]></Condition> |
| 1056 | + </Component> |
| 1057 | + </Directory> |
| 1058 | + |
1040 | 1059 | <Directory Id="ProgramMenuFolder" />
|
1041 | 1060 |
|
1042 | 1061 | </Directory> <!-- TARGETDIR -->
|
|
0 commit comments