@@ -26,7 +26,6 @@ const auto updateAvailableC = QStringLiteral("Updater/updateAvailable");
2626const auto updateTargetVersionC = QStringLiteral(" Updater/updateTargetVersion" );
2727const auto updateTargetVersionStringC = QStringLiteral(" Updater/updateTargetVersionString" );
2828const auto autoUpdateAttemptedC = QStringLiteral(" Updater/autoUpdateAttempted" );
29- const auto msiLogFileNameC = QStringLiteral(" msi.log" );
3029}
3130
3231UpdaterScheduler::UpdaterScheduler (QObject *parent)
@@ -223,7 +222,7 @@ void OCUpdater::slotStartInstaller()
223222 return QDir::toNativeSeparators (path);
224223 };
225224
226- QString msiLogFile = cfg.configPath () + msiLogFileNameC ;
225+ const auto msiLogFile = cfg.msiLogFilePath () ;
227226 QString command = QStringLiteral (" &{msiexec /i '%1' /L*V '%2'| Out-Null ; &'%3'}" )
228227 .arg (preparePathForPowershell (updateFile))
229228 .arg (preparePathForPowershell (msiLogFile))
@@ -305,30 +304,11 @@ void NSISUpdater::slotWriteFile()
305304
306305void NSISUpdater::wipeUpdateData ()
307306{
308- ConfigFile cfg;
309- QSettings settings (cfg.configFile (), QSettings::IniFormat);
310- QString updateFileName = settings.value (updateAvailableC).toString ();
311- if (!updateFileName.isEmpty ()) {
312- if (QFile::remove (updateFileName)) {
313- qCInfo (lcUpdater) << " Removed updater file:" << updateFileName;
314- } else {
315- qCWarning (lcUpdater) << " Failed to remove updater file:" << updateFileName;
316- }
317- }
318- // Also try to remove the msi log file (created when running msiexec)
319- const auto msiLogFileName = QString{cfg.configPath () + msiLogFileNameC};
320- if (QFile::exists (msiLogFileName)) {
321- if (QFile::remove (msiLogFileName)) {
322- qCInfo (lcUpdater) << " Removed msi log file:" << msiLogFileName;
323- } else {
324- qCWarning (lcUpdater) << " Failed to remove msi log file:" << msiLogFileName;
325- }
326- }
327-
328- settings.remove (updateAvailableC);
329- settings.remove (updateTargetVersionC);
330- settings.remove (updateTargetVersionStringC);
331- settings.remove (autoUpdateAttemptedC);
307+ // Deliberately delegated: ConfigFile::cleanUpdaterConfiguration() is also
308+ // reached from Application::configVersionMigration() on the first start of
309+ // a newly installed version, and both paths must remove the installer, not
310+ // just the keys that point at it.
311+ ConfigFile ().cleanUpdaterConfiguration ();
332312}
333313
334314void NSISUpdater::slotDownloadFinished ()
0 commit comments