|
|
|
@ -727,13 +727,12 @@ void COperationDialog::copyInstaller()
|
|
|
|
|
QString destinationDirectory = config->getInstallationDirectory();
|
|
|
|
|
|
|
|
|
|
// rename old client to installer
|
|
|
|
|
QString newInstallerFilename = config->getInstallerFilename();
|
|
|
|
|
|
|
|
|
|
if (!newInstallerFilename.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
QString oldInstallerFullPath = QApplication::applicationFilePath();
|
|
|
|
|
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
|
|
|
|
|
QString oldInstallerFullPath = QApplication::applicationFilePath();
|
|
|
|
|
QString newInstallerFullPath = config->getInstallerInstalledFilePath();
|
|
|
|
|
|
|
|
|
|
if (!newInstallerFullPath.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
// always copy new installers
|
|
|
|
|
CFilesCopier copier(this);
|
|
|
|
|
copier.setIncludeFilter(config->getInstallerRequiredFiles());
|
|
|
|
@ -931,36 +930,31 @@ bool COperationDialog::createAddRemoveEntry()
|
|
|
|
|
{
|
|
|
|
|
CConfigFile *config = CConfigFile::getInstance();
|
|
|
|
|
|
|
|
|
|
QString newInstallerFilename = config->getInstallerFilename();
|
|
|
|
|
QString newInstallerFullPath = config->getInstallerInstalledFilePath();
|
|
|
|
|
|
|
|
|
|
if (!newInstallerFilename.isEmpty())
|
|
|
|
|
if (!newInstallerFullPath.isEmpty() && QFile::exists(newInstallerFullPath))
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
QString nativeFullPath = QDir::toNativeSeparators(newInstallerFullPath);
|
|
|
|
|
|
|
|
|
|
settings.setValue("Comments", config->getProductComments());
|
|
|
|
|
settings.setValue("DisplayIcon", nativeFullPath + ",0");
|
|
|
|
|
settings.setValue("DisplayName", QApplication::applicationName());
|
|
|
|
|
settings.setValue("InstallDate", QDateTime::currentDateTime().toString("Ymd"));
|
|
|
|
|
settings.setValue("InstallLocation", config->getInstallationDirectory());
|
|
|
|
|
settings.setValue("NoModify", 0);
|
|
|
|
|
settings.setValue("NoRemove", 0);
|
|
|
|
|
settings.setValue("NoRepair", 0);
|
|
|
|
|
if (!config->getProductPublisher().isEmpty()) settings.setValue("Publisher", config->getProductPublisher());
|
|
|
|
|
settings.setValue("QuietUninstallString", nativeFullPath + " -u -s");
|
|
|
|
|
settings.setValue("UninstallString", nativeFullPath + " -u");
|
|
|
|
|
if (!config->getProductUpdateUrl().isEmpty()) settings.setValue("URLUpdateInfo", config->getProductUpdateUrl());
|
|
|
|
|
if (!config->getProductAboutUrl().isEmpty()) settings.setValue("URLInfoAbout", config->getProductAboutUrl());
|
|
|
|
|
if (!config->getProductHelpUrl().isEmpty()) settings.setValue("HelpLink", config->getProductHelpUrl());
|
|
|
|
|
// ModifyPath
|
|
|
|
|
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat);
|
|
|
|
|
|
|
|
|
|
QString nativeFullPath = QDir::toNativeSeparators(newInstallerFullPath);
|
|
|
|
|
|
|
|
|
|
settings.setValue("Comments", config->getProductComments());
|
|
|
|
|
settings.setValue("DisplayIcon", nativeFullPath + ",0");
|
|
|
|
|
settings.setValue("DisplayName", QApplication::applicationName());
|
|
|
|
|
settings.setValue("InstallDate", QDateTime::currentDateTime().toString("Ymd"));
|
|
|
|
|
settings.setValue("InstallLocation", config->getInstallationDirectory());
|
|
|
|
|
settings.setValue("NoModify", 0);
|
|
|
|
|
settings.setValue("NoRemove", 0);
|
|
|
|
|
settings.setValue("NoRepair", 0);
|
|
|
|
|
if (!config->getProductPublisher().isEmpty()) settings.setValue("Publisher", config->getProductPublisher());
|
|
|
|
|
settings.setValue("QuietUninstallString", nativeFullPath + " -u -s");
|
|
|
|
|
settings.setValue("UninstallString", nativeFullPath + " -u");
|
|
|
|
|
if (!config->getProductUpdateUrl().isEmpty()) settings.setValue("URLUpdateInfo", config->getProductUpdateUrl());
|
|
|
|
|
if (!config->getProductAboutUrl().isEmpty()) settings.setValue("URLInfoAbout", config->getProductAboutUrl());
|
|
|
|
|
if (!config->getProductHelpUrl().isEmpty()) settings.setValue("HelpLink", config->getProductHelpUrl());
|
|
|
|
|
// ModifyPath
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateAddRemoveEntry();
|
|
|
|
@ -974,27 +968,24 @@ bool COperationDialog::updateAddRemoveEntry()
|
|
|
|
|
{
|
|
|
|
|
CConfigFile *config = CConfigFile::getInstance();
|
|
|
|
|
|
|
|
|
|
QString newInstallerFilename = config->getInstallerFilename();
|
|
|
|
|
QString newInstallerFullPath = config->getInstallerInstalledFilePath();
|
|
|
|
|
|
|
|
|
|
if (!newInstallerFilename.isEmpty())
|
|
|
|
|
if (!newInstallerFullPath.isEmpty() && QFile::exists(newInstallerFullPath))
|
|
|
|
|
{
|
|
|
|
|
QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename;
|
|
|
|
|
QString newInstallerFilename = config->getInstallerFilename();
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
QString version = QApplication::applicationVersion();
|
|
|
|
|
QString version = QApplication::applicationVersion();
|
|
|
|
|
|
|
|
|
|
settings.setValue("DisplayVersion", version);
|
|
|
|
|
settings.setValue("EstimatedSize", (quint32)(getDirectorySize(config->getInstallationDirectory(), true) / 1024)); // size if in KiB
|
|
|
|
|
settings.setValue("DisplayVersion", version);
|
|
|
|
|
settings.setValue("EstimatedSize", (quint32)(getDirectorySize(config->getInstallationDirectory(), true) / 1024)); // size if in KiB
|
|
|
|
|
|
|
|
|
|
QStringList versionTokens = version.split('.');
|
|
|
|
|
settings.setValue("MajorVersion", versionTokens[0].toInt());
|
|
|
|
|
settings.setValue("MinorVersion", versionTokens[1].toInt());
|
|
|
|
|
QStringList versionTokens = version.split('.');
|
|
|
|
|
settings.setValue("MajorVersion", versionTokens[0].toInt());
|
|
|
|
|
settings.setValue("MinorVersion", versionTokens[1].toInt());
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
@ -1161,7 +1152,7 @@ void COperationDialog::deleteComponentsInstaller()
|
|
|
|
|
dir.removeRecursively();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
path = config->getInstallerOriginalDirPath();
|
|
|
|
|
path = config->getInstallerInstalledDirPath();
|
|
|
|
|
QStringList files = config->getInstallerRequiredFiles();
|
|
|
|
|
|
|
|
|
|
foreach(const QString &file, files)
|
|
|
|
|