diff --git a/PowerEditor/installer/packageAll.bat b/PowerEditor/installer/packageAll.bat index 29167169..ca202daa 100644 --- a/PowerEditor/installer/packageAll.bat +++ b/PowerEditor/installer/packageAll.bat @@ -29,14 +29,10 @@ copy /Y ..\bin\change.log .\zipped.package.release\unicode\ If ErrorLevel 1 PAUSE copy /Y ..\src\config.model.xml .\zipped.package.release\unicode\ If ErrorLevel 1 PAUSE -copy /Y ..\src\config.model.xml .\zipped.package.release\unicode\config.xml -If ErrorLevel 1 PAUSE copy /Y ..\src\langs.model.xml .\zipped.package.release\unicode\ If ErrorLevel 1 PAUSE copy /Y ..\src\stylers.model.xml .\zipped.package.release\unicode\ If ErrorLevel 1 PAUSE -copy /Y ..\src\stylers.model.xml .\zipped.package.release\unicode\stylers.xml -If ErrorLevel 1 PAUSE copy /Y ..\src\contextMenu.xml .\zipped.package.release\unicode\ If ErrorLevel 1 PAUSE copy /Y ..\src\shortcuts.xml .\zipped.package.release\unicode\ @@ -82,14 +78,10 @@ copy /Y ..\bin\change.log .\zipped.package.release\ansi\ If ErrorLevel 1 PAUSE copy /Y ..\src\config.model.xml .\zipped.package.release\ansi\ If ErrorLevel 1 PAUSE -copy /Y ..\src\config.model.xml .\zipped.package.release\ansi\config.xml -If ErrorLevel 1 PAUSE copy /Y ..\src\langs.model.xml .\zipped.package.release\ansi\ If ErrorLevel 1 PAUSE copy /Y ..\src\stylers.model.xml .\zipped.package.release\ansi\ If ErrorLevel 1 PAUSE -copy /Y ..\src\stylers.model.xml .\zipped.package.release\ansi\stylers.xml -If ErrorLevel 1 PAUSE copy /Y ..\src\contextMenu.xml .\zipped.package.release\ansi\ If ErrorLevel 1 PAUSE copy /Y ..\src\shortcuts.xml .\zipped.package.release\ansi\ diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index c2e2c95e..c640600a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -758,6 +758,28 @@ bool NppParameters::load() // Test if localConf.xml exist bool isLocal = (PathFileExists(localConfPath.c_str()) == TRUE); + // Under vista and windows 7, the usage of doLocalConf.xml is not allowed + // if Notepad++ is installed in "program files" directory, because of UAC + if (isLocal) + { + // We check if OS is Vista or above + if (_winVersion >= WV_VISTA) + { + ITEMIDLIST *pidl; + SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidl); + TCHAR progPath[MAX_PATH]; + SHGetPathFromIDList(pidl, progPath); + TCHAR nppDirLocation[MAX_PATH]; + lstrcpy(nppDirLocation, _nppPath.c_str()); + ::PathRemoveFileSpec(nppDirLocation); + //printStr(progPath); + //printStr(nppDirLocation); + + if (lstrcmp(progPath, nppDirLocation) == 0) + isLocal = false; + } + } + if (isLocal) { _userPath = _nppPath;