diff --git a/doc/operations.qdoc b/doc/operations.qdoc index 762d1233..56518065 100644 --- a/doc/operations.qdoc +++ b/doc/operations.qdoc @@ -188,6 +188,8 @@ persistently. This is currently only supported on Windows. If \c system is set to \c true, the persistent variable is set system-wide, not only for the current user. + Note, if you set path to environment variable, use '\\' as separator, for example: + @Targetdir@\\lib\\system. \row \li RegisterFileType \li "RegisterFileType" \c extension \c command [\c description [\c contentType [\c icon]]]. diff --git a/src/libs/installer/environmentvariablesoperation.cpp b/src/libs/installer/environmentvariablesoperation.cpp index 006ea376..1f3b56d5 100644 --- a/src/libs/installer/environmentvariablesoperation.cpp +++ b/src/libs/installer/environmentvariablesoperation.cpp @@ -152,8 +152,18 @@ UpdateOperation::Error undoSetting(const QString ®Path, SettingsType registry(regPath, QSettingsWrapper::NativeFormat); actual = registry.value(name).toString(); } - if (actual != value) //key changed, don't undo - return UpdateOperation::UserDefinedError; + + if (actual != value) + { + //For unknown reason paths with @TargetDir@ variable get modified + //so that Windows file separators get replaced with unix style separators, + //fix separators before matching to actual value in register + QString tempValue = value; + QString fixedValue = tempValue.replace(QLatin1Char('/'), QLatin1Char('\\')); + + if (actual != fixedValue) //key changed, don't undo + return UpdateOperation::UserDefinedError; + } bool error = false; if (handleRegExpandSz(regPath, name, oldValue, errorString, &error))