Changed: Update Add/Remove program

This commit is contained in:
kervala 2016-06-19 21:08:23 +02:00
parent b7c634fd72
commit 19aeadc732
2 changed files with 32 additions and 0 deletions

View file

@ -975,6 +975,37 @@ bool COperationDialog::createAddRemoveEntry()
return true;
}
bool COperationDialog::updateAddRemoveEntry()
{
CConfigFile *config = CConfigFile::getInstance();
const CServer &server = config->getServer();
QString oldInstallerFilename = server.clientFilenameOld;
QString newInstallerFilename = server.installerFilename;
if (!oldInstallerFilename.isEmpty() && !newInstallerFilename.isEmpty())
{
QString oldInstallerFullPath = config->getSrcServerDirectory() + "/" + oldInstallerFilename;
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
if (QFile::exists(newInstallerFullPath))
{
#ifdef Q_OS_WIN
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat);
QStringList versionTokens = QApplication::applicationVersion().split('.');
settings.setValue("DisplayVersion", QApplication::applicationVersion());
settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory()));
settings.setValue("MajorVersion", versionTokens[0].toInt());
settings.setValue("MinorVersion", versionTokens[1].toInt());
#endif
}
}
return true;
}
bool COperationDialog::deleteAddRemoveEntry()
{
#ifdef Q_OS_WIN

View file

@ -107,6 +107,7 @@ protected:
bool createClientMenuShortcut(const QString &profileId);
bool createAddRemoveEntry();
bool updateAddRemoveEntry();
bool deleteAddRemoveEntry();
void addComponentsServers();