diff options
Diffstat (limited to 'util/scripts/win-binary/nsis/includes')
-rw-r--r-- | util/scripts/win-binary/nsis/includes/global.nsh | 204 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/help.nsh | 133 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/instdir.nsh | 214 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/list.nsh | 96 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/qtcommon.nsh | 547 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/qtdir.nsh | 120 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/qtenv.nsh | 350 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/regsvr.nsh | 59 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/system.nsh | 364 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/templates.nsh | 262 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/writeEnvStr.nsh | 138 | ||||
-rw-r--r-- | util/scripts/win-binary/nsis/includes/writePathStr.nsh | 241 |
12 files changed, 0 insertions, 2728 deletions
diff --git a/util/scripts/win-binary/nsis/includes/global.nsh b/util/scripts/win-binary/nsis/includes/global.nsh deleted file mode 100644 index 9bc8f0a..0000000 --- a/util/scripts/win-binary/nsis/includes/global.nsh +++ /dev/null @@ -1,204 +0,0 @@ -!include "StrFunc.nsh" -!include "includes\list.nsh" - -${StrCase} -${StrTrimNewLines} -${StrStr} -${StrRep} -${UnStrRep} - -var STARTMENU_STRING -var PRODUCT_UNIQUE_KEY -var RUNNING_AS_ADMIN - -!define QT_VERSION_KEY_NAME "SOFTWARE\Trolltech\Versions" - -!ifndef MODULE_MINGW - !ifdef MODULE_MSVC_VC60 - !define INSTALL_COMPILER "vc60" - !else - !ifdef MODULE_MSVC_VS2002 - !define INSTALL_COMPILER "vs2002" - !else - !ifdef MODULE_MSVC_VS2005 - !define INSTALL_COMPILER "vs2005" - !else - !ifdef MODULE_MSVC_VS2005CE - !define INSTALL_COMPILER "vs2005ce" - !else - !ifdef MODULE_MSVC_VS2008 - !define INSTALL_COMPILER "vs2008" - !else - !ifdef MODULE_MSVC_VS2008CE - !define INSTALL_COMPILER "vs2008ce" - !else - !define INSTALL_COMPILER "vs2003" - !endif - !endif - !endif - !endif - !endif - !endif -!else - !define INSTALL_COMPILER "mingw" -!endif - -var VS_VERSION -var VS_VERSION_SHORT -var ADDIN_INSTDIR -var VSIP_INSTDIR -var HELP_INSTDIR -var ECLIPSE_INSTDIR -var QTJAMBI_INSTDIR -var QTJAMBIECLIPSE_INSTDIR - -; LICENSECHECK -var LICENSE_KEY -var LICENSEE -var LICENSE_PRODUCT -var LICENSE_PLATFORM -var LICENSE_FILE - -; MSVC -!ifdef MODULE_MSVC - !define MSVC_ValidateDirectory - var MSVC_INSTDIR -!endif - -; MINGW -!ifdef MODULE_MINGW - !define MINGW_ValidateDirectory - var MINGW_INSTDIR -!endif - -; QSA -var QSA_INSTDIR - -; QTDIR PAGE -var QTDIR_SELECTED -var COMPILER_SELECTED - -; used by addin7x and vsip -!ifndef MODULE_VSIP_ROOT - !define MODULE_VSIP_ROOT "${INSTALL_ROOT}\vsip" -!endif - -; add to confirm path -var UninstallerConfirmProduct - -Function un.ConfirmOnDelete - exch $0 - push $1 - - push "$0" - push "$UninstallerConfirmProduct" - call un.ItemInList - pop $1 - IntCmp $1 1 ConfirmOnDeleteDone - - strcmp "$UninstallerConfirmProduct" "" 0 +3 - strcpy $UninstallerConfirmProduct "$0" - goto +2 - strcpy $UninstallerConfirmProduct "$UninstallerConfirmProduct$\r$\n$0" - - ConfirmOnDeleteDone: - pop $1 - pop $0 -FunctionEnd - -!macro ConfirmOnRemove REG_KEY PRODUCT_NAME - push $0 - ClearErrors - ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "${REG_KEY}" - intcmp $0 1 0 +3 - push "${PRODUCT_NAME}" - call un.ConfirmOnDelete - ClearErrors - pop $0 -!macroend - -!define GLOBAL_SEC_SHORTCUTCREATION_TEXT "Create shortcuts" -!define GLOBAL_SEC_SHORTCUTCREATION_MAX_ID "100" - -Function GetSecShortcutCreationId - push $0 - push $1 - - StrCpy $0 "0" - loopStart: - IntCmp $0 "${GLOBAL_SEC_SHORTCUTCREATION_MAX_ID}" notfound - IntOp $0 $0 + 1 - SectionGetText $0 $1 - StrCmp $1 "${GLOBAL_SEC_SHORTCUTCREATION_TEXT}" done - goto loopStart - - notfound: - StrCpy $0 "-1" - done: - Pop $1 - Exch $0 -FunctionEnd - -Function GetCreateSchortcuts -!ifdef USE_OPTIONAL_SHORTCUTCREATION - Push $0 - Push $1 - Call GetSecShortcutCreationId - Pop $1 - IntCmp $1 -1 setfalse - SectionGetFlags "$1" $0 - IntOp $0 $0 & ${SF_SELECTED} - IntCmp $0 ${SF_SELECTED} settrue setfalse - settrue: - StrCpy $0 true - Goto done - setfalse: - StrCpy $0 false - done: - Pop $1 - Exch $0 -!else ;USE_OPTIONAL_SHORTCUTCREATION - Push true -!endif ;USE_OPTIONAL_SHORTCUTCREATION -FunctionEnd - -!macro CreateConditionalShortCutDirectory DIRECTORY - Push $0 - Call GetCreateSchortcuts - Pop $0 - StrCmp $0 true 0 +2 - CreateDirectory "${DIRECTORY}" - Pop $0 -!macroend - -Function GLOBAL_CreateConditionalShortCutWithParameters - Exch $0 ; PARAMETERS - Exch - Exch $1 ; TARGET - Exch - Exch 2 - Exch $2 ; LINK - Exch 2 - Push $3 - - Call GetCreateSchortcuts - Pop $3 - StrCmp $3 true 0 +2 - CreateShortCut "$2" "$1" "$0" - - Pop $3 - Pop $0 - Pop $1 - Pop $2 -FunctionEnd - -!macro CreateConditionalShortCutWithParameters LINK TARGET PARAMETERS - Push "${LINK}" - Push "${TARGET}" - Push "${PARAMETERS}" - Call GLOBAL_CreateConditionalShortCutWithParameters -!macroend - -!macro CreateConditionalShortCut LINK TARGET - !insertmacro CreateConditionalShortCutWithParameters "${LINK}" "${TARGET}" "" -!macroend diff --git a/util/scripts/win-binary/nsis/includes/help.nsh b/util/scripts/win-binary/nsis/includes/help.nsh deleted file mode 100644 index 797337e..0000000 --- a/util/scripts/win-binary/nsis/includes/help.nsh +++ /dev/null @@ -1,133 +0,0 @@ -!ifndef HELP_INCLUDE -!define HELP_INCLUDE - -; make it as a macro since it's only used twice (about the same overhead) -!macro InstallHelp HELP_PATH HELP_ROOT VS_VERSION - SetOutPath "${HELP_PATH}" - SetOverwrite ifnewer - - File "${MODULE_HELP_ROOT}\h2reg.exe" - File "${MODULE_HELP_ROOT}\h2reg.ini" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*.HxS" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*C.HxA" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*C.HxC" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*C.HxT" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*KC.HxK" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*FC.HxK" - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_h2reg.ini" - - Push $0 - ${If} $VS_VERSION == "2003" - StrCpy $0 "7.1" - ${ElseIf} $VS_VERSION == "2005" - StrCpy $0 "8.0" - ${ElseIf} $VS_VERSION == "2008" - StrCpy $0 "9.0" - ${Else} - StrCpy $0 "" - ${EndIf} - - ${If} $0 != "" - SetOutPath "$COMMONFILES\microsoft shared\VS Help Data\$0\Filters\1033" - File "${MODULE_HELP_ROOT}\qt450.xml" - WriteRegDWORD HKLM "Software\Microsoft\VisualStudio\$0\Help\VisibleFilters" "qt450" 0x00000001 - ${EndIf} - Pop $0 - - !insertmacro InstallHelpInVS ${HELP_ROOT} ${VS_VERSION} -!macroend - -!macro InstallHelpInVS HELP_ROOT VS_VERSION - Push $0 - - Push ${VS_VERSION} - Call GetVSInstallationDir - Pop $0 - StrCmp $0 "" +4 - SetOutPath "$0\HTML\XMLLinks\1033" - SetOverwrite ifnewer - File "${MODULE_HELP_ROOT}\${HELP_ROOT}_*.xml" - ClearErrors - - Pop $0 -!macroend - -!macro RegisterHelp HELP_PATH HELP_ROOT - SetOutPath "${HELP_PATH}" - ClearErrors ; clear the error flag - Push $0 - nsExec::ExecToLog '"${HELP_PATH}\h2reg.exe" -q -r cmdfile="${HELP_PATH}\${HELP_ROOT}_h2reg.ini"' - Pop $0 - StrCmp $0 "error" 0 +2 - MessageBox MB_OK "Cannot register ${HELP_ROOT} help!" - Pop $0 -!macroend - -!macro un.RegisterHelp HELP_PATH HELP_ROOT - ClearErrors ; clear the error flag - IfFileExists "${HELP_PATH}\h2reg.exe" 0 +5 - Push $0 - nsExec::ExecToLog '"${HELP_PATH}\h2reg.exe" -q -u cmdfile="${HELP_PATH}\${HELP_ROOT}_h2reg.ini"' - Pop $0 - StrCmp $0 "error" 0 +3 - MessageBox MB_OK "Cannot unregister ${HELP_ROOT} help!" - SetErrors - Pop $0 -!macroend - -!macro un.InstallHelp HELP_PATH HELP_ROOT VS_VERSION - Delete "${HELP_PATH}\${HELP_ROOT}_h2reg.ini" - Delete "${HELP_PATH}\${HELP_ROOT}_*.HxS" - Delete "${HELP_PATH}\${HELP_ROOT}_*C.HxA" - Delete "${HELP_PATH}\${HELP_ROOT}_*C.HxC" - Delete "${HELP_PATH}\${HELP_ROOT}_*C.HxT" - Delete "${HELP_PATH}\${HELP_ROOT}_*KC.HxK" - Delete "${HELP_PATH}\${HELP_ROOT}_*FC.HxK" - - Push $0 - ${If} $VS_VERSION == "2003" - StrCpy $0 "7.1" - ${ElseIf} $VS_VERSION == "2005" - StrCpy $0 "8.0" - ${ElseIf} $VS_VERSION == "2008" - StrCpy $0 "9.0" - ${Else} - StrCpy $0 "" - ${EndIf} - - ${If} $0 != "" - Delete "$COMMONFILES\microsoft shared\VS Help Data\$0\Filters\qt450.xml" - DeleteRegValue HKLM "Software\Microsoft\VisualStudio\$0\Help\VisibleFilters" "qt450" - ${EndIf} - Pop $0 - - !insertmacro un.InstallHelpInVS ${HELP_ROOT} ${VS_VERSION} -!macroend - -!macro un.InstallHelpInVS HELP_ROOT VS_VERSION - Push $0 - - Push ${VS_VERSION} - Call un.GetVSInstallationDir - - Pop $0 - StrCmp $0 "" +2 0 - Delete "$0\HTML\XMLLinks\1033\${MODULE_HELP_QT_FILE_ROOT}_*.xml" - - ClearErrors - - Pop $0 -!macroend - -Function un.DeleteH2RegFiles - Exch $0 - IfFileExists "$0\*.HxS" DeleteH2RegFiles_Done - Delete "$0\h2reg.exe" - Delete "$0\h2reg.ini" - Delete "$0\h2reg_log.txt" - RMDir "$0" - DeleteH2RegFiles_Done: - Pop $0 -FunctionEnd - -!endif ;HELP_INCLUDE diff --git a/util/scripts/win-binary/nsis/includes/instdir.nsh b/util/scripts/win-binary/nsis/includes/instdir.nsh deleted file mode 100644 index 6e4dab2..0000000 --- a/util/scripts/win-binary/nsis/includes/instdir.nsh +++ /dev/null @@ -1,214 +0,0 @@ -!ifndef INSTDIR_1 - !macro INSTDIR_INITIALIZE - !define MUI_DIRECTORYPAGE_VARIABLE $${INSTDIR_0}_INSTDIR - !ifdef ${INSTDIR_0}_ValidateDirectory - !define MUI_PAGE_CUSTOMFUNCTION_LEAVE "${INSTDIR_0}_ValidateDirectoryFunc" - !endif - !insertmacro MUI_PAGE_DIRECTORY - !macroend - !macro INSTDIR_FUNCTIONS - !macroend - !macro INSTDIR_STARTUP - !macroend -!else -!macro INSTDIR_INITIALIZE - !define INSTDIR_INI_FILE "instdir.ini" - !define INSTDIR_0_DIRFIELD "Field 10" - !define INSTDIR_0_TEXTFIELD "Field 13" - !define INSTDIR_1_DIRFIELD "Field 7" - !define INSTDIR_1_TEXTFIELD "Field 11" - !define INSTDIR_2_DIRFIELD "Field 5" - !define INSTDIR_2_TEXTFIELD "Field 8" - !define INSTDIR_3_DIRFIELD "Field 3" - !define INSTDIR_3_TEXTFIELD "Field 6" - !define INSTDIR_4_DIRFIELD "Field 2" - !define INSTDIR_4_TEXTFIELD "Field 4" - !define INSTDIR_5_DIRFIELD "Field 9" - !define INSTDIR_5_TEXTFIELD "Field 12" - !define INSTDIR_DIRHEIGHT 18 - - Page custom InitInstDirs UpdateInstDirs - - LangString InstDirLicenseTitle ${LANG_ENGLISH} "Installation Directories" - LangString InstDirLicenseTitleDescription ${LANG_ENGLISH} "Select the directories where you want the software installed." -!macroend - -!macro INSTDIR_FUNCTIONS - Function InitInstDirs - push $0 - push $1 - push $2 - push $3 - - !insertmacro MUI_HEADER_TEXT "$(InstDirLicenseTitle)" "$(InstDirLicenseTitleDescription)" - strcpy $0 "129" - -!ifdef INSTDIR_0 - SectionGetFlags ${${INSTDIR_0}_SEC01} $1 -!ifdef ${INSTDIR_0}_SEC02 - SectionGetFlags ${${INSTDIR_0}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_TEXTFIELD}" "Text" "${INSTDIR_0_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_DIRFIELD}" "State" $${INSTDIR_0}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_0_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif -!ifdef INSTDIR_1 - SectionGetFlags ${${INSTDIR_1}_SEC01} $1 -!ifdef ${INSTDIR_1}_SEC02 - SectionGetFlags ${${INSTDIR_1}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_TEXTFIELD}" "Text" "${INSTDIR_1_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_DIRFIELD}" "State" $${INSTDIR_1}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_1_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif -!ifdef INSTDIR_2 - SectionGetFlags ${${INSTDIR_2}_SEC01} $1 -!ifdef ${INSTDIR_2}_SEC02 - SectionGetFlags ${${INSTDIR_2}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_TEXTFIELD}" "Text" "${INSTDIR_2_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_DIRFIELD}" "State" $${INSTDIR_2}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_2_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif -!ifdef INSTDIR_3 - SectionGetFlags ${${INSTDIR_3}_SEC01} $1 -!ifdef ${INSTDIR_3}_SEC02 - SectionGetFlags ${${INSTDIR_3}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_TEXTFIELD}" "Text" "${INSTDIR_3_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_DIRFIELD}" "State" $${INSTDIR_3}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_3_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif -!ifdef INSTDIR_4 - SectionGetFlags ${${INSTDIR_4}_SEC01} $1 -!ifdef ${INSTDIR_4}_SEC02 - SectionGetFlags ${${INSTDIR_4}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_TEXTFIELD}" "Text" "${INSTDIR_4_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_DIRFIELD}" "State" $${INSTDIR_4}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_4_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif -!ifdef INSTDIR_5 - SectionGetFlags ${${INSTDIR_5}_SEC01} $1 -!ifdef ${INSTDIR_5}_SEC02 - SectionGetFlags ${${INSTDIR_5}_SEC02} $3 - IntOp $1 $1 | $3 -!endif - IntOp $2 $1 & 1 ;just care about the first flag - StrCpy $1 "READONLY" - StrCmp "$2" "1" +2 - StrCpy $1 "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_TEXTFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_DIRFIELD}" "Flags" "$1" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_TEXTFIELD}" "Text" "${INSTDIR_5_TEXT}" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_DIRFIELD}" "State" $${INSTDIR_5}_INSTDIR -!else - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_DIRFIELD}" "Type" "Unknown" - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "${INSTDIR_5_TEXTFIELD}" "Type" "Unknown" - intop $0 $0 - ${INSTDIR_DIRHEIGHT} -!endif - - !insertmacro MUI_INSTALLOPTIONS_WRITE "${INSTDIR_INI_FILE}" "Field 1" "Bottom" "$0" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${INSTDIR_INI_FILE}" - - pop $3 - pop $2 - pop $1 - pop $0 - FunctionEnd - - Function UpdateInstDirs -!ifdef INSTDIR_0 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_0}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_0_DIRFIELD}" "State" - !ifdef ${INSTDIR_0}_ValidateDirectory - call ${INSTDIR_0}_ValidateDirectoryFunc - !endif -!endif -!ifdef INSTDIR_1 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_1}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_1_DIRFIELD}" "State" - !ifdef ${INSTDIR_1}_ValidateDirectory - call ${INSTDIR_1}_ValidateDirectoryFunc - !endif -!endif -!ifdef INSTDIR_2 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_2}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_2_DIRFIELD}" "State" - !ifdef ${INSTDIR_2}_ValidateDirectory - call ${INSTDIR_2}_ValidateDirectoryFunc - !endif -!endif -!ifdef INSTDIR_3 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_3}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_3_DIRFIELD}" "State" - !ifdef ${INSTDIR_3}_ValidateDirectory - call ${INSTDIR_3}_ValidateDirectoryFunc - !endif -!endif -!ifdef INSTDIR_4 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_4}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_4_DIRFIELD}" "State" - !ifdef ${INSTDIR_4}_ValidateDirectory - call ${INSTDIR_4}_ValidateDirectoryFunc - !endif -!endif -!ifdef INSTDIR_5 - !insertmacro MUI_INSTALLOPTIONS_READ $${INSTDIR_5}_INSTDIR "${INSTDIR_INI_FILE}" "${INSTDIR_5_DIRFIELD}" "State" - !ifdef ${INSTDIR_5}_ValidateDirectory - call ${INSTDIR_5}_ValidateDirectoryFunc - !endif -!endif - FunctionEnd -!macroend - -!macro INSTDIR_STARTUP - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${INSTDIR_INI_FILE}" -!macroend - -!endif ;ifndef INSTDIR_1
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/list.nsh b/util/scripts/win-binary/nsis/includes/list.nsh deleted file mode 100644 index 47d1702..0000000 --- a/util/scripts/win-binary/nsis/includes/list.nsh +++ /dev/null @@ -1,96 +0,0 @@ -!ifndef LIST_INCLUDE -!define LIST_INCLUDE - -; usage: -; push item -; push list -; call ItemInList -; returns 1 or 0 -!macro ItemInList UN -Function ${UN}ItemInList - exch $0 ;list - exch - exch $1 ;item - push $2 ;counter - push $3 ;substr - push $4 ;char - - strcpy $3 "" - strcpy $2 "0" - - loop: - strcpy $4 $0 1 $2 - strcmp "$4" "" atend - intop $2 $2 + 1 - - strcmp "$4" "|" 0 +4 - strcmp "$3" "$1" found - strcpy $3 "" ;reset substr - goto +2 - strcpy $3 "$3$4" ;append char to substr - goto loop - - found: - strcpy $0 "1" - goto done - - atend: - strcmp "$3" "$1" found - strcpy $0 "0" - - done: - pop $4 - pop $3 - pop $2 - pop $1 - exch $0 -FunctionEnd -!macroend - -!insertmacro ItemInList "" -!insertmacro ItemInList "un." - -Function GetItemInList - exch $0 ;list - exch - exch $1 ;index - push $2 ;counter - push $3 ;substr - push $4 ;char - push $5 ;current index - - strcpy $3 "" - strcpy $2 "0" - strcpy $5 "1" - - loop: - strcpy $4 $0 1 $2 - strcmp "$4" "" atend - intop $2 $2 + 1 - - strcmp "$4" "|" 0 +5 - strcmp "$5" "$1" found - strcpy $3 "" ;reset substr - intop $5 $5 + 1 - goto +2 - strcpy $3 "$3$4" ;append char to substr - goto loop - - found: - strcpy $0 "$3" - goto done - - atend: - strcmp "$5" "$1" found - strcpy $0 "" - - done: - pop $5 - pop $4 - pop $3 - pop $2 - pop $1 - exch $0 -FunctionEnd - -!endif ;LIST_INCLUDE
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/qtcommon.nsh b/util/scripts/win-binary/nsis/includes/qtcommon.nsh deleted file mode 100644 index 8ef8207..0000000 --- a/util/scripts/win-binary/nsis/includes/qtcommon.nsh +++ /dev/null @@ -1,547 +0,0 @@ -!ifndef QTCOMMON_INCLUDE -!define QTCOMMON_INCLUDE - -!macro MakeQtDirectory UN -Function ${UN}MakeQtDirectory - exch $0 - - push $0 - push " " #replace - push "-" #with - call ${UN}ReplaceString - pop $0 - - push $0 - push "(" #replace - push "" #with - call ${UN}ReplaceString - pop $0 - - push $0 - push ")" #replace - push "" #with - call ${UN}ReplaceString - pop $0 - - exch $0 -FunctionEnd -!macroend -!insertmacro MakeQtDirectory "" -!insertmacro MakeQtDirectory "un." - -Function DeleteFloatingLicenseProgram - exch $1 - push $0 - - StrCmp $LICENSE_KEY "" end - - ClearErrors - qtnsisext::IsFloatingLicense $LICENSE_KEY - IfErrors end - pop $0 - - StrCmp $0 "1" end - IfFileExists "$1\bin\qtusagereporter.exe" 0 end - Delete "$1\bin\qtusagereporter.exe" - - end: - pop $0 - pop $1 -FunctionEnd - -Function AddStartmenuApplication - exch $0 - IfFileExists "$0\assistant.exe" 0 +2 - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Assistant.lnk" "$0\assistant.exe" - IfFileExists "$0\designer.exe" 0 +2 - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Designer.lnk" "$0\designer.exe" - IfFileExists "$0\linguist.exe" 0 +2 - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Linguist.lnk" "$0\linguist.exe" - IfFileExists "$0\qtdemo.exe" 0 +2 - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Examples and Demos.lnk" "$0\qtdemo.exe" - IfFileExists "$0\..\README" 0 ReadMeShortCutFinished - IfFileExists "$WINDIR\notepad.exe" +3 - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Qt Readme.lnk" "$SYSDIR\notepad.exe" "$0\..\README" - goto ReadMeShortCutFinished - CreateShortCut "$SMPROGRAMS\$STARTMENU_STRING\Qt Readme.lnk" "$WINDIR\notepad.exe" "$0\..\README" - ReadMeShortCutFinished: - pop $0 -FunctionEnd - -Function un.RemoveStartmenuApplication - Delete "$SMPROGRAMS\$STARTMENU_STRING\Assistant.lnk" - Delete "$SMPROGRAMS\$STARTMENU_STRING\Designer.lnk" - Delete "$SMPROGRAMS\$STARTMENU_STRING\Linguist.lnk" - Delete "$SMPROGRAMS\$STARTMENU_STRING\Examples and Demos.lnk" - Delete "$SMPROGRAMS\$STARTMENU_STRING\Qt Readme.lnk" -FunctionEnd - -#patch the licence information -Function PatchLicenseInformation - exch $0 - push $1 - push $2 - - DetailPrint "Patching license information..." - - IfFileExists "$0\src\corelib\global\qconfig.h" 0 +3 - strcpy $2 "$0\src\corelib\global\qconfig.h" - goto PatchLicensee - - IfFileExists "$0\include\Qt\qconfig.h" 0 PatchConfigPriFile - strcpy $2 "$0\include\Qt\qconfig.h" - - PatchLicensee: - push $2 - push '#define QT_PRODUCT_LICENSEE "' - push '#define QT_PRODUCT_LICENSEE "$LICENSEE"$\r$\n' - call PatchLine - - push $2 - push '#define QT_PRODUCT_LICENSE "' - push '#define QT_PRODUCT_LICENSE "$LICENSE_PRODUCT"$\r$\n' - call PatchLine - - push $2 - ${StrCase} $1 "$LICENSE_PRODUCT" "U" - push '# define QT_EDITION QT_EDITION_' - push '# define QT_EDITION QT_EDITION_$1$\r$\n' - call PatchLine - - PatchConfigPriFile: - IfFileExists "$0\mkspecs\qconfig.pri" 0 PatchLicenseProductDone - push "$0\mkspecs\qconfig.pri" - push "QT_EDITION = " - push "QT_EDITION = $LICENSE_PRODUCT$\r$\n" - call PatchLine - - PatchLicenseProductDone: - pop $2 - pop $1 - pop $0 -FunctionEnd - -Function PatchCommonBinaryFiles - Exch $0 ; Qt installation directory - Exch - Exch $1 ; Dll dir name: "bin", "lib"... - Push $2 ; FindFirst/FindNext handle - Push $3 ; Found QtCore*.dll file - - ${If} ${FileExists} "$0\bin\qmake.exe" - DetailPrint "Patching $0\bin\qmake.exe..." - Push $0 - Push "$0\bin\qmake.exe" - Call PatchBinaryPaths - ${EndIf} - - FindFirst $2 $3 "$0\$1\QtCore*.dll" - ${DoWhile} $3 != "" - Push $0 - Push "$0\$1\$3" - DetailPrint "Patching $0\$1\$3..." - Call PatchBinaryPaths - FindNext $2 $3 - ${Loop} - - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -Function PatchBinaryPaths - exch $0 - exch - exch $2 - push $1 - - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_prfxpath=" "qt_prfxpath=$2" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_docspath=" "qt_docspath=$2\doc" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_hdrspath=" "qt_hdrspath=$2\include" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_libspath=" "qt_libspath=$2\lib" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_binspath=" "qt_binspath=$2\bin" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_plugpath=" "qt_plugpath=$2\plugins" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_datapath=" "qt_datapath=$2" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_trnspath=" "qt_trnspath=$2\translations" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_xmplpath=" "qt_xmplpath=$2\examples" -!ifdef MODULE_LICENSECHECK - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_lcnsuser=" "qt_lcnsuser=$LICENSEE" - qtnsisext::PatchBinary /NOUNLOAD $0 "qt_lcnsprod=" "qt_lcnsprod=$LICENSE_PRODUCT" -!endif - qtnsisext::PatchBinary $0 "qt_demopath=" "qt_demopath=$2\demos" - - pop $1 - pop $2 - pop $0 -FunctionEnd - -# Patching the prl files -Function PatchPrlFiles - Exch $0 ; Absolute path to where Qt is (being) installed - Exch - Exch $1 ; Absolute path to where Qt was built - Push $2 ; FindFirst/FindNext handle - Push $3 ; Found *.prl file name - - FindFirst $2 $3 "$0\lib\*.prl" - ${DoWhile} $3 != "" - Push "$0\lib\$3" - Push $1 - Push $0 - Call PatchPath - FindNext $2 $3 - ${Loop} - - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -# -# patch line in text files -# push "qtcore4.prl" #Filename -# push "#define ..." #START WITH -# push "c:\qt" #REPLACE WITH -# call PatchLine -# -Function PatchLine - exch $2 ;replacement line - exch 2 - exch $1 ;Filename - exch - exch $0 ;start with - push $3 ; tmp filename - push $4 ; handle (tmp) - push $5 ; handle (org) - push $6 ; string - - ClearErrors - GetTempFileName $3 - IfErrors done - FileOpen $4 $3 w - IfErrors done - FileOpen $5 $1 r - IfErrors done - -nextline: - FileRead $5 $6 - IfErrors renameFile - push $6 - push $0 - push $2 - call ReplaceLine - pop $6 - FileWrite $4 $6 - goto nextline - -renameFile: - FileClose $4 - FileClose $5 - SetDetailsPrint none - Delete $1 - Rename $3 $1 - SetDetailsPrint both - - done: - pop $6 - pop $5 - pop $4 - pop $3 - pop $0 - pop $1 - pop $2 -FunctionEnd - -# -# replaces a string that starts with something, with another string -# push string -# push "#define ..." #START WITH -# push "c:\qt" #REPLACE WITH -# call ReplaceLine -# pop $0 #new string -# -Function ReplaceLine - exch $2 ;new line - exch 2 - exch $1 ;string - exch - exch $0 ;start with - - push $3 ; tmp string - push $4 ; counter - push $5 ; strlen - - StrCpy $4 "-1" - StrLen $5 $1 - - loop: - IntOp $4 $4 + 1 ;increase counter - StrCpy $3 $1 $4 ;get substring - IntCmp $4 $5 copystring ; check for end - StrCmp $3 $0 done ;start with found - goto loop - - copystring: - StrCpy $2 $1 - goto done - - done: - pop $5 - pop $4 - pop $3 - pop $0 - pop $1 - exch $2 -FunctionEnd - -# -# patch paths in text files -# push "qtcore4.prl" #Filename -# push "c:\compile" #OLD_QTDIR -# push "c:\qt" #QTDIR -# call PatchPath -# -Function PatchPath - exch $2 ;NEW - exch 2 - exch $1 ;Filename - exch - exch $0 ;OLD - push $3 ;readline - push $4 ;file 1 - push $5 ;file 2 - push $6 ;tmpfilename - - push $7 ;forward slash NEW - push $8 ;forward slash OLD - - push $2 - push "\" - push "/" - call ReplaceString - pop $7 - - push $0 - push "\" - push "/" - call ReplaceString - pop $8 - - ClearErrors - GetTempFileName $6 - IfErrors done - FileOpen $5 $6 w - IfErrors done - FileOpen $4 $1 r - IfErrors done - DetailPrint "Patching $1 ($2)..." - -nextline: - FileRead $4 $3 - IfErrors renameFile - push $3 - push $0 - push $2 - call ReplaceString ;replace backward slash path - push $8 - push $7 - call ReplaceString ;replace forward slash path - pop $3 - FileWrite $5 $3 - goto nextline - -renameFile: - FileClose $5 - FileClose $4 - SetDetailsPrint none - Delete $1 - Rename $6 $1 - SetDetailsPrint both - -done: - pop $8 - pop $7 - pop $6 - pop $5 - pop $4 - pop $3 - pop $0 - pop $1 - pop $2 -FunctionEnd - -# -# replaces a string with another string -# push string -# push "c:\qt" #replace -# push "c:\compile" #with -# call ReplaceString -# pop $0 #new string -# -!macro ReplaceString UN -Function ${UN}ReplaceString - exch $2 ;NEW - exch 2 - exch $1 ;string - exch - exch $0 ;OLD - - push $3 ; tmp string - push $4 ; counter - push $5 ; result - - push $6 ; old strlen - - StrCpy $4 "-1" - StrCpy $5 "" - - StrLen $6 $0 - - loop: - IntOp $4 $4 + 1 ;increase counter - StrCpy $3 $1 $6 $4 ;get substring - StrCmp $3 "" done ; check for end - StrCmp $3 $0 replace ;replace if old - StrCpy $3 $1 "1" $4 - StrCpy $5 $5$3 ;append character to result - goto loop - - replace: - StrCpy $5 $5$2 ;insert new qtdir - IntOp $4 $4 + $6 ;increase offset - IntOp $4 $4 - 1 ;decrease offset one more - goto loop - - done: - StrCpy $2 $5 - pop $6 - pop $5 - pop $4 - pop $3 - pop $0 - pop $1 - exch $2 -FunctionEnd -!macroend -!insertmacro ReplaceString "" -!insertmacro ReplaceString "un." - -Function CommonCheckDirectory - exch $4 - exch - exch $5 - push $0 - push $1 - push $2 - push $3 - - ; check if qt is already installed - IfFileExists "$4\bin\qmake.exe" 0 +2 - IfFileExists "$4\uninst.exe" qtExistsError - - ; check if directory is empty - FindFirst $0 $1 "$4\*" - CommonCheckDirectory_FileSearchLoop: - StrCmp $1 "" CommonCheckDirectory_DirDoesNotExist - StrCmp $1 "." CommonCheckDirectory_ContinueSearchLoop - StrCmp $1 ".." CommonCheckDirectory_ContinueSearchLoop - goto CommonCheckDirectory_FoundFile - CommonCheckDirectory_ContinueSearchLoop: - FindNext $0 $1 - goto CommonCheckDirectory_FileSearchLoop - -CommonCheckDirectory_FoundFile: - FindClose $0 - MessageBox MB_YESNO|MB_ICONEXCLAMATION "This directory already has contents. Are you sure you want to use this directory?" IDYES CommonCheckDirectory_DirDoesNotExist - Goto errorInDirectory -CommonCheckDirectory_DirDoesNotExist: - FindClose $0 - - GetInstDirError $0 - IntCmp 0 $0 0 instDirError - - StrLen $0 $4 - -!ifdef USE_NODIRLENGTHCHECK - StrCpy $1 "400" -!else - StrLen $1 $5 -!endif - - IntCmp $1 $0 0 directoryToLong - - ;check for spaces - StrCpy $2 "-1" - StrCpy $3 "" - - loop: - IntOp $2 $2 + 1 ;increase counter - StrCpy $3 $4 "1" $2 ;get char - StrCmp $3 "" directoryOk ; check for end - StrCmp $3 " " spaceInDirectory ;check for space - goto loop - -qtExistsError: - MessageBox MB_OK|MB_ICONEXCLAMATION "Qt is already installed in this directory. Please uninstall the previous version and try again." - Goto errorInDirectory - -instDirError: - MessageBox MB_OK|MB_ICONEXCLAMATION "This is not a valid installation directory." - Goto errorInDirectory - -spaceInDirectory: - MessageBox MB_OK|MB_ICONEXCLAMATION "The installation path can't contain spaces." - Goto errorInDirectory - -directoryToLong: - MessageBox MB_OK|MB_ICONEXCLAMATION "The installation directory is to long." - Goto errorInDirectory - -errorInDirectory: - pop $3 - pop $2 - pop $1 - pop $0 - pop $5 - pop $4 - Abort - goto done - -directoryOk: - pop $3 - pop $2 - pop $1 - pop $0 - pop $5 - pop $4 -done: -FunctionEnd - -# Sets $0 to 0, $1 to 1. Good for checking register breakages in function calls via dumpstate::debug -# Do not leave this in a release installer!!! -Function MarkAllRegisters - StrCpy $0 "0" - StrCpy $1 "1" - StrCpy $2 "2" - StrCpy $3 "3" - StrCpy $4 "4" - StrCpy $5 "5" - StrCpy $6 "6" - StrCpy $7 "7" - StrCpy $8 "8" - StrCpy $9 "9" - StrCpy $R0 "R0" - StrCpy $R1 "R1" - StrCpy $R2 "R2" - StrCpy $R3 "R3" - StrCpy $R4 "R4" - StrCpy $R5 "R5" - StrCpy $R6 "R6" - StrCpy $R7 "R7" - StrCpy $R8 "R8" - StrCpy $R9 "R9" -FunctionEnd - -!endif ;QTCOMMON_INCLUDE
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/qtdir.nsh b/util/scripts/win-binary/nsis/includes/qtdir.nsh deleted file mode 100644 index ac4de3b..0000000 --- a/util/scripts/win-binary/nsis/includes/qtdir.nsh +++ /dev/null @@ -1,120 +0,0 @@ -!macro QTDIR_INITIALIZE - !include "includes\qtenv.nsh" - !include "includes\list.nsh" - !define QTDIR_PAGE "qtdir.ini" - - Page custom QtDirPageEnter QtDirPageExit - - LangString QtDirPageTitle ${LANG_ENGLISH} "Select Qt Version" - LangString QtDirPageDescription ${LANG_ENGLISH} "Select the detected Qt Version, or choose a QTDIR manually." -!macroend - -!macro QTDIR_FUNCTIONS - Function QtDirPageEnter - push $0 - push $1 - push $2 - !insertmacro MUI_HEADER_TEXT "$(QtDirPageTitle)" "$(QtDirPageDescription)" - - StrCpy $2 "" - StrCpy $0 0 - loopHKLM: - EnumRegKey $1 HKLM "SOFTWARE\trolltech\Versions" $0 - StrCmp $1 "" doneHKLM - IntOp $0 $0 + 1 - ReadRegStr $1 HKLM "SOFTWARE\trolltech\Versions\$1\" "InstallDir" - StrCmp $1 "" +2 - StrCpy $2 "$2$1|" - goto loopHKLM - doneHKLM: - - StrCpy $0 0 - loopHKCU: - EnumRegKey $1 HKCU "SOFTWARE\trolltech\Versions" $0 - StrCmp $1 "" doneHKCU - IntOp $0 $0 + 1 - ReadRegStr $1 HKCU "SOFTWARE\trolltech\Versions\$1\" "InstallDir" - StrCmp $1 "" +2 - StrCpy $2 "$2$1|" - goto loopHKCU - doneHKCU: - - StrLen $0 $2 - IntOp $0 $0 - 1 - StrCpy $1 $2 $0 - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 3" "ListItems" "$1" - - ExpandEnvStrings $0 "%QTDIR%" - strcmp "$QTDIR_SELECTED" "" 0 noQtDirEnv - strcmp "$0" "%QTDIR%" noQtDirEnv - strcmp "$0" "" noQtDirEnv - strcpy $QTDIR_SELECTED $0 - noQtDirEnv: - - strcmp "$QTDIR_SELECTED" "" 0 noFirstItemInList - push "1" - push "$1" - call GetItemInList - pop $0 - strcpy $QTDIR_SELECTED $0 - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 3" "State" "$0" - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 5" "State" "$0" - noFirstItemInList: - - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 3" "State" "$QTDIR_SELECTED" - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 5" "State" "$QTDIR_SELECTED" - - call AutoDetectCompilers - pop $1 - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 8" "ListItems" "$1" - - strcmp "$COMPILER_SELECTED" "" 0 noFirstCompilerInList - push "1" - push "$1" - call GetItemInList - pop $0 - strcpy $COMPILER_SELECTED $0 - noFirstCompilerInList: - - !insertmacro MUI_INSTALLOPTIONS_WRITE ${QTDIR_PAGE} "Field 8" "State" "$COMPILER_SELECTED" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${QTDIR_PAGE}" - - pop $2 - pop $1 - pop $0 - FunctionEnd - - Function QtDirPageExit - push $0 - push $1 - push $2 - !insertmacro MUI_INSTALLOPTIONS_READ $0 "${QTDIR_PAGE}" "Settings" "State" - strcmp "$0" "3" 0 NoNotify - !insertmacro MUI_INSTALLOPTIONS_READ $0 "${QTDIR_PAGE}" "Field 3" "State" - FindWindow $2 "#32770" "" $HWNDPARENT - GetDlgItem $1 $2 1204 ;line edit (DirRequest) - SendMessage $1 ${WM_SETTEXT} 0 "STR:$0" - abort - NoNotify: - - !insertmacro MUI_INSTALLOPTIONS_READ $QTDIR_SELECTED "${QTDIR_PAGE}" "Field 5" "State" - IfFileExists "$QTDIR_SELECTED\bin\qmake.exe" +3 - MessageBox MB_OK|MB_ICONEXCLAMATION "This is not a valid QTDIR, please try another one." - abort - - !insertmacro MUI_INSTALLOPTIONS_READ $COMPILER_SELECTED "${QTDIR_PAGE}" "Field 8" "State" - strcmp "$COMPILER_SELECTED" "" 0 +3 - MessageBox MB_OK|MB_ICONEXCLAMATION "Please select a compiler." - abort - - pop $2 - pop $1 - pop $0 - FunctionEnd -!macroend - -!macro QTDIR_STARTUP - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${QTDIR_PAGE}" - strcpy $QTDIR_SELECTED "" - strcpy $COMPILER_SELECTED "" -!macroend
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/qtenv.nsh b/util/scripts/win-binary/nsis/includes/qtenv.nsh deleted file mode 100644 index d1c3bfd..0000000 --- a/util/scripts/win-binary/nsis/includes/qtenv.nsh +++ /dev/null @@ -1,350 +0,0 @@ -!ifndef QTENV_INCLUDE -!define QTENV_INCLUDE - -!include "LogicLib.nsh" - -!macro MAKE_QTVARS_FILE Compiler QtBuildTree WinCESDK - push "${Compiler}" - push "${QtBuildTree}" - push "${WinCESDK}" - call Function_MakeQtVarsFile -!macroend ;MAKE_QTVARS_FILE - -# -# creates a qtvars.bat file in QtBuildTree\bin -# Push "vs2003" ; Compiler -# Push "c:\qt\shadowbuild" ; QtBuildTree -# Push "wincewm60professional-msvc2005" ; WinCESDK. Leave empty if it is not a CE build -# Call MakeQtVarsFile -# -Function Function_MakeQtVarsFile - Exch $0 ; WinCESDK - Exch - Exch $1 ; QtBuildTree - Exch - Exch 2 - Exch $2 ; Compiler - Exch 2 - Push $3 ; qtvars.bat file handle - Push $4 ; GetMkSpec result - Push $5 ; IsExpressVersion result - Push $6 ; GetVSVarsFile result - - Push $2 - Call GetMkSpec - Pop $4 - - CreateDirectory "$1" - CreateDirectory "$1\bin" - ClearErrors - FileOpen $3 "$1\bin\qtvars.bat" w - IfErrors done - FileWrite $3 "@echo off$\r$\n" - FileWrite $3 "rem$\r$\n" - FileWrite $3 "rem This file is generated by the Qt installer$\r$\n" - FileWrite $3 "rem$\r$\n" - FileWrite $3 "$\r$\n" - FileWrite $3 "echo Setting up a Qt environment...$\r$\n" - FileWrite $3 "$\r$\n" - FileWrite $3 "set QTDIR=$1$\r$\n" - FileWrite $3 "echo -- QTDIR set to $1$\r$\n" - FileWrite $3 "set PATH=$1\bin;%PATH%$\r$\n" - FileWrite $3 "echo -- Added $1\bin to PATH$\r$\n" - FileWrite $3 "set QMAKESPEC=$4$\r$\n" - FileWrite $3 "echo -- QMAKESPEC set to $\"$4$\"$\r$\n" - - Push $2 - Call IsExpressVersion - Pop $5 - ${If} $5 != "" - FileWrite $3 "$\r$\n" - FileWrite $3 'regedit /e S$$D$$K$$ "HKEY_LOCAL_MACHINE\Software\Microsoft\MicrosoftSDK"$\r$\n' - FileWrite $3 'if not exist S$$D$$K$$ goto ENDSDK\r$\n' - FileWrite $3 'find "Install Dir" < S$$D$$K$$ > D$$I$$R$$$\r$\n' - FileWrite $3 'del S$$D$$K$$$\r$\n' - FileWrite $3 'for /f "tokens=2 delims==" %%i in (D$$I$$R$$) do call %%i\setenv$\r$\n' - FileWrite $3 'del D$$I$$R$$$\r$\n' - FileWrite $3 ':ENDSDK\r$\n' - ${EndIf} - - Push $2 - Call GetVSVarsFile - Pop $6 - ${If} $6 != "" - FileWrite $3 "$\r$\n" - FileWrite $3 'if not "%1"=="vsvars" goto ENDVSVARS$\r$\n' - FileWrite $3 'call "$6"$\r$\n' - ${If} $0 != "" - FileWrite $3 "call $\"$1\bin\setcepaths.bat$\" $0$\r$\n" - ${EndIf} - FileWrite $3 ":ENDVSVARS$\r$\n" - - FileWrite $3 "$\r$\n" - FileWrite $3 'if not "%1"=="vsstart" goto ENDVSSTART$\r$\n' - FileWrite $3 'call "$6"$\r$\n' - ${If} $0 != "" - FileWrite $3 "call $\"$1\bin\setcepaths.bat$\" $0$\r$\n" - ${EndIf} - ${If} $2 != "vc60" - FileWrite $3 "devenv /useenv$\r$\n" - ${Else} - FileWrite $3 "msdev /useenv$\r$\n" - ${EndIf} - FileWrite $3 ":ENDVSSTART$\r$\n" - ${EndIf} - - FileWrite $3 "$\r$\n" - FileClose $3 - - done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $0 - Pop $1 - Pop $2 -FunctionEnd - -Function GetMkSpec - exch $0 - StrCmp $0 "mingw" MINGW - StrCmp $0 "vs2008" VS2008 - StrCmp $0 "vs2008ce" VS2008CE - StrCmp $0 "vs2005" VS2005 - StrCmp $0 "vs2005ce" VS2005CE - StrCmp $0 "vs2003" VS2003 - StrCmp $0 "vs2002" VS2002 - StrCmp $0 "vc60" VS60 - StrCmp $0 "icc" ICC - - MINGW: - pop $0 - push "win32-g++" - goto done - - VS2008: - pop $0 - push "win32-msvc2008" - goto done - - VS2008CE: - pop $0 - push "" - goto done - - VS2005: - pop $0 - push "win32-msvc2005" - goto done - - VS2005CE: - pop $0 - push "" - goto done - - VS2003: - pop $0 - push "win32-msvc2003" - goto done - - VS2002: - pop $0 - push "win32-msvc2002" - goto done - - VS60: - pop $0 - push "win32-msvc" - goto done - - ICC: - pop $0 - push "win32-icc" - goto done - - done: -FunctionEnd - -!define AD_COMPILER_NAME_VS2008 "Visual Studio .NET 2008" -!define AD_COMPILER_NAME_VS2008_EXPRESS "Visual C++ 2008 Express Edition" -!define AD_COMPILER_NAME_VS2005 "Visual Studio .NET 2005" -!define AD_COMPILER_NAME_VS2005_EXPRESS "Visual C++ 2005 Express Edition" -!define AD_COMPILER_NAME_VS2003 "Visual Studio .NET 2003" -!define AD_COMPILER_NAME_VS2002 "Visual Studio .NET 2002" -!define AD_COMPILER_NAME_VC60 "Visual Studio 6.0" -!define AD_COMPILER_NAME_ICC "Intel C++ Compiler" -!define AD_COMPILER_NAME_MINGW "MinGW (Must be in PATH!)" - -Function GetShortCompilerName - exch $0 - - strcmp "$0" "${AD_COMPILER_NAME_VS2008}" 0 +3 - strcpy $0 "vs2008" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2008_EXPRESS}" 0 +3 - strcpy $0 "vs2008" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2005}" 0 +3 - strcpy $0 "vs2005" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2005_EXPRESS}" 0 +3 - strcpy $0 "vs2005" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2003}" 0 +3 - strcpy $0 "vs2003" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VS2002}" 0 +3 - strcpy $0 "vs2002" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_VC60}" 0 +3 - strcpy $0 "vc60" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_ICC}" 0 +3 - strcpy $0 "icc" - goto done - - strcmp "$0" "${AD_COMPILER_NAME_MINGW}" 0 +3 - strcpy $0 "mingw" - goto done - - strcpy $0 "" ;this is bad! - - done: - exch $0 -FunctionEnd - -# -# returns if a compiler is installed as express version -# push "vs2005" #compiler -# call IsExpressVersion -# -Function IsExpressVersion - exch $1 - push $0 - - StrCpy $0 "" - - StrCmp $1 "vs2005" 0 +2 - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0" "InstallDir" - - StrCmp $1 "vs2008" 0 +2 - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0" "InstallDir" - - ClearErrors - exch $0 - exch - pop $1 -FunctionEnd - -Function AutoDetectCompilers - push $0 - push $1 - - strcpy $1 "" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2008}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2009_EXPRESS}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2005}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2005_EXPRESS}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.1" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2003}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.0" "InstallDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VS2002}|" - - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_VC60}|" - - ReadRegStr $0 HKLM "Software\Intel\Compilers\C++\80" "Major Version" - strcmp $0 "" +2 - strcpy $1 "$1${AD_COMPILER_NAME_ICC}|" - - strcpy $1 "$1${AD_COMPILER_NAME_MINGW}" - - exch - pop $0 - exch $1 -FunctionEnd - -Function GetVSVarsFile - exch $1 - push $0 - - StrCmp $1 "vs2008" VS2008 - StrCmp $1 "vs2008ce" VS2008 - StrCmp $1 "vs2005" VS2005 - StrCmp $1 "vs2005ce" VS2005 - StrCmp $1 "vs2003" VS2003 - StrCmp $1 "vs2002" VS2002 - StrCmp $1 "vc60" VS60 - - push "" ;empty string if not found - goto done - - VS2008: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2008 - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\9.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2008 express - - VS2005: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2005 - - ReadRegStr $0 HKLM "Software\Microsoft\VCExpress\8.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2005 express - - VS2003: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.1\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2003 - - VS2002: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\7.0\Setup\VS" "ProductDir" - StrCmp $0 "" +1 foundVSDir ; found msvc.net 2002 - - VS60: - ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++" "ProductDir" - StrCmp $0 "" +1 foundVCDir ; found msvc 6.0 - - push "" ;empty string if not found - goto done - - foundVSDir: - push "$0Common7\Tools\vsvars32.bat" - goto done - - foundVCDir: - push "$0\bin\vcvars32.bat" - - done: - exch - pop $0 - exch - pop $1 -FunctionEnd - -!endif ;QTENV_INCLUDE diff --git a/util/scripts/win-binary/nsis/includes/regsvr.nsh b/util/scripts/win-binary/nsis/includes/regsvr.nsh deleted file mode 100644 index a2369ed..0000000 --- a/util/scripts/win-binary/nsis/includes/regsvr.nsh +++ /dev/null @@ -1,59 +0,0 @@ -!ifndef REGSVR_INCLUDE -!define REGSVR_INCLUDE - -; usage: -; push dll to register -; call RegSvr -Function RegSvr - exch $0 ;filename - push $1 - - ClearErrors - - ; get regsvr location - IfFileExists "$SYSDIR\regsvr32.exe" 0 RegSvrNotFoundError - - DetailPrint "Registering $0..." - nsExec::ExecToLog '"$SYSDIR\regsvr32.exe" /s "$0"' - pop $1 - strcmp "$1" "0" 0 RegSvrFailed - DetailPrint "Registering of $0 succeeded!" - goto RegSvrDone - - RegSvrNotFoundError: - DetailPrint "Could not find regsvr32.exe!" - SetErrors - goto RegSvrDone - - RegSvrFailed: - DetailPrint "Registering of $0 failed!$\r$\n(errorcode: $1)" - SetErrors - goto RegSvrDone - - RegSvrDone: - - pop $1 - pop $0 -FunctionEnd - -; usage: -; push dll to unregister -; call un.RegSvr -Function un.RegSvr - exch $0 ;filename - push $1 - - ; get regsvr location - IfFileExists "$SYSDIR\regsvr32.exe" 0 UnRegSvrDone - - DetailPrint "Unregistering $0..." - nsExec::ExecToLog '"$SYSDIR\regsvr32.exe" /s /u "$0"' - pop $1 - strcmp "$1" "0" 0 UnRegSvrDone - DetailPrint "Unregistering of $0 succeeded!" - UnRegSvrDone: - pop $1 - pop $0 -FunctionEnd - -!endif ;REGSVR_INCLUDE
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/system.nsh b/util/scripts/win-binary/nsis/includes/system.nsh deleted file mode 100644 index 678c32c..0000000 --- a/util/scripts/win-binary/nsis/includes/system.nsh +++ /dev/null @@ -1,364 +0,0 @@ -!ifndef SYSTEM_INCLUDE -!define SYSTEM_INCLUDE - -!define QT4VSADDIN_GUID "{6A7385B4-1D62-46e0-A4E3-AED4475371F0}" - -!define QTVSIP2003_OLD2_GUID "{789202F4-94F5-4f0a-AA00-73295FEBFD68}" -!define QTVSIP2005_OLD2_GUID "{789202F4-94F5-4f0a-AA00-73295FEBFD69}" -!define QTVSIP2008_OLD2_GUID "{7E61B999-F2CC-4DC8-8120-EF2E90FDF713}" - -!define QTVSIP2003_OLD_GUID "{789212F4-94F5-4f0a-AA00-73295FEBFD68}" -!define QTVSIP2005_OLD_GUID "{789212F4-94F5-4f0a-AA00-73295FEBFD69}" -!define QTVSIP2008_OLD_GUID "{789212F4-94F5-4f0a-AA00-73295FEBFD70}" -!define QTVSIP_GUID "{789212F4-94F5-4f0a-AFFE-73295BE14F10}" - -!define QMSNET2002_GUID "{C174ACCD-D856-4B60-9887-0FF9E841E0EC}" -!define QMSNET2003_GUID "{C174ACCE-D857-4B61-9888-0FF9E841E0ED}" -!define QMSNET2005_GUID "{14E98DB4-A232-49a4-8EC1-8CE4F6985C73}" -!define QMSNET2008_GUID "{A40CF53F-35D5-460F-9871-A3F0599309A4}" - -!macro GetVSInstallationDir UN -; Usage: -; -; push "7.0" -; call GetVSInstallationDir -; pop $0 -; -; If the requested VS version can be found, its -; installation directory is returned. -Function ${UN}GetVSInstallationDir - Exch $0 - Push $1 - ReadRegStr $1 HKLM "Software\Microsoft\VisualStudio\$0\Packages\{1B027A40-8F43-11D0-8D11-00A0C91BC942}" "About" - StrCmp $1 "" +2 - ReadRegStr $1 HKLM "Software\Microsoft\VisualStudio\$0" "InstallDir" - StrCpy $0 $1 - StrCmp $0 "" 0 +2 - SetErrors - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro GetVSInstallationDir "" -!insertmacro GetVSInstallationDir "un." - - -!macro IsDotNETInstalled UN -; Usage: -; -; push "8.0" -; call IsDotNETInstalled -; pop $0 -; -; $0 contains the path where the .NET framework is installed. -; If not installation can be found $0 is empty. -Function ${UN}IsDotNETInstalled - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - - StrCpy $5 $0 - - ReadRegStr $4 HKEY_LOCAL_MACHINE "Software\Microsoft\.NETFramework" "InstallRoot" - Push $4 - Exch $EXEDIR - Exch $EXEDIR - Pop $4 - - IfFileExists $4 0 noDotNET - StrCpy $0 0 - - EnumStart: - EnumRegKey $2 HKEY_LOCAL_MACHINE "Software\Microsoft\.NETFramework\Policy" $0 - IntOp $0 $0 + 1 - StrCmp $2 "" noDotNET - StrCpy $1 0 - - EnumPolicy: - EnumRegValue $3 HKEY_LOCAL_MACHINE "Software\Microsoft\.NETFramework\Policy\$2" $1 - IntOp $1 $1 + 1 - StrCmp $3 "" EnumStart - - StrCmp $5 "8.0" greaterThan80 - StrCmp $5 "9.0" greaterThan80 testDotNet - greaterThan80: - StrCmp $2 "v2.0" 0 EnumPolicy - - testDotNet: - IfFileExists "$4\$2.$3" foundDotNET EnumPolicy - - noDotNET: - StrCpy $0 0 - Goto done - - foundDotNET: - StrCpy $0 "$4\$2.$3" - - done: - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro IsDotNETInstalled "" -!insertmacro IsDotNETInstalled "un." - -!macro IsQt4VSAddinInstalled UN -; Usage: -; -; push "8.0" -; call IsQt4VSAddinInstalled -; pop $0 -Function ${UN}IsQt4VSAddinInstalled - Exch $0 - Push $1 - Push $2 - Push $3 - - StrCmp $0 "8.0" 0 +2 - StrCpy $2 "${QT4VSADDIN_GUID}" - StrCmp $0 "9.0" 0 +2 - StrCpy $2 "${QT4VSADDIN_GUID}" - - StrCpy $3 0 - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0\NewProjectTemplates\TemplateDirs\$2\/2" "TemplatesDir" - StrCmp $1 "" +3 - StrCpy $3 1 - goto done - - ReadRegStr $1 HKCU "SOFTWARE\Microsoft\VisualStudio\$0\NewProjectTemplates\TemplateDirs\$2\/2" "TemplatesDir" - StrCmp $1 "" +2 - StrCpy $3 1 - -done: - StrCpy $0 $3 - - Pop $3 - Pop $2 - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro IsQt4VSAddinInstalled "" -!insertmacro IsQt4VSAddinInstalled "un." - - -!macro IsQMsNetInstalled UN -; Usage: -; -; push "8.0" -; call IsQMsNetInstalled -; pop $0 -Function ${UN}IsQMsNetInstalled - Exch $0 - Push $1 - Push $2 - Push $3 - - StrCmp $0 "7.0" 0 +2 - StrCpy $2 "${QMSNET2002_GUID}" - StrCmp $0 "7.1" 0 +2 - StrCpy $2 "${QMSNET2003_GUID}" - StrCmp $0 "8.0" 0 +2 - StrCpy $2 "${QMSNET2005_GUID}" - StrCmp $0 "9.0" 0 +2 - StrCpy $2 "${QMSNET2008_GUID}" - - StrCpy $3 0 - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0\NewProjectTemplates\TemplateDirs\$2\/2" "TemplatesDir" - StrCmp $1 "" +3 - StrCpy $3 1 - goto done - - ReadRegStr $1 HKCU "SOFTWARE\Microsoft\VisualStudio\$0\NewProjectTemplates\TemplateDirs\$2\/2" "TemplatesDir" - StrCmp $1 "" +2 - StrCpy $3 1 - -done: - StrCpy $0 $3 - - Pop $3 - Pop $2 - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro IsQMsNetInstalled "" -!insertmacro IsQMsNetInstalled "un." - -!macro IsQMsDevInstalled UN -; Usage: -; -; call IsQMsDevInstalled -; pop $0 -Function ${UN}IsQMsDevInstalled - Push $0 - Push $1 - Push $2 - - StrCpy $0 0 - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "Filename" - StrCmp $1 "" +3 - StrCpy $0 1 - goto done - - ReadRegStr $1 HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "Filename" - StrCmp $1 "" +2 - StrCpy $0 1 - -done: - Pop $2 - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro IsQMsDevInstalled "" -!insertmacro IsQMsDevInstalled "un." - -!macro IsIntegrationInstalled UN -; Usage: -; -; push "8.0" -; call IsIntegrationInstalled -; pop $0 -Function ${UN}IsIntegrationInstalled - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - - StrCpy $2 "${QTVSIP_GUID}" - StrCmp $0 "7.1" 0 +3 - StrCpy $3 "${QTVSIP2003_OLD_GUID}" - StrCpy $4 "${QTVSIP2003_OLD2_GUID}" - StrCmp $0 "8.0" 0 +3 - StrCpy $3 "${QTVSIP2005_OLD_GUID}" - StrCpy $4 "${QTVSIP2005_OLD2_GUID}" - StrCmp $0 "9.0" 0 +3 - StrCpy $3 "${QTVSIP2008_OLD_GUID}" - StrCpy $4 "${QTVSIP2008_OLD2_GUID}" - - StrCpy $0 0 - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0\Packages\$2" "ProductName" - StrCmp $1 "" +3 - StrCpy $0 1 - goto done - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0\Packages\$3" "ProductName" - StrCmp $1 "" +3 - StrCpy $0 1 - goto done - - ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0\Packages\$4" "ProductName" - StrCmp $1 "" done - StrCpy $0 1 - -done: - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Exch $0 -FunctionEnd -!macroend - -!insertmacro IsIntegrationInstalled "" -!insertmacro IsIntegrationInstalled "un." - -!macro AdministratorRights UN -Function ${UN}HasAdminRights - push $0 - ClearErrors - UserInfo::GetAccountType - IfErrors Yes ;It's probably Win95 - pop $0 - StrCmp $0 "Admin" Yes - StrCmp $0 "Power" Yes - - StrCpy $0 false - goto Done - - Yes: - StrCpy $0 true - - Done: - exch $0 -FunctionEnd -!macroend -!insertmacro AdministratorRights "" -!insertmacro AdministratorRights "un." - -; Pushes 1 on the stack if VS 2005 SP1 is installed, otherwise 0. -; Usage: -; call IsVS2005SP1Installed -; pop $0 -Function IsVS2005SP1Installed - Push $0 - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\DevDiv\VS\Servicing\8.0" "SP" - ${If} $0 >= 1 - Pop $0 - Push 1 - Return - ${EndIf} -; try again for Visual Studio 2005 Express - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\DevDiv\VC\Servicing\8.0" "SP" - ${If} $0 >= 1 - Pop $0 - Push 1 - Return - ${EndIf} - Pop $0 - Push 0 -FunctionEnd - -; Pushes 1 on the stack if .NET 2 SP1 is installed, otherwise 0. -; Usage: -; call IsDotNet2SP1Installed -; pop $0 -Function IsDotNet2SP1Installed - Push $0 - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "SP" - ${If} $0 >= 1 - Pop $0 - Push 1 - Return - ${EndIf} - Pop $0 - Push 0 -FunctionEnd - - -; Pushes 1 on the stack if VS 2008 redistributable is installed, otherwise 0. -; Usage: -; call IsVS2008RedistInstalled -; pop $0 -Function IsVS2008RedistInstalled - Push $0 - ClearErrors - ReadRegDword $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FF66E9F6-83E7-3A3E-AF14-8DE9A809A6A4}" "Version" - ${If} $0 == 151015966 ; 151015966 = 0x900521e - Pop $0 - Push 1 - Return - ${EndIf} - Pop $0 - Push 0 -FunctionEnd - -!endif ;SYSTEM_INCLUDE diff --git a/util/scripts/win-binary/nsis/includes/templates.nsh b/util/scripts/win-binary/nsis/includes/templates.nsh deleted file mode 100644 index 62c5677..0000000 --- a/util/scripts/win-binary/nsis/includes/templates.nsh +++ /dev/null @@ -1,262 +0,0 @@ -!ifndef TEMPLATE_INCLUDE -!define TEMPLATE_INCLUDE - -Var ProjectInstDir -Var WizardInstDir -Var ItemInstDir - -!macro InstallProjectTemplate SD TT - SetOutPath "$ProjectInstDir" - SetOverwrite ifnewer - - ; Create the vsz file - push ${TT} ;WIZ_NAME - push "$ProjectInstDir" ;PRO_INST_DIR - push "$WizardInstDir" ;WIZ_INST_DIR - call CreateVszFile - - File "${SD}\${TT}.ico" - File "${SD}\${TT}.vsdir" - - CreateDirectory "$WizardInstDir\${TT}" - - CreateDirectory "$WizardInstDir\${TT}\1033" - SetOutPath "$WizardInstDir\${TT}\1033" - SetOverwrite ifnewer - File "${SD}\1033\styles.css" - - CreateDirectory "$WizardInstDir\${TT}\scripts\" - CreateDirectory "$WizardInstDir\${TT}\scripts\1033" - SetOutPath "$WizardInstDir\${TT}\scripts\1033" - SetOverwrite ifnewer - File "${SD}\scripts\1033\default.js" - - CreateDirectory "$WizardInstDir\${TT}\templates" - CreateDirectory "$WizardInstDir\${TT}\templates\1033" - SetOutPath "$WizardInstDir\${TT}\templates\1033" - SetOverwrite ifnewer - File "${SD}\templates\1033\*" - - CreateDirectory "$WizardInstDir\${TT}\images" - SetOutPath "$WizardInstDir\${TT}\images" - SetOverwrite ifnewer - File "${SD}\images\*" - - CreateDirectory "$WizardInstDir\${TT}\html" - CreateDirectory "$WizardInstDir\${TT}\html\1033" - SetOutPath "$WizardInstDir\${TT}\html\1033" - SetOverwrite ifnewer - File "${SD}\html\1033\*" - - CreateDirectory "$WizardInstDir\${TT}\html\1031" - SetOutPath "$WizardInstDir\${TT}\html\1031" - SetOverwrite ifnewer - File /nonfatal "${SD}\html\1031\*" -!macroend - -!macro UnInstallProjectTemplate TT - Delete "$ProjectInstDir\${TT}.vsz" - Delete "$ProjectInstDir\${TT}.ico" - Delete "$ProjectInstDir\${TT}.vsdir" - - Delete "$WizardInstDir\${TT}\1033\styles.css" - RmDir "$WizardInstDir\${TT}\1033" - - Delete "$WizardInstDir\${TT}\scripts\1033\default.js" - RmDir "$WizardInstDir\${TT}\scripts\1033" - RmDir "$WizardInstDir\${TT}\scripts" - - Delete "$WizardInstDir\${TT}\templates\1033\*" - RmDir "$WizardInstDir\${TT}\templates\1033" - RmDir "$WizardInstDir\${TT}\templates" - - Delete "$WizardInstDir\${TT}\images\*" - RmDir "$WizardInstDir\${TT}\images" - - Delete "$WizardInstDir\${TT}\html\1033\*" - RmDir "$WizardInstDir\${TT}\html\1033" - - Delete "$WizardInstDir\${TT}\html\1031\*" - RmDir "$WizardInstDir\${TT}\html\1031" - - RmDir "$WizardInstDir\${TT}\html" - - RmDir "$ProjectInstDir\${TT}" - RmDir "$WizardInstDir\${TT}" -!macroend - -Function InstallProjectTemplates - exch $0 - strcpy $ProjectInstDir "$0\projects\$VS_VERSION_SHORT" - strcpy $WizardInstDir "$0\wizards" - CreateDirectory "$ProjectInstDir" - CreateDirectory "$WizardInstDir" - - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4GuiProject" "Qt4GuiProject" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4ConsoleProject" "Qt4ConsoleProject" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4LibProject" "Qt4LibProject" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4ActiveQtServerProject" "Qt4ActiveQtServerProject" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4DesignerPluginProject" "Qt4DesignerPluginProject" - - # Check whether we have a Qt/WinCE license. - !ifdef MODULE_LICENSECHECK - qtnsisext::IsValidWinCELicense $LICENSE_KEY - IfErrors skipCETemplates - pop $1 - strcmp $1 "0" skipCETemplates - !endif - # Check whether we have VS 2008 or VS 2005. - strcmp "8.0" $VS_VERSION_SHORT installCETemplates 0 - strcmp "9.0" $VS_VERSION_SHORT installCETemplates 0 - goto skipCETemplates - installCETemplates: - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4WinCEProject" "Qt4WinCEProject" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Projects\Qt4WinCELibProject" "Qt4WinCELibProject" - skipCETemplates: - - !ifndef MODULE_OLD_ADDIN7X - # install the class wizard - strcpy $ProjectInstDir "$0\wizards\$VS_VERSION_SHORT" ### why do the .vsz file go here? - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Items\Qt4GuiClass" "Qt4GuiClass" - !insertmacro InstallProjectTemplate "${MODULE_VSIP_ROOT}\Items\Qt4Class" "Qt4Class" - !endif - - pop $0 -FunctionEnd - -Function InstallItemTemplates - exch $0 - - !ifdef MODULE_OLD_ADDIN7X - strcpy $ItemInstDir "$0\qt4items" - !else - strcpy $ItemInstDir "$0\uiItems" - !endif - CreateDirectory "$ItemInstDir" - SetOutPath "$ItemInstDir" - SetOverwrite ifnewer - !ifndef MODULE_OLD_ADDIN7X - File "${MODULE_VSIP_ROOT}\Items\uiItems\uiFiles.vsdir" - !endif - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiDialogButtonsRight.ui" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiDialogButtonsBottom.ui" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiWidget.ui" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiMainWindow.ui" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiDialogButtonsRight.ico" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiDialogButtonsBottom.ico" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiWidget.ico" - File "${MODULE_VSIP_ROOT}\Items\uiItems\newUiMainWindow.ico" - - !ifndef MODULE_OLD_ADDIN7X - strcpy $ItemInstDir "$0\qrcItems" - !endif - CreateDirectory "$ItemInstDir" - SetOutPath "$ItemInstDir" - SetOverwrite ifnewer - !ifndef MODULE_OLD_ADDIN7X - File "${MODULE_VSIP_ROOT}\Items\qrcItems\qrcFiles.vsdir" - !endif - File "${MODULE_VSIP_ROOT}\Items\qrcItems\newQrcFile.qrc" - File "${MODULE_VSIP_ROOT}\Items\qrcItems\newQrcFile.ico" - - pop $0 -FunctionEnd - -Function un.InstallProjectTemplates - exch $0 - strcpy $ProjectInstDir "$0\projects\$VS_VERSION_SHORT" - strcpy $WizardInstDir "$0\wizards" - - !insertmacro UnInstallProjectTemplate "Qt4GuiProject" - !insertmacro UnInstallProjectTemplate "Qt4ConsoleProject" - !insertmacro UnInstallProjectTemplate "Qt4LibProject" - !insertmacro UnInstallProjectTemplate "Qt4ActiveQtServerProject" - !insertmacro UnInstallProjectTemplate "Qt4DesignerPluginProject" - !insertmacro UnInstallProjectTemplate "Qt4WinCEProject" - !insertmacro UnInstallProjectTemplate "Qt4WinCELibProject" - - RmDir "$ProjectInstDir" - RmDir "$0\projects" - - !ifndef MODULE_OLD_ADDIN7X - # install the class wizard - strcpy $ProjectInstDir "$0\wizards\$VS_VERSION_SHORT" - !insertmacro UnInstallProjectTemplate "Qt4GuiClass" - !insertmacro UnInstallProjectTemplate "Qt4Class" - RmDir "$ProjectInstDir" - !endif - - RmDir "$WizardInstDir" - pop $0 -FunctionEnd - -Function un.InstallItemTemplates - exch $0 - - !ifdef MODULE_OLD_ADDIN7X - strcpy $ItemInstDir "$0\qt4items" - !else - strcpy $ItemInstDir "$0\uiItems" - Delete "$ItemInstDir\uiFiles.vsdir" - !endif - Delete "$ItemInstDir\newUiDialogButtonsRight.ui" - Delete "$ItemInstDir\newUiDialogButtonsBottom.ui" - Delete "$ItemInstDir\newUiWidget.ui" - Delete "$ItemInstDir\newUiMainWindow.ui" - Delete "$ItemInstDir\newUiDialogButtonsRight.ico" - Delete "$ItemInstDir\newUiDialogButtonsBottom.ico" - Delete "$ItemInstDir\newUiWidget.ico" - Delete "$ItemInstDir\newUiMainWindow.ico" - RmDir "$ItemInstDir" - - !ifndef MODULE_OLD_ADDIN7X - strcpy $ItemInstDir "$0\qrcItems" - Delete "$ItemInstDir\qrcFiles.vsdir" - !endif - Delete "$ItemInstDir\newQrcFile.qrc" - Delete "$ItemInstDir\newQrcFile.ico" - RmDir "$ItemInstDir" - - pop $0 -FunctionEnd - -# -# usage: -# push WIZ_NAME -# push PRO_INST_DIR -# push WIZ_INST_DIR -# call CreateVszFile -# -Function CreateVszFile - exch $1 ;WIZ_INST_DIR - exch 2 - exch $2 ;WIZ_NAME - exch - exch $3 ;PRO_INST_DIR - push $0 - - ClearErrors - FileOpen $0 "$3\$2.vsz" w - IfErrors done - FileWrite $0 "VSWIZARD 7.0$\r$\n" - -; vs2002 don't use version number at all... -strcmp "$VS_VERSION_SHORT" "7.0" +3 - FileWrite $0 "Wizard=VsWizard.VsWizardEngine.$VS_VERSION_SHORT$\r$\n" -goto +2 - FileWrite $0 "Wizard=VsWizard.VsWizardEngine$\r$\n" - - FileWrite $0 "$\r$\n" - FileWrite $0 'Param="WIZARD_NAME = $2"$\r$\n' - FileWrite $0 'Param="ABSOLUTE_PATH = $1\$2"$\r$\n' - FileWrite $0 'Param="FALLBACK_LCID = 1033"$\r$\n' - FileClose $0 - - done: - pop $0 - pop $3 - pop $2 - pop $1 -FunctionEnd - -!endif ;TEMPLATE_INCLUDE diff --git a/util/scripts/win-binary/nsis/includes/writeEnvStr.nsh b/util/scripts/win-binary/nsis/includes/writeEnvStr.nsh deleted file mode 100644 index 98926d0..0000000 --- a/util/scripts/win-binary/nsis/includes/writeEnvStr.nsh +++ /dev/null @@ -1,138 +0,0 @@ -!ifndef WRITEENVSTR_INCLUDED -!define WRITEENVSTR_INCLUDED - -!include WinMessages.nsh - -!ifdef ALL_USERS - !define WriteEnvStr_RegKey \ - 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' -!else - !define WriteEnvStr_RegKey 'HKCU "Environment"' -!endif - -# -# WriteEnvStr - Writes an environment variable -# Note: Win9x systems requires reboot -# -# Example: -# Push "HOMEDIR" # name -# Push "C:\New Home Dir\" # value -# Call WriteEnvStr -# -Function WriteEnvStr - Exch $1 ; $1 has environment variable value - Exch - Exch $0 ; $0 has environment variable name - Push $2 - - Call IsNT - Pop $2 - StrCmp $2 1 WriteEnvStr_NT - ; Not on NT - StrCpy $2 $WINDIR 2 ; Copy drive of windows (c:) - FileOpen $2 "$2\autoexec.bat" a - FileSeek $2 0 END - FileWrite $2 "$\r$\nSET $0=$1$\r$\n" - FileClose $2 - SetRebootFlag true - Goto WriteEnvStr_done - - WriteEnvStr_NT: - WriteRegExpandStr ${WriteEnvStr_RegKey} $0 $1 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - WriteEnvStr_done: - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -# -# un.DeleteEnvStr - Removes an environment variable -# Note: Win9x systems requires reboot -# -# Example: -# Push "HOMEDIR" # name -# Call un.DeleteEnvStr -# -Function un.DeleteEnvStr - Exch $0 ; $0 now has the name of the variable - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - - Call un.IsNT - Pop $1 - StrCmp $1 1 DeleteEnvStr_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" r - GetTempFileName $4 - FileOpen $2 $4 w - StrCpy $0 "SET $0=" - SetRebootFlag true - - DeleteEnvStr_dosLoop: - FileRead $1 $3 - StrLen $5 $0 - StrCpy $5 $3 $5 - StrCmp $5 $0 DeleteEnvStr_dosLoop - StrCmp $5 "" DeleteEnvStr_dosLoopEnd - FileWrite $2 $3 - Goto DeleteEnvStr_dosLoop - - DeleteEnvStr_dosLoopEnd: - FileClose $2 - FileClose $1 - StrCpy $1 $WINDIR 2 - Delete "$1\autoexec.bat" - CopyFiles /SILENT $4 "$1\autoexec.bat" - Delete $4 - Goto DeleteEnvStr_done - - DeleteEnvStr_NT: - DeleteRegValue ${WriteEnvStr_RegKey} $0 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - DeleteEnvStr_done: - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -# -# [un.]IsNT - Pushes 1 if running on NT, 0 if not -# -# Example: -# Call IsNT -# Pop $0 -# StrCmp $0 1 +3 -# MessageBox MB_OK "Not running on NT!" -# Goto +2 -# MessageBox MB_OK "Running on NT!" -# -!macro IsNT UN -Function ${UN}IsNT - Push $0 - ReadRegStr $0 HKLM \ - "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCmp $0 "" 0 IsNT_yes - ; we are not NT. - Pop $0 - Push 0 - Return - - IsNT_yes: - ; NT!!! - Pop $0 - Push 1 -FunctionEnd -!macroend -!insertmacro IsNT "" -!insertmacro IsNT "un." - -!endif ;WRITEENVSTR_INCLUDED
\ No newline at end of file diff --git a/util/scripts/win-binary/nsis/includes/writePathStr.nsh b/util/scripts/win-binary/nsis/includes/writePathStr.nsh deleted file mode 100644 index 57e6792..0000000 --- a/util/scripts/win-binary/nsis/includes/writePathStr.nsh +++ /dev/null @@ -1,241 +0,0 @@ -!verbose 3 -!include "WinMessages.NSH" -!verbose 4 - -; AddToPath - Adds the given dir to the search path. -; Input - head of the stack -; Note - Win9x systems requires reboot - -Function AddToPath - Exch $0 - Push $1 - Push $2 - Push $3 - - # don't add if the path doesn't exist - IfFileExists $0 "" AddToPath_done - - ReadEnvStr $1 PATH - Push "$1;" - Push "$0;" - Call StringString - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$0\;" - Call StringString - Pop $2 - StrCmp $2 "" "" AddToPath_done - GetFullPathName /SHORT $3 $0 - Push "$1;" - Push "$3;" - Call StringString - Pop $2 - StrCmp $2 "" "" AddToPath_done - Push "$1;" - Push "$3\;" - Call StringString - Pop $2 - StrCmp $2 "" "" AddToPath_done - - Call IsNT2 - Pop $1 - StrCmp $1 1 AddToPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" a - FileSeek $1 -1 END - FileReadByte $1 $2 - IntCmp $2 26 0 +2 +2 # DOS EOF - FileSeek $1 -1 END # write over EOF - FileWrite $1 "$\r$\nSET PATH=$3;%PATH%$\r$\n" - FileClose $1 - SetRebootFlag true - Goto AddToPath_done - - AddToPath_NT: - ReadRegStr $1 HKCU "Environment" "PATH" - StrCpy $2 $1 1 -1 # copy last char - StrCmp $2 ";" 0 +2 # if last char == ; - StrCpy $1 $1 -1 # remove last char - StrCmp $1 "" AddToPath_NTdoIt - StrCpy $0 "$0;$1" - AddToPath_NTdoIt: - WriteRegExpandStr HKCU "Environment" "PATH" $0 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - AddToPath_done: - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -; RemoveFromPath - Remove a given dir from the path -; Input: head of the stack - -!macro RemoveFromPath un -Function ${un}RemoveFromPath - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - - IntFmt $6 "%c" 26 # DOS EOF - - Call ${un}IsNT2 - Pop $1 - StrCmp $1 1 unRemoveFromPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" r - GetTempFileName $4 - FileOpen $2 $4 w - GetFullPathName /SHORT $0 $0 - StrCpy $0 "SET PATH=$0;%PATH%" - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoop: - FileRead $1 $3 - StrCpy $5 $3 1 -1 # read last char - StrCmp $5 $6 0 +2 # if DOS EOF - StrCpy $3 $3 -1 # remove DOS EOF so we can compare - StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "" unRemoveFromPath_dosLoopEnd - FileWrite $2 $3 - Goto unRemoveFromPath_dosLoop - unRemoveFromPath_dosLoopRemoveLine: - SetRebootFlag true - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoopEnd: - FileClose $2 - FileClose $1 - StrCpy $1 $WINDIR 2 - Delete "$1\autoexec.bat" - CopyFiles /SILENT $4 "$1\autoexec.bat" - Delete $4 - Goto unRemoveFromPath_done - - unRemoveFromPath_NT: - ReadRegStr $1 HKCU "Environment" "PATH" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 ";" +2 # if last char != ; - StrCpy $1 "$1;" # append ; - Push $1 - Push "$0;" - Call ${un}StringString ; Find `$0;` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done - ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0;" - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 - - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 ";" 0 +2 # if last char == ; - StrCpy $3 $3 -1 # remove last char - - WriteRegExpandStr HKCU "Environment" "PATH" $3 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - unRemoveFromPath_done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd -!macroend -!insertmacro RemoveFromPath "" -!insertmacro RemoveFromPath "un." - - -########################################### -# Utility Functions # -########################################### - -; IsNT2 -; no input -; output, top of the stack = 1 if NT or 0 if not -; -; Usage: -; Call IsNT2 -; Pop $R0 -; ($R0 at this point is 1 or 0) - -!macro IsNT2 un -Function ${un}IsNT2 - Push $0 - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCmp $0 "" 0 IsNT2_yes - ; we are not NT. - Pop $0 - Push 0 - Return - - IsNT2_yes: - ; NT!!! - Pop $0 - Push 1 -FunctionEnd -!macroend -!insertmacro IsNT2 "" -!insertmacro IsNT2 "un." - -; StringString -; input, top of stack = string to search for -; top of stack-1 = string to search in -; output, top of stack (replaces with the portion of the string remaining) -; modifies no other variables. -; -; Usage: -; Push "this is a long ass string" -; Push "ass" -; Call StringString -; Pop $R0 -; ($R0 at this point is "ass string") - -!macro StringString un -Function ${un}StringString -Exch $R1 ; st=haystack,old$R1, $R1=needle - Exch ; st=old$R1,haystack - Exch $R2 ; st=old$R1,old$R2, $R2=haystack - Push $R3 - Push $R4 - Push $R5 - StrLen $R3 $R1 - StrCpy $R4 0 - ; $R1=needle - ; $R2=haystack - ; $R3=len(needle) - ; $R4=cnt - ; $R5=tmp - loop: - StrCpy $R5 $R2 $R3 $R4 - StrCmp $R5 $R1 done - StrCmp $R5 "" done - IntOp $R4 $R4 + 1 - Goto loop -done: - StrCpy $R1 $R2 "" $R4 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Exch $R1 -FunctionEnd -!macroend -!insertmacro StringString "" -!insertmacro StringString "un." |