Wystąpił problem z poważnym uaktualnieniem. Instalator zawiera usługę i podczas aktualizacji otrzymałem komunikat informujący, że do zakończenia procesu instalacji wymagane jest ponowne uruchomienie.WiX: zatrzymaj usługę przed RemoveExistingProducts LUB uruchom podwyższoną CustomAction, aby zatrzymać proces przed RemoveExistingProducts
Aby temu zapobiec, po prostu trzeba zatrzymać usługę przed wykonaniem RemoveExistingProducts
(raczej InstallValidate
).
Numer MajorUpgrade
jest umieszczony po InstallInitialize
, a pakiet ma InstallPrivileges="elevated"
.
Mam dwa przypadki:
Przypadek 1: Usługa jest zainstalowane przez ServiceInstall
poprzez
<Component Id="myservice_Service" Guid="*">
<File Id="myservice.exe" KeyPath="yes" Vital="yes"
Source="SourceDir\bin\myservice.exe"/>
<ServiceInstall Id="myservice_ServiceInstall" Type="ownProcess"
Vital="yes" Name="myservice" DisplayName="myservice Service"
Description="myservice Service" Start="auto" Account=".\LocalSystem"
ErrorControl="ignore" Interactive="no" Arguments="--run"/>
<ServiceControl Id="myservice_ServiceControl" Name="myservice" Wait="yes" Stop="uninstall"/>
</Component>
ServiceControl
nie zatrzymując usługę przed InstallValidate
nazywa. Nawet gdy mówisz Stop = "oba". Pojawi się popup. Zwróć uwagę, że usługa nie została uruchomiona przez instalatora.
Rozsądne posty Znalazłem (fragment):
- How does one stop a Windows service to do an upgrade install?
- Upgrade a Windows Service without Uninstalling
Przypadek 2: Usługa jest zainstalowany przez CustomAction
(istnieją pewne powody, dla których nie można tego zrobić także poprzez ServiceInstall
). W tym przypadku muszę wywołać plik wykonywalny, aby zatrzymać usługę ("myservice.exe - stop"). W tym celu jest to trudne, ponieważ ze względu na ICE63 nie można zaplanować CustomAction
przed wywołaniem . Jak więc mogę to osiągnąć?
tej pory czytałem posty jak:
- WiX call app on uninstall before User prompt "close manually"
- WiX close application before uninstall - close open applications message
- Close a systemtray app before uninstalling using wix
- http://t53456.windows-development-wix-user.wintalk.us/stop-a-service-before-uninstall-t53456.html
inicjującego exe nie jest opcją, ponieważ muszę produkować zwykły MSI.
znalazłem podobny problem bez odpowiedzi tutaj: Wix Installer Problem: Why does RestartManager mark Service as RMCritical and not RMService
Prawdopodobny duplikat usługi Wix stop na odinstalowaniu/uaktualnieniu: zapobiega "ponownemu uruchomieniu popup" (sytuacja pliku w użyciu)] (https://stackoverflow.com/questions/31787804/wix-stop-service-on- uninstall-upgrade-prevent-prevent-restart-popup-file-in-use-situ) – BartoszKP