|
97 | 97 | <WixVariable Id="WixUIDialogBmp" Value="BackGround.bmp" /> |
98 | 98 | <UIRef Id="WixUI_ErrorProgressText" /> |
99 | 99 | <ui:WixUI Id="FeatureTree_ViewLicense" /> |
| 100 | + |
| 101 | + <SetProperty |
| 102 | + Id="NDKillProcess" |
| 103 | + Value=""[WindowsFolder]System32\taskkill.exe" /T /F /IM netdata.exe" |
| 104 | + Before="NDKillProcess" |
| 105 | + Sequence="execute" |
| 106 | + /> |
| 107 | + <CustomAction |
| 108 | + Id="NDKillProcess" |
| 109 | + BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" |
| 110 | + DllEntry="WixQuietExec" |
| 111 | + Execute="deferred" |
| 112 | + Return="ignore" |
| 113 | + Impersonate="no" |
| 114 | + /> |
| 115 | + |
| 116 | + <SetProperty |
| 117 | + Id="NDConfigureServiceRecovery" |
| 118 | + Value=""[WindowsFolder]System32\sc.exe" failureflag "netdata" 1" |
| 119 | + Before="NDConfigureServiceRecovery" |
| 120 | + Sequence="execute" |
| 121 | + /> |
| 122 | + <CustomAction |
| 123 | + Id="NDConfigureServiceRecovery" |
| 124 | + BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" |
| 125 | + DllEntry="WixQuietExec" |
| 126 | + Execute="deferred" |
| 127 | + Return="ignore" |
| 128 | + Impersonate="no" |
| 129 | + /> |
| 130 | + |
| 131 | + <InstallExecuteSequence> |
| 132 | + <Custom Action="NDConfigureServiceRecovery" After="InstallServices" Condition="NOT REMOVE" /> |
| 133 | + <Custom Action="NDKillProcess" Before="RemoveFiles" /> |
| 134 | + </InstallExecuteSequence> |
100 | 135 | </Package> |
101 | 136 |
|
102 | 137 | <Fragment> |
|
190 | 225 | <Custom Action="InstallManifest" After="InstallFiles" /> |
191 | 226 | </InstallExecuteSequence> |
192 | 227 |
|
193 | | - <!-- Added StopNetdataService custom action to ensure service is stopped before file operations --> |
194 | | - <CustomAction Id="StopNetdataService" Directory="System64Folder" ExeCommand='net stop Netdata' Execute="immediate" Return="ignore" /> |
195 | | - <InstallExecuteSequence> |
196 | | - <Custom Action="StopNetdataService" Before="InstallValidate" Condition="Installed AND NOT REMOVE" /> |
197 | | - </InstallExecuteSequence> |
198 | | - |
199 | 228 | <Component Id="NetdataService" Directory="USRBINDIR"> |
200 | 229 | <File Id="netdata.exe" Source="C:\msys64\opt\netdata\usr\bin\netdata.exe" KeyPath="yes" /> |
201 | 230 |
|
|
204 | 233 | DisplayName="Netdata Agent" |
205 | 234 | Description="Distributed, real-time, performance and health monitoring for systems and applications." |
206 | 235 | Type="ownProcess" |
| 236 | + Interactive="no" |
207 | 237 | Start="auto" |
208 | | - ErrorControl="normal" /> |
209 | | - |
210 | | - <!-- Modified to ensure proper service handling during update --> |
211 | | - <ServiceControl Id="ControlService" |
212 | | - Name="Netdata" |
213 | | - Stop="both" |
214 | | - Start="install" |
215 | | - Remove="uninstall" |
216 | | - Wait="yes" /> |
217 | | - |
218 | | - <RegistryValue Root="HKLM" |
219 | | - Key="System\CurrentControlSet\Services\Netdata" |
220 | | - Name="DelayedAutoStart" |
221 | | - Value="1" |
222 | | - Type="integer" /> |
| 238 | + ErrorControl="normal" |
| 239 | + Vital="yes"> |
| 240 | + |
| 241 | + <ServiceConfig |
| 242 | + DelayedAutoStart="yes" |
| 243 | + OnInstall="yes" |
| 244 | + OnReinstall="yes" /> |
| 245 | + |
| 246 | + <util:ServiceConfig |
| 247 | + ResetPeriodInDays="0" |
| 248 | + FirstFailureActionType="restart" |
| 249 | + SecondFailureActionType="restart" |
| 250 | + ThirdFailureActionType="restart" |
| 251 | + RestartServiceDelayInSeconds="60" |
| 252 | + /> |
| 253 | + </ServiceInstall> |
| 254 | + |
| 255 | + <ServiceControl Id="StartService" Name="Netdata" Start="install" Wait="no" /> |
| 256 | + <ServiceControl Id="StopService" Name="Netdata" Remove="uninstall" Stop="both" Wait="yes" /> |
223 | 257 | </Component> |
224 | 258 | </Fragment> |
225 | 259 |
|
|
0 commit comments