|
99 | 99 | ================================================================ |
100 | 100 | --> |
101 | 101 |
|
102 | | - <!-- ExeCommand uses [INSTALLFOLDER] (deferred-safe, MSI auto-passes |
103 | | - it to deferred CAs) for the exe path, and [CustomActionData] for |
104 | | - the args. WiX 4 strips a bare ExeCommand="[CustomActionData]" |
105 | | - (treats it as an empty Target), so we MUST bake [INSTALLFOLDER] |
106 | | - in literally — that keeps the column non-empty and lets MSI |
107 | | - substitute both placeholders at deferred-execution time. --> |
| 102 | + <!-- Use the Property-attribute pattern (MSI Type 50: exe-from-property). |
| 103 | + Discovered the hard way that WiX 4 silently strips [CustomActionData] |
| 104 | + tokens out of ExeCommand at compile time, so Directory+ExeCommand |
| 105 | + CAs end up with empty (or args-less) Target columns. The Property |
| 106 | + pattern bypasses ExeCommand entirely: MSI reads the FULL command |
| 107 | + line (path + args) directly from a property whose name matches the |
| 108 | + CA's Id, which gets auto-populated as CustomActionData for the |
| 109 | + deferred execution. --> |
108 | 110 |
|
109 | 111 | <CustomAction Id="RunConfigureInline" |
110 | | - Directory="INSTALLFOLDER" |
111 | | - ExeCommand='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" [CustomActionData]' |
| 112 | + Property="RunConfigureInline" |
112 | 113 | Execute="deferred" |
113 | 114 | Impersonate="no" |
114 | 115 | Return="check"/> |
115 | 116 |
|
116 | 117 | <CustomAction Id="RunConfigureFromFile" |
117 | | - Directory="INSTALLFOLDER" |
118 | | - ExeCommand='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" [CustomActionData]' |
| 118 | + Property="RunConfigureFromFile" |
119 | 119 | Execute="deferred" |
120 | 120 | Impersonate="no" |
121 | 121 | Return="check"/> |
122 | 122 |
|
123 | 123 | <CustomAction Id="RunInstallScheduledTask" |
124 | | - Directory="INSTALLFOLDER" |
125 | | - ExeCommand='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" [CustomActionData]' |
| 124 | + Property="RunInstallScheduledTask" |
126 | 125 | Execute="deferred" |
127 | 126 | Impersonate="no" |
128 | 127 | Return="check"/> |
129 | 128 |
|
130 | 129 | <CustomAction Id="RunUninstallScheduledTask" |
131 | | - Directory="INSTALLFOLDER" |
132 | | - ExeCommand='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" [CustomActionData]' |
| 130 | + Property="RunUninstallScheduledTask" |
133 | 131 | Execute="deferred" |
134 | 132 | Impersonate="no" |
135 | 133 | Return="ignore"/> |
136 | 134 |
|
137 | | - <!-- SetProperty values now contain ONLY the args (not the exe path), |
138 | | - which become [CustomActionData] for the matching deferred CA. --> |
| 135 | + <!-- SetProperty values now carry the FULL command line (exe path + args). |
| 136 | + [INSTALLFOLDER] and the per-tenant properties are substituted at |
| 137 | + immediate-phase execution time (when they ARE expandable), then |
| 138 | + the resulting string is shipped to the deferred CA via the matching |
| 139 | + property name. --> |
139 | 140 |
|
140 | 141 | <SetProperty Id="RunConfigureInline" |
141 | | - Value='configure --non-interactive --customer-id "[CUSTOMERID]" --api-endpoint "[APIENDPOINT]" --api-key "[APIKEY]" --scan-frequency "[SCANFREQUENCY]"' |
| 142 | + Value='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" configure --non-interactive --customer-id "[CUSTOMERID]" --api-endpoint "[APIENDPOINT]" --api-key "[APIKEY]" --scan-frequency "[SCANFREQUENCY]"' |
142 | 143 | Sequence="execute" |
143 | 144 | Before="RunConfigureInline" |
144 | 145 | Condition="APIKEY AND NOT BOOTSTRAPFILE AND NOT Installed"/> |
145 | 146 |
|
146 | 147 | <SetProperty Id="RunConfigureFromFile" |
147 | | - Value='configure --non-interactive --from-file "[BOOTSTRAPFILE]"' |
| 148 | + Value='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" configure --non-interactive --from-file "[BOOTSTRAPFILE]"' |
148 | 149 | Sequence="execute" |
149 | 150 | Before="RunConfigureFromFile" |
150 | 151 | Condition="BOOTSTRAPFILE AND NOT Installed"/> |
151 | 152 |
|
152 | 153 | <SetProperty Id="RunInstallScheduledTask" |
153 | | - Value='install' |
| 154 | + Value='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" install' |
154 | 155 | Sequence="execute" |
155 | 156 | Before="RunInstallScheduledTask" |
156 | 157 | Condition="NOT Installed"/> |
157 | 158 |
|
158 | 159 | <SetProperty Id="RunUninstallScheduledTask" |
159 | | - Value='uninstall' |
| 160 | + Value='"[INSTALLFOLDER]stepsecurity-dev-machine-guard.exe" uninstall' |
160 | 161 | Sequence="execute" |
161 | 162 | Before="RunUninstallScheduledTask" |
162 | 163 | Condition="REMOVE="ALL""/> |
|
0 commit comments