diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2010-02-09 18:57:46 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2010-02-09 18:57:46 (GMT) |
commit | 0619813e0349f4415b6c84047f090f28f78f533e (patch) | |
tree | df4b78d9fdff7593e15d131f2ca5c01f890e0361 /Modules/NSIS.template.in | |
parent | 6e7e71e9b97b7041f283b4a755c6baffeabca12f (diff) | |
download | CMake-0619813e0349f4415b6c84047f090f28f78f533e.zip CMake-0619813e0349f4415b6c84047f090f28f78f533e.tar.gz CMake-0619813e0349f4415b6c84047f090f28f78f533e.tar.bz2 |
Fix for bug #10257, NSIS could remove a PATH if it was too long
Diffstat (limited to 'Modules/NSIS.template.in')
-rw-r--r-- | Modules/NSIS.template.in | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 26a936e..776bc07 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -213,6 +213,15 @@ Function AddToPath IfFileExists "$0\*.*" "" AddToPath_done ReadEnvStr $1 PATH + ; if the path is too long for a NSIS variable NSIS will return a 0 + ; length string. If we find that, then warn and skip any path + ; modification as it will trash the existing path. + StrLen $2 $1 + IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done + CheckPathLength_ShowPathWarning: + Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!" + Goto AddToPath_done + CheckPathLength_Done: Push "$1;" Push "$0;" Call StrStr |