Changed: New step for add/remove program

This commit is contained in:
kervala 2016-05-26 19:34:15 +02:00
parent 54f2ba14d7
commit 563911039b
3 changed files with 15 additions and 21 deletions

View file

@ -712,5 +712,12 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const
return CreateShortcuts;
}
#ifdef Q_OS_WIN
// check that Add/Remove entry is created under Windows
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat);
if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry;
#endif
return Done;
}

View file

@ -95,6 +95,7 @@ public:
CopyInstaller,
CreateProfile,
CreateShortcuts,
CreateAddRemoveEntry,
Done
};

View file

@ -152,6 +152,10 @@ void COperationDialog::processNextStep()
createDefaultShortcuts();
break;
case CConfigFile::CreateAddRemoveEntry:
createAddRemoveEntry();
break;
case CConfigFile::Done:
accept();
break;
@ -503,8 +507,6 @@ bool COperationDialog::createDefaultProfile()
config->addProfile(profile);
config->save();
createAddRemoveEntry();
emit done();
return true;
@ -519,12 +521,8 @@ bool COperationDialog::createDefaultShortcuts()
bool COperationDialog::createAddRemoveEntry()
{
QString ff = QApplication::applicationFilePath();
CConfigFile *config = CConfigFile::getInstance();
CFilesCopier copier(this);
const CServer &server = config->getServer();
QString oldInstallerFilename = server.clientFilenameOld;
@ -535,22 +533,9 @@ bool COperationDialog::createAddRemoveEntry()
QString oldInstallerFullPath = config->getSrcServerDirectory() + "/" + oldInstallerFilename;
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
if (QFile::exists(oldInstallerFullPath) && !QFile::exists(newInstallerFullPath))
{
QStringList filter;
filter << oldInstallerFilename;
filter << "msvcp100.dll";
filter << "msvcr100.dll";
copier.setIncludeFilter(filter);
copier.setDesinationDirectory(config->getInstallationDirectory());
copier.exec();
QFile::rename(oldInstallerFullPath, newInstallerFullPath);
}
if (QFile::exists(newInstallerFullPath))
{
#ifdef Q_OS_WIN
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat);
QStringList versionTokens = QString(RYZOM_VERSION).split('.');
@ -575,10 +560,11 @@ bool COperationDialog::createAddRemoveEntry()
// settings.setValue("sEstimatedSize2", 0);
settings.setValue("HelpLink", "http://ryzom.fr/support");
// ModifyPath
#endif
}
}
// emit done();
emit done();
return true;
}