Changed: New step for add/remove program

--HG--
branch : develop
This commit is contained in:
kervala 2016-05-26 19:34:15 +02:00
parent 30012f9fb2
commit 1c606692fc
3 changed files with 15 additions and 21 deletions

View file

@ -712,5 +712,12 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const
return CreateShortcuts; 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; return Done;
} }

View file

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

View file

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