Add and use DO_NOT_REBOOT_IN_SILENT=1 parameter for MSI to not reboot automatically...
authoralex-z <blackslayer4@gmail.com>
Wed, 18 May 2022 11:56:04 +0000 (14:56 +0300)
committerallexzander <allexzander@users.noreply.github.com>
Thu, 19 May 2022 09:52:40 +0000 (12:52 +0300)
Signed-off-by: alex-z <blackslayer4@gmail.com>
admin/win/msi/Nextcloud.wxs
src/gui/updater/ocupdater.cpp

index 8e694b3f69a515168d4565b67f0c753cecf5c3ab..d111245174d896ddbcd631a7dbfaa2f359a5d5af 100644 (file)
@@ -81,7 +81,7 @@
                <Custom Action="RegistryCleanupCustomAction" After="RemoveFiles">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
 
         <!-- Schedule Reboot for the Shell Extensions (in silent installation mode only, or if SCHEDULE_REBOOT argument is set-->
-        <ScheduleReboot After="InstallFinalize">(SCHEDULE_REBOOT=1) OR NOT (UILevel=2)</ScheduleReboot>
+        <ScheduleReboot After="InstallFinalize">(SCHEDULE_REBOOT=1) OR (NOT (UILevel=2) AND NOT (DO_NOT_REBOOT_IN_SILENT=1))</ScheduleReboot>
     </InstallExecuteSequence>
 
     <!-- "Add or Remove" Programs Entries -->
index aecc66c9010b7443fed4e695f8d3d23da76c2f2c..ec0f65547ce9fd591dce9cfb1eb39243c022c288 100644 (file)
@@ -222,7 +222,7 @@ void OCUpdater::slotStartInstaller()
         };
 
         QString msiLogFile = cfg.configPath() + "msi.log";
-        QString command = QString("&{msiexec /promptrestart /passive /i '%1' /L*V '%2'| Out-Null ; &'%3'}")
+        QString command = QString("&{msiexec /promptrestart /passive /i '%1' DO_NOT_REBOOT_IN_SILENT=1 /L*V '%2'| Out-Null ; &'%3'}")
              .arg(preparePathForPowershell(updateFile))
              .arg(preparePathForPowershell(msiLogFile))
              .arg(preparePathForPowershell(QCoreApplication::applicationFilePath()));