summaryrefslogtreecommitdiffstats
path: root/util/scripts/win-binary/nsis
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-04-17 14:06:06 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-04-17 14:06:06 (GMT)
commitf15b8a83e2e51955776a3f07cb85ebfc342dd8ef (patch)
treec5dc684986051654898db11ce73e03b9fec8db99 /util/scripts/win-binary/nsis
downloadQt-f15b8a83e2e51955776a3f07cb85ebfc342dd8ef.zip
Qt-f15b8a83e2e51955776a3f07cb85ebfc342dd8ef.tar.gz
Qt-f15b8a83e2e51955776a3f07cb85ebfc342dd8ef.tar.bz2
Initial import of statemachine branch from the old kinetic repository
Diffstat (limited to 'util/scripts/win-binary/nsis')
-rw-r--r--util/scripts/win-binary/nsis/confirmpage.ini19
-rw-r--r--util/scripts/win-binary/nsis/eclipse.ini60
-rw-r--r--util/scripts/win-binary/nsis/envpage.ini36
-rw-r--r--util/scripts/win-binary/nsis/gwdownload.ini78
-rw-r--r--util/scripts/win-binary/nsis/gwmirror.ini27
-rw-r--r--util/scripts/win-binary/nsis/images/install.icobin0 -> 355574 bytes
-rw-r--r--util/scripts/win-binary/nsis/images/qt-header.bmpbin0 -> 25820 bytes
-rw-r--r--util/scripts/win-binary/nsis/images/qt-wizard-clean.bmpbin0 -> 154544 bytes
-rw-r--r--util/scripts/win-binary/nsis/images/qt-wizard.bmpbin0 -> 154544 bytes
-rw-r--r--util/scripts/win-binary/nsis/includes/global.nsh204
-rw-r--r--util/scripts/win-binary/nsis/includes/help.nsh133
-rw-r--r--util/scripts/win-binary/nsis/includes/instdir.nsh214
-rw-r--r--util/scripts/win-binary/nsis/includes/list.nsh96
-rw-r--r--util/scripts/win-binary/nsis/includes/qtcommon.nsh547
-rw-r--r--util/scripts/win-binary/nsis/includes/qtdir.nsh120
-rw-r--r--util/scripts/win-binary/nsis/includes/qtenv.nsh350
-rw-r--r--util/scripts/win-binary/nsis/includes/regsvr.nsh59
-rw-r--r--util/scripts/win-binary/nsis/includes/system.nsh364
-rw-r--r--util/scripts/win-binary/nsis/includes/templates.nsh262
-rw-r--r--util/scripts/win-binary/nsis/includes/writeEnvStr.nsh138
-rw-r--r--util/scripts/win-binary/nsis/includes/writePathStr.nsh241
-rw-r--r--util/scripts/win-binary/nsis/installer.nsi524
-rw-r--r--util/scripts/win-binary/nsis/instdir.ini102
-rw-r--r--util/scripts/win-binary/nsis/license.ini70
-rw-r--r--util/scripts/win-binary/nsis/licensepage.ini48
-rw-r--r--util/scripts/win-binary/nsis/modules/addin60.nsh139
-rw-r--r--util/scripts/win-binary/nsis/modules/addin7x.nsh417
-rw-r--r--util/scripts/win-binary/nsis/modules/debugext.nsh669
-rw-r--r--util/scripts/win-binary/nsis/modules/eclipse.nsh398
-rw-r--r--util/scripts/win-binary/nsis/modules/environment.nsh176
-rw-r--r--util/scripts/win-binary/nsis/modules/evaluation.nsh116
-rw-r--r--util/scripts/win-binary/nsis/modules/help.nsh274
-rw-r--r--util/scripts/win-binary/nsis/modules/license.nsh377
-rw-r--r--util/scripts/win-binary/nsis/modules/mingw.nsh629
-rw-r--r--util/scripts/win-binary/nsis/modules/msvc.nsh439
-rw-r--r--util/scripts/win-binary/nsis/modules/opensource.nsh56
-rw-r--r--util/scripts/win-binary/nsis/modules/qsa.nsh255
-rw-r--r--util/scripts/win-binary/nsis/modules/qtdemo.nsh112
-rw-r--r--util/scripts/win-binary/nsis/modules/qtjambi.nsh98
-rw-r--r--util/scripts/win-binary/nsis/modules/qtjambieclipse.nsh223
-rw-r--r--util/scripts/win-binary/nsis/modules/registeruiext.nsh174
-rw-r--r--util/scripts/win-binary/nsis/modules/vsip.nsh1030
-rw-r--r--util/scripts/win-binary/nsis/opensource.ini38
-rw-r--r--util/scripts/win-binary/nsis/qsa.ini28
-rw-r--r--util/scripts/win-binary/nsis/qtdir.ini70
-rw-r--r--util/scripts/win-binary/nsis/qtjambieclipse.ini26
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/binpatch.cpp216
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/binpatch.h81
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/exdll.h137
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/licensefinder.cpp250
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/licensefinder.h74
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/mingw.cpp156
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/mingw.h45
-rwxr-xr-xutil/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.exebin0 -> 77824 bytes
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.vcproj206
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/qtlibspatchermain.cpp200
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/qtnsisext.cpp495
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/qtnsisext.dllbin0 -> 77824 bytes
-rw-r--r--util/scripts/win-binary/nsis/qtnsisext/qtnsisext.vcproj164
59 files changed, 11460 insertions, 0 deletions
diff --git a/util/scripts/win-binary/nsis/confirmpage.ini b/util/scripts/win-binary/nsis/confirmpage.ini
new file mode 100644
index 0000000..cf1fdab
--- /dev/null
+++ b/util/scripts/win-binary/nsis/confirmpage.ini
@@ -0,0 +1,19 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=2
+
+[Field 1]
+Type=Label
+Text=The following components will be uninstalled:
+Left=1
+Right=298
+Top=1
+Bottom=12
+
+[Field 2]
+Type=Label
+Left=16
+Right=298
+Top=16
+Bottom=136
+
diff --git a/util/scripts/win-binary/nsis/eclipse.ini b/util/scripts/win-binary/nsis/eclipse.ini
new file mode 100644
index 0000000..7e715b0
--- /dev/null
+++ b/util/scripts/win-binary/nsis/eclipse.ini
@@ -0,0 +1,60 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=7
+
+[Field 1]
+Type=Groupbox
+Text=MinGW Installation
+Left=1
+Right=300
+Top=65
+Bottom=132
+
+[Field 2]
+Type=Groupbox
+Text=Eclipse Installation
+Left=1
+Right=300
+Top=8
+Bottom=59
+
+[Field 3]
+Type=DirRequest
+State=C:\MinGW\bin
+Left=12
+Right=286
+Top=91
+Bottom=102
+
+[Field 4]
+Type=Label
+Text=Select where MinGW is installed (The directory where gcc.exe is located):
+Left=13
+Right=292
+Top=81
+Bottom=89
+
+[Field 5]
+Type=DirRequest
+State=C:\Eclipse
+Left=12
+Right=286
+Top=33
+Bottom=46
+
+[Field 6]
+Type=Label
+Text=Select the Eclipse installation you want to use:
+Left=12
+Right=180
+Top=22
+Bottom=30
+
+[Field 7]
+Type=Label
+Text=If you don't specify a MinGW location, you will not get a shortcut in you startmenu to start Eclipse with MinGW in your path.
+Left=12
+Right=287
+Top=107
+Bottom=124
+
diff --git a/util/scripts/win-binary/nsis/envpage.ini b/util/scripts/win-binary/nsis/envpage.ini
new file mode 100644
index 0000000..c383592
--- /dev/null
+++ b/util/scripts/win-binary/nsis/envpage.ini
@@ -0,0 +1,36 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=4
+
+[Field 1]
+Type=Groupbox
+Text=Environment variables
+Left=0
+Right=299
+Top=6
+Bottom=132
+
+[Field 2]
+Type=Checkbox
+Text=Set environment variables
+Left=16
+Right=143
+Top=49
+Bottom=59
+
+[Field 3]
+Type=Label
+Text=Qt requires that a set of environment variables is defined. By checking this option the installer adds these variables globally.
+Left=9
+Right=290
+Top=20
+Bottom=40
+
+[Field 4]
+Type=Label
+Text=Warning:\r\nEnabling this option makes the installer change settings in your registry. If you don't want to set these variables automatically, the installer provides a qtvars.bat file which sets the required variables. There is also a shortcut, located in your Qt start menu folder, that opens a Qt environment. The installer will try to remove any existing Qt environment variables if found.
+Left=8
+Right=292
+Top=70
+Bottom=121
+
diff --git a/util/scripts/win-binary/nsis/gwdownload.ini b/util/scripts/win-binary/nsis/gwdownload.ini
new file mode 100644
index 0000000..9b4ea16
--- /dev/null
+++ b/util/scripts/win-binary/nsis/gwdownload.ini
@@ -0,0 +1,78 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=9
+
+[Field 1]
+Type=Groupbox
+Text=Find MinGW
+Left=0
+Right=299
+Top=49
+Bottom=91
+
+[Field 2]
+Type=Label
+Text=Please specify a directory where to find MinGW (for instance: C:\\MinGW). If you do not have MinGW installed, you can let the installer download and install it for you.
+Left=2
+Right=298
+Top=1
+Bottom=27
+
+[Field 3]
+Type=DirRequest
+Left=8
+Right=290
+Top=68
+Bottom=81
+
+[Field 4]
+Type=Groupbox
+Text=Download and install MinGW
+Left=0
+Right=299
+Top=94
+Bottom=137
+
+[Field 5]
+Type=Label
+Text=Previously installed MinGW:
+Left=8
+Right=286
+Top=60
+Bottom=68
+
+[Field 6]
+Type=DirRequest
+Left=8
+Right=290
+Top=116
+Bottom=129
+Flags=DISABLED
+
+[Field 7]
+Type=Label
+Text=Installation directory:
+Left=8
+Right=124
+Top=107
+Bottom=115
+Flags=DISABLED
+
+[Field 8]
+Type=Checkbox
+Text=Download and install minimal MinGW installation.
+Left=8
+Right=172
+Top=28
+Bottom=40
+Flags=NOTIFY
+
+[Field 9]
+Type=Link
+Text=(http://www.mingw.org)
+Left=174
+Right=260
+Top=30
+Bottom=38
+State=http://www.mingw.org
+
diff --git a/util/scripts/win-binary/nsis/gwmirror.ini b/util/scripts/win-binary/nsis/gwmirror.ini
new file mode 100644
index 0000000..77a0319
--- /dev/null
+++ b/util/scripts/win-binary/nsis/gwmirror.ini
@@ -0,0 +1,27 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=3
+
+[Field 1]
+Type=Label
+Text=Select a mirror where to download MinGW:
+Left=0
+Right=211
+Top=0
+Bottom=8
+
+[Field 2]
+Type=Checkbox
+Text=Download MinGW source code. (You don't need this to compile Qt)
+Left=4
+Right=296
+Top=124
+Bottom=134
+
+[Field 3]
+Type=Listbox
+Left=0
+Right=299
+Top=9
+Bottom=118
+
diff --git a/util/scripts/win-binary/nsis/images/install.ico b/util/scripts/win-binary/nsis/images/install.ico
new file mode 100644
index 0000000..2cbd979
--- /dev/null
+++ b/util/scripts/win-binary/nsis/images/install.ico
Binary files differ
diff --git a/util/scripts/win-binary/nsis/images/qt-header.bmp b/util/scripts/win-binary/nsis/images/qt-header.bmp
new file mode 100644
index 0000000..a5125c9
--- /dev/null
+++ b/util/scripts/win-binary/nsis/images/qt-header.bmp
Binary files differ
diff --git a/util/scripts/win-binary/nsis/images/qt-wizard-clean.bmp b/util/scripts/win-binary/nsis/images/qt-wizard-clean.bmp
new file mode 100644
index 0000000..a4dbe2c
--- /dev/null
+++ b/util/scripts/win-binary/nsis/images/qt-wizard-clean.bmp
Binary files differ
diff --git a/util/scripts/win-binary/nsis/images/qt-wizard.bmp b/util/scripts/win-binary/nsis/images/qt-wizard.bmp
new file mode 100644
index 0000000..2f697af
--- /dev/null
+++ b/util/scripts/win-binary/nsis/images/qt-wizard.bmp
Binary files differ
diff --git a/util/scripts/win-binary/nsis/includes/global.nsh b/util/scripts/win-binary/nsis/includes/global.nsh
new file mode 100644
index 0000000..9bc8f0a
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/global.nsh
@@ -0,0 +1,204 @@
+!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
new file mode 100644
index 0000000..797337e
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/help.nsh
@@ -0,0 +1,133 @@
+!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
new file mode 100644
index 0000000..6e4dab2
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/instdir.nsh
@@ -0,0 +1,214 @@
+!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
new file mode 100644
index 0000000..47d1702
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/list.nsh
@@ -0,0 +1,96 @@
+!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
new file mode 100644
index 0000000..8ef8207
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/qtcommon.nsh
@@ -0,0 +1,547 @@
+!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
new file mode 100644
index 0000000..ac4de3b
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/qtdir.nsh
@@ -0,0 +1,120 @@
+!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
new file mode 100644
index 0000000..d1c3bfd
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/qtenv.nsh
@@ -0,0 +1,350 @@
+!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
new file mode 100644
index 0000000..a2369ed
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/regsvr.nsh
@@ -0,0 +1,59 @@
+!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
new file mode 100644
index 0000000..678c32c
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/system.nsh
@@ -0,0 +1,364 @@
+!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
new file mode 100644
index 0000000..62c5677
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/templates.nsh
@@ -0,0 +1,262 @@
+!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
new file mode 100644
index 0000000..98926d0
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/writeEnvStr.nsh
@@ -0,0 +1,138 @@
+!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
new file mode 100644
index 0000000..57e6792
--- /dev/null
+++ b/util/scripts/win-binary/nsis/includes/writePathStr.nsh
@@ -0,0 +1,241 @@
+!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."
diff --git a/util/scripts/win-binary/nsis/installer.nsi b/util/scripts/win-binary/nsis/installer.nsi
new file mode 100644
index 0000000..e61f00e
--- /dev/null
+++ b/util/scripts/win-binary/nsis/installer.nsi
@@ -0,0 +1,524 @@
+; Script generated by the HM NIS Edit Script Wizard.
+
+SetCompressor /FINAL /SOLID lzma
+!include "config.nsh"
+!include "includes\global.nsh"
+
+!define PRODUCT_PUBLISHER "Nokia Corporation and/or its subsidiary(-ies)"
+!define PRODUCT_WEB_SITE "http://qtsoftware.com"
+
+!define INSTALL_ICON "images\install.ico"
+
+!ifndef WELCOME_ICON
+ !define WELCOME_ICON "images\qt-wizard.bmp"
+!endif
+!define PAGE_HEADER_ICON "images\qt-header.bmp"
+
+!include "MUI.nsh"
+!include "FileFunc.nsh"
+!insertmacro GetParameters
+!insertmacro GetOptions
+
+; modules
+!include "modules\mingw.nsh"
+!include "modules\msvc.nsh"
+!include "modules\addin7x.nsh"
+!include "modules\qsa.nsh"
+!include "modules\addin60.nsh"
+!include "modules\qtjambi.nsh"
+!include "modules\debugext.nsh"
+!include "modules\license.nsh"
+!include "modules\vsip.nsh"
+!include "modules\help.nsh"
+!include "modules\registeruiext.nsh"
+!include "modules\environment.nsh"
+!include "modules\evaluation.nsh"
+!include "modules\opensource.nsh"
+!include "modules\eclipse.nsh"
+!include "modules\qtjambieclipse.nsh"
+!include "modules\qtdemo.nsh"
+!include "includes\instdir.nsh"
+
+; MUI Settings
+!define MUI_ABORTWARNING
+!define MUI_ICON "${INSTALL_ICON}"
+!define MUI_UNICON "${INSTALL_ICON}"
+
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_BITMAP "${PAGE_HEADER_ICON}"
+!define MUI_HEADERIMAGE_UNBITMAP "${PAGE_HEADER_ICON}"
+
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${WELCOME_ICON}"
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${WELCOME_ICON}"
+
+!ifdef WELCOME_NOTE
+ !define MUI_WELCOMEPAGE_TEXT "${WELCOME_NOTE}"
+!endif
+!ifdef WELCOME_TITLE
+ !define MUI_WELCOMEPAGE_TITLE "${WELCOME_TITLE}"
+!endif
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro OPENSOURCE_INITIALIZE
+!insertmacro EVALUATION_INITIALIZE
+!insertmacro LICENSECHECK_INITIALIZE
+!insertmacro MSVC_INITIALIZE
+!insertmacro ADDIN7X_INITIALIZE
+!insertmacro ADDIN60_INITIALIZE
+!insertmacro QTJAMBI_INITIALIZE
+!insertmacro DEBUGEXT_INITIALIZE
+!insertmacro HELP_INITIALIZE
+!insertmacro VSIP_INITIALIZE
+
+!ifdef USE_COMPONENT_PAGE
+ !insertmacro MUI_PAGE_COMPONENTS
+!endif
+
+!ifdef USE_DIRECTORY_PAGE
+ !insertmacro INSTDIR_INITIALIZE
+!endif
+
+!ifdef USE_STARTMENU_PAGE
+ !define MUI_STARTMENUPAGE_NODISABLE
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${DEFAULT_STARTMENU_STRING}"
+ !insertmacro MUI_PAGE_STARTMENU 1 $STARTMENU_STRING
+!endif
+
+!insertmacro MINGW_INITIALIZE
+!insertmacro QSA_INITIALIZE
+!insertmacro ENVIRONMENT_INITIALIZE
+!insertmacro REGISTERUIEXT_INITIALIZE
+!insertmacro ECLIPSE_INITIALIZE
+!insertmacro QTJAMBIECLIPSE_INITIALIZE
+
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+
+!insertmacro MUI_PAGE_INSTFILES
+!ifdef README_FILE
+ !define MUI_FINISHPAGE_SHOWREADME ${README_FILE}
+!else
+ !ifdef README_FUNCTION
+ !define MUI_FINISHPAGE_SHOWREADME
+ !define MUI_FINISHPAGE_SHOWREADME_TEXT "${README_FUNCTION}"
+ !define MUI_FINISHPAGE_SHOWREADME_FUNCTION "CommonReadmeFunction"
+ !endif
+!endif
+!ifdef RUN_FUNCTION
+ !define MUI_FINISHPAGE_RUN
+ !define MUI_FINISHPAGE_RUN_TEXT "${RUN_FUNCTION}"
+ !define MUI_FINISHPAGE_RUN_FUNCTION "CommonRunFunction"
+!endif
+!ifdef FINISH_TITLE
+ !define MUI_FINISHPAGE_TITLE "${FINISH_TITLE}"
+!endif
+!insertmacro MUI_PAGE_FINISH
+
+!ifdef WELCOME_TITLE
+ !define MUI_WELCOMEPAGE_TITLE "${WELCOME_TITLE}"
+!endif
+!insertmacro MUI_UNPAGE_WELCOME
+!define UNINSTALLER_CONFIRM_PAGE "confirmpage.ini"
+UninstPage custom un.UninstallerConfirmPage
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!ifdef FINISH_TITLE
+ !define MUI_FINISHPAGE_TITLE "${FINISH_TITLE}"
+!endif
+!insertmacro MUI_UNPAGE_FINISH
+
+!insertmacro MUI_LANGUAGE "English"
+
+Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
+OutFile ${OUTPUT_FILE}
+
+Section -PreCommonSection
+!ifdef INSTDIR_0 ;the default one, must exist
+ strcpy $INSTDIR $${INSTDIR_0}_INSTDIR
+ ${StrRep} $PRODUCT_UNIQUE_KEY "${PRODUCT_NAME} ${PRODUCT_VERSION} - $INSTDIR" "\" "_"
+ strcpy $PRODUCT_UNIQUE_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCT_UNIQUE_KEY"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_0}_INSTDIR" "$${INSTDIR_0}_INSTDIR"
+!endif
+!ifdef INSTDIR_1
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_1}_INSTDIR" "$${INSTDIR_1}_INSTDIR"
+!endif
+!ifdef INSTDIR_2
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_2}_INSTDIR" "$${INSTDIR_2}_INSTDIR"
+!endif
+!ifdef INSTDIR_3
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_3}_INSTDIR" "$${INSTDIR_3}_INSTDIR"
+!endif
+!ifdef INSTDIR_4
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_4}_INSTDIR" "$${INSTDIR_4}_INSTDIR"
+!endif
+!ifdef INSTDIR_5
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_5}_INSTDIR" "$${INSTDIR_5}_INSTDIR"
+!endif
+
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "StartMenu" "$STARTMENU_STRING"
+ !insertmacro CreateConditionalShortCutDirectory "$SMPROGRAMS\$STARTMENU_STRING"
+SectionEnd
+
+!insertmacro MSVC_SECTIONS
+!insertmacro OPENSOURCE_SECTIONS
+!insertmacro ADDIN7X_SECTIONS
+!insertmacro ADDIN60_SECTIONS
+!insertmacro QTJAMBI_SECTIONS
+!insertmacro VSIP_SECTIONS
+!insertmacro HELP_SECTIONS
+!insertmacro DEBUGEXT_SECTIONS
+!insertmacro LICENSECHECK_SECTIONS
+!insertmacro QSA_SECTIONS
+!insertmacro MINGW_SECTIONS
+!insertmacro EVALUATION_SECTIONS
+!insertmacro ENVIRONMENT_SECTIONS
+!insertmacro REGISTERUIEXT_SECTIONS
+!insertmacro ECLIPSE_SECTIONS
+!insertmacro QTJAMBIECLIPSE_SECTIONS
+!insertmacro QTDEMO_SECTIONS
+
+!ifdef USE_OPTIONAL_SHORTCUTCREATION
+Section "Create shortcuts" SEC_SHORTCUTCREATION
+SectionEnd
+!endif ;USE_OPTIONAL_SHORTCUTCREATION
+
+!insertmacro INSTDIR_FUNCTIONS
+
+Section -CommonSection
+ WriteUninstaller "$INSTDIR\uninst.exe"
+
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayName" "$(^Name)"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "UninstallString" "$INSTDIR\uninst.exe"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "Publisher" "${PRODUCT_PUBLISHER}"
+
+ WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\QtSoftware.com.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\Uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk" "$INSTDIR\uninst.exe"
+ SetOutPath "$INSTDIR"
+SectionEnd
+
+Function CheckLocalLicenseProduct
+!ifdef MODULE_LICENSECHECK
+ !insertmacro QSA_CHECKLICENSEPRODUCT
+!endif
+FunctionEnd
+
+Function .onInit
+ StrCpy $STARTMENU_STRING "${DEFAULT_STARTMENU_STRING}"
+!ifdef USE_OPTIONAL_SHORTCUTCREATION
+ SectionSetText ${SEC_SHORTCUTCREATION} "${GLOBAL_SEC_SHORTCUTCREATION_TEXT}"
+!endif ;USE_OPTIONAL_SHORTCUTCREATION
+
+!ifdef USE_UNINSTALL_PREVIOUS
+ push "${PRODUCT_NAME}"
+ call GetExistsPreviousInstallationOfProduct
+ exch $0
+ StrCmp $0 true 0 +3
+ MessageBox MB_OK|MB_ICONSTOP "A previous installation of ${PRODUCT_NAME} was detected.$\nPlease uninstall it before running this installer."
+ Abort
+ pop $0
+!endif
+
+!ifdef USE_WARN_NO_QT_FOUND
+ Push $0
+ EnumRegKey $0 HKLM "${QT_VERSION_KEY_NAME}" 0
+ StrCmp $0 "" 0 qt_found
+ EnumRegKey $0 HKCU "${QT_VERSION_KEY_NAME}" 0
+ StrCmp $0 "" 0 qt_found
+ MessageBox MB_OK|MB_ICONEXCLAMATION "No installed Qt package has been detected.$\nPlease make sure that Qt is installed before using the ${PRODUCT_NAME}"
+ qt_found:
+ Pop $0
+!endif
+
+ call SetAdminVar
+ StrCmp "$RUNNING_AS_ADMIN" false 0 common_running_as_admin
+!ifdef USE_ADMIN_CHECK
+ MessageBox MB_OK|MB_ICONSTOP "You need to have administrator rights to install this software!"
+ Abort
+!endif
+ SetShellVarContext current
+ goto common_admin_check_done
+ common_running_as_admin:
+ SetShellVarContext all
+ common_admin_check_done:
+
+ Push $0
+ Push $1
+ ${GetParameters} $0
+ ${GetOptions} $0 /LICENSEKEY= $1
+ ClearErrors
+ StrCmp $1 "" +2
+ strcpy $LICENSE_KEY "$1"
+
+ ${GetOptions} $0 /LICENSEE= $1
+ ClearErrors
+ StrCmp $1 "" +2
+ strcpy $LICENSEE "$1"
+
+ Pop $1
+ Pop $0
+
+ !insertmacro INSTDIR_STARTUP
+
+ !insertmacro LICENSECHECK_STARTUP
+ !insertmacro ENVIRONMENT_STARTUP
+ !insertmacro REGISTERUIEXT_STARTUP
+ !insertmacro MSVC_STARTUP
+ !insertmacro OPENSOURCE_STARTUP
+ !insertmacro EVALUATION_STARTUP
+ !insertmacro ADDIN7X_STARTUP
+ !insertmacro ADDIN60_STARTUP
+ !insertmacro QTJAMBI_STARTUP
+ !insertmacro DEBUGEXT_STARTUP
+ !insertmacro VSIP_STARTUP
+ !insertmacro HELP_STARTUP
+ !insertmacro QSA_STARTUP
+ !insertmacro MINGW_STARTUP
+ !insertmacro ECLIPSE_STARTUP
+ !insertmacro QTJAMBIECLIPSE_STARTUP
+ !insertmacro QTDEMO_STARTUP
+FunctionEnd
+
+Function .onInstSuccess
+ !insertmacro LICENSECHECK_FINISH
+ !insertmacro ENVIRONMENT_FINISH
+ !insertmacro REGISTERUIEXT_FINISH
+ !insertmacro MSVC_FINISH
+ !insertmacro OPENSOURCE_FINISH
+ !insertmacro EVALUATION_FINISH
+ !insertmacro ADDIN7X_FINISH
+ !insertmacro ADDIN60_FINISH
+ !insertmacro QTJAMBI_FINISH
+ !insertmacro DEBUGEXT_FINISH
+ !insertmacro VSIP_FINISH
+ !insertmacro HELP_FINISH
+ !insertmacro QSA_FINISH
+ !insertmacro MINGW_FINISH
+ !insertmacro ECLIPSE_FINISH
+ !insertmacro QTJAMBIECLIPSE_FINISH
+FunctionEnd
+
+Function un.onUninstSuccess
+ !insertmacro LICENSECHECK_UNFINISH
+ !insertmacro ENVIRONMENT_UNFINISH
+ !insertmacro REGISTERUIEXT_UNFINISH
+ !insertmacro MSVC_UNFINISH
+ !insertmacro OPENSOURCE_UNFINISH
+ !insertmacro EVALUATION_UNFINISH
+ !insertmacro ADDIN7X_UNFINISH
+ !insertmacro ADDIN60_UNFINISH
+ !insertmacro QTJAMBI_UNFINISH
+ !insertmacro DEBUGEXT_UNFINISH
+ !insertmacro VSIP_UNFINISH
+ !insertmacro HELP_UNFINISH
+ !insertmacro QSA_UNFINISH
+ !insertmacro MINGW_UNFINISH
+ !insertmacro ECLIPSE_UNFINISH
+ !insertmacro QTJAMBIECLIPSE_UNFINISH
+FunctionEnd
+
+Function un.onInit
+ call un.SetAdminVar
+ StrCmp "$RUNNING_AS_ADMIN" false 0 common_running_as_admin
+!ifdef USE_ADMIN_CHECK
+ MessageBox MB_OK|MB_ICONSTOP "You do not have the required access rights to uninstall this package."
+ Abort
+!endif
+ SetShellVarContext current
+ goto common_admin_check_done
+ common_running_as_admin:
+ SetShellVarContext all
+ common_admin_check_done:
+
+ ${UnStrRep} $PRODUCT_UNIQUE_KEY "${PRODUCT_NAME} ${PRODUCT_VERSION} - $INSTDIR" "\" "_"
+ strcpy $PRODUCT_UNIQUE_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCT_UNIQUE_KEY"
+
+ push $0
+ ClearErrors
+ ReadRegStr $0 SHCTX "$PRODUCT_UNIQUE_KEY" "DisplayName"
+ IfErrors 0 +3
+ MessageBox MB_OK|MB_ICONSTOP "The uninstaller was unable to find the product to uninstall."
+ Abort
+ pop $0
+
+ ReadRegStr $STARTMENU_STRING SHCTX "$PRODUCT_UNIQUE_KEY" "StartMenu"
+ StrCmp "$STARTMENU_STRING" "" 0 +2
+ StrCpy $STARTMENU_STRING "${DEFAULT_STARTMENU_STRING}"
+
+!ifdef INSTDIR_0 ;the default one, must exist
+ ReadRegStr $${INSTDIR_0}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_0}_INSTDIR"
+!endif
+!ifdef INSTDIR_1
+ ReadRegStr $${INSTDIR_1}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_1}_INSTDIR"
+!endif
+!ifdef INSTDIR_2
+ ReadRegStr $${INSTDIR_2}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_2}_INSTDIR"
+!endif
+!ifdef INSTDIR_3
+ ReadRegStr $${INSTDIR_3}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_3}_INSTDIR"
+!endif
+!ifdef INSTDIR_4
+ ReadRegStr $${INSTDIR_4}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_4}_INSTDIR"
+!endif
+!ifdef INSTDIR_5
+ ReadRegStr $${INSTDIR_5}_INSTDIR SHCTX "$PRODUCT_UNIQUE_KEY" "${INSTDIR_5}_INSTDIR"
+!endif
+
+ !insertmacro LICENSECHECK_UNSTARTUP
+ !insertmacro ENVIRONMENT_UNSTARTUP
+ !insertmacro REGISTERUIEXT_UNSTARTUP
+ !insertmacro MSVC_UNSTARTUP
+ !insertmacro OPENSOURCE_UNSTARTUP
+ !insertmacro EVALUATION_UNSTARTUP
+ !insertmacro ADDIN7X_UNSTARTUP
+ !insertmacro ADDIN60_UNSTARTUP
+ !insertmacro QTJAMBI_UNSTARTUP
+ !insertmacro DEBUGEXT_UNSTARTUP
+ !insertmacro VSIP_UNSTARTUP
+ !insertmacro HELP_UNSTARTUP
+ !insertmacro QSA_UNSTARTUP
+ !insertmacro MINGW_UNSTARTUP
+ !insertmacro ECLIPSE_UNSTARTUP
+ !insertmacro QTJAMBIECLIPSE_UNSTARTUP
+
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${UNINSTALLER_CONFIRM_PAGE}"
+FunctionEnd
+
+!insertmacro HELP_UNINSTALL
+!insertmacro DEBUGEXT_UNINSTALL
+!insertmacro MSVC_UNINSTALL
+!insertmacro OPENSOURCE_UNINSTALL
+!insertmacro EVALUATION_UNINSTALL
+!insertmacro ENVIRONMENT_UNINSTALL
+!insertmacro REGISTERUIEXT_UNINSTALL
+!insertmacro QSA_UNINSTALL
+!insertmacro MINGW_UNINSTALL
+!insertmacro ECLIPSE_UNINSTALL
+!insertmacro QTJAMBIECLIPSE_UNINSTALL
+
+Section Uninstall
+ !insertmacro LICENSECHECK_UNINSTALL
+ !insertmacro ADDIN7X_UNINSTALL
+ !insertmacro ADDIN60_UNINSTALL
+ !insertmacro QTJAMBI_UNINSTALL
+ !insertmacro VSIP_UNINSTALL
+
+ ; COMMON
+ Delete "$INSTDIR\${PRODUCT_NAME}.url"
+ Delete "$INSTDIR\uninst.exe"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}.lnk"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\QtSoftware.com.lnk"
+
+ RMDir "$SMPROGRAMS\$STARTMENU_STRING"
+ RMDir "$INSTDIR"
+
+ DeleteRegKey SHCTX "$PRODUCT_UNIQUE_KEY"
+SectionEnd
+
+Function CommonRunFunction
+ !insertmacro MSVC_RUN_FUNCTION
+ !insertmacro QSA_RUN_FUNCTION
+ !insertmacro MINGW_RUN_FUNCTION
+ DoneRunFunction:
+FunctionEnd
+
+Function CommonReadmeFunction
+ !insertmacro MSVC_README_FUNCTION
+ !insertmacro MINGW_README_FUNCTION
+ DoneReadmeFunction:
+FunctionEnd
+
+Function un.UninstallerConfirmPage
+ !insertmacro MUI_HEADER_TEXT "Confirm" "Confirm Uninstallation Directories"
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${UNINSTALLER_CONFIRM_PAGE}" "Field 2" "Text" "$UninstallerConfirmProduct"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${UNINSTALLER_CONFIRM_PAGE}"
+FunctionEnd
+
+;pops product name from stack and as result pushes TRUE or FALSE on stack
+Function GetExistsPreviousInstallationOfProduct
+ exch $0
+ push $1
+ push $2
+ push $3
+
+ StrCpy $1 0
+ loop:
+ EnumRegKey $2 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall $1
+ StrCmp $2 "" no_reg_key_found
+ ${StrStr} $3 $2 $0
+ StrCmp $3 $2 reg_key_found
+ IntOp $1 $1 + 1
+ goto loop
+
+ reg_key_found:
+ push true
+ goto done
+
+ no_reg_key_found:
+ push false
+
+ done:
+ exch
+ pop $3
+ exch
+ pop $2
+ exch
+ pop $1
+ exch
+ pop $0
+FunctionEnd
+
+;pops product name from stack
+Function WarnIfInstalledProductDetected
+ exch $0
+ push $0
+ call GetExistsPreviousInstallationOfProduct
+ exch $1
+ StrCmp $1 true +1 +3
+ MessageBox MB_YESNO|MB_ICONQUESTION "An existing installation of $0 was detected.$\nIt is recommended to deinstall $0 before continuing.$\nDo you want to continue this installation nevertheless?" IDYES +2 IDNO +1
+ Abort
+ pop $1
+ pop $0
+FunctionEnd
+
+;sets $RUNNING_AS_ADMIN to true if Admin or Power user
+!macro SetAdminVar UN
+Function ${UN}SetAdminVar
+ push $0
+ ClearErrors
+ UserInfo::GetAccountType
+ IfErrors Admin ;It's probably Win95
+ pop $0
+ StrCmp $0 "Admin" Admin
+ StrCmp $0 "Power" Admin
+
+ StrCpy $RUNNING_AS_ADMIN false
+ goto Done
+
+ Admin:
+ StrCpy $RUNNING_AS_ADMIN true
+
+ Done:
+ pop $0
+FunctionEnd
+!macroend
+!insertmacro SetAdminVar ""
+!insertmacro SetAdminVar "un."
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+ !insertmacro MSVC_DESCRIPTION
+ !insertmacro OPENSOURCE_DESCRIPTION
+ !insertmacro ENVIRONMENT_DESCRIPTION
+ !insertmacro REGISTERUIEXT_DESCRIPTION
+ !insertmacro EVALUATION_DESCRIPTION
+ !insertmacro ADDIN7X_DESCRIPTION
+ !insertmacro ADDIN60_DESCRIPTION
+ !insertmacro QTJAMBI_DESCRIPTION
+ !insertmacro DEBUGEXT_DESCRIPTION
+ !insertmacro HELP_DESCRIPTION
+ !insertmacro VSIP_DESCRIPTION
+ !insertmacro QSA_DESCRIPTION
+ !insertmacro MINGW_DESCRIPTION
+ !insertmacro ECLIPSE_DESCRIPTION
+ !insertmacro QTJAMBIECLIPSE_DESCRIPTION
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
diff --git a/util/scripts/win-binary/nsis/instdir.ini b/util/scripts/win-binary/nsis/instdir.ini
new file mode 100644
index 0000000..06b75aa
--- /dev/null
+++ b/util/scripts/win-binary/nsis/instdir.ini
@@ -0,0 +1,102 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=13
+
+[Field 1]
+Type=Groupbox
+Text=Installation Directories
+Left=0
+Right=299
+Top=6
+Bottom=129
+
+[Field 2]
+Type=DirRequest
+Left=132
+Right=290
+Top=91
+Bottom=104
+Flags=READONLY
+
+[Field 3]
+Type=DirRequest
+Left=132
+Right=290
+Top=73
+Bottom=86
+Flags=READONLY
+
+[Field 4]
+Type=Label
+Left=9
+Right=130
+Top=92
+Bottom=100
+
+[Field 5]
+Type=DirRequest
+Left=132
+Right=290
+Top=56
+Bottom=68
+Flags=READONLY
+
+[Field 6]
+Type=Label
+Left=9
+Right=131
+Top=75
+Bottom=83
+
+[Field 7]
+Type=DirRequest
+Left=132
+Right=290
+Top=38
+Bottom=51
+Flags=READONLY
+
+[Field 8]
+Type=Label
+Left=9
+Right=130
+Top=57
+Bottom=65
+
+[Field 9]
+Type=DirRequest
+Left=132
+Right=290
+Top=108
+Bottom=120
+Flags=READONLY
+
+[Field 10]
+Type=DirRequest
+Left=132
+Right=290
+Top=20
+Bottom=33
+Flags=READONLY
+
+[Field 11]
+Type=Label
+Left=9
+Right=131
+Top=40
+Bottom=48
+
+[Field 12]
+Type=Label
+Left=9
+Right=130
+Top=108
+Bottom=116
+
+[Field 13]
+Type=Label
+Left=9
+Right=130
+Top=22
+Bottom=30
+
diff --git a/util/scripts/win-binary/nsis/license.ini b/util/scripts/win-binary/nsis/license.ini
new file mode 100644
index 0000000..7a94ad8
--- /dev/null
+++ b/util/scripts/win-binary/nsis/license.ini
@@ -0,0 +1,70 @@
+[Settings]
+NumFields=8
+
+[Field 1]
+Type=Groupbox
+Text=Qt License Information
+Left=0
+Right=299
+Top=73
+Bottom=123
+
+[Field 2]
+Type=Text
+MaxLen=200
+Left=92
+Right=288
+Top=86
+Bottom=100
+
+[Field 3]
+Type=text
+Left=92
+Right=288
+Top=102
+Bottom=116
+MaxLen=200
+Flags=GROUP
+
+[Field 4]
+Type=Label
+Text=If you do not have a license, please contact:
+Left=2
+Right=156
+Top=128
+Bottom=136
+
+[Field 5]
+Type=label
+Text=Qt License key:
+Left=13
+Right=90
+Top=105
+Bottom=115
+Flags=NOTABSTOP
+
+[Field 6]
+Type=Label
+Text=To install this package you need the licensee name and a valid license key for the Qt/Win platform. The key is case-sensitive.\r\n\r\nThe licensee name and license key can be found in your license file.
+Left=1
+Right=300
+Top=1
+Bottom=46
+
+[Field 7]
+Type=Link
+Text=sales@trolltech.com
+State=mailto:sales@trolltech.com
+Left=160
+Right=237
+Top=128
+Bottom=137
+
+[Field 8]
+Type=Label
+Text=Licensee name:
+Left=13
+Right=88
+Top=88
+Bottom=99
+
diff --git a/util/scripts/win-binary/nsis/licensepage.ini b/util/scripts/win-binary/nsis/licensepage.ini
new file mode 100644
index 0000000..e90a32e
--- /dev/null
+++ b/util/scripts/win-binary/nsis/licensepage.ini
@@ -0,0 +1,48 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=5
+
+[Field 1]
+Type=Text
+Flags=MULTILINE|VSCROLL|READONLY
+Left=4
+Right=296
+Top=14
+Bottom=89
+State=No license agreement file found. Please contact support.
+
+[Field 2]
+Type=Label
+Text=Press Page Down to see the rest of the agreement.
+Left=4
+Right=294
+Top=0
+Bottom=8
+
+[Field 3]
+Type=Label
+Text=If you accept the terms of the agreement, select the first option below. You must accept the agreement to install this software. Click Next to continue.
+Left=4
+Right=297
+Top=92
+Bottom=111
+
+[Field 4]
+Type=RadioButton
+Text=I &accept the terms in the License Agreement
+Flags=GROUP|NOTIFY
+Left=4
+Right=299
+Top=120
+Bottom=129
+
+[Field 5]
+Type=RadioButton
+Text=I &do not accept the terms in the License Agreement
+State=1
+Left=4
+Right=300
+Top=129
+Bottom=140
+Flags=NOTIFY
+
diff --git a/util/scripts/win-binary/nsis/modules/addin60.nsh b/util/scripts/win-binary/nsis/modules/addin60.nsh
new file mode 100644
index 0000000..3a82667
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/addin60.nsh
@@ -0,0 +1,139 @@
+!ifdef MODULE_ADDIN60
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_INITIALIZE
+!ifndef MODULE_ADDIN60_NAME
+ !define MODULE_ADDIN60_NAME "QMsDev Add-In"
+!endif
+!ifndef MODULE_ADDIN60_VERSION
+ !define MODULE_ADDIN60_VERSION ${PRODUCT_VERSION}
+!endif
+!ifndef MODULE_ADDIN60_ROOT
+ !define MODULE_ADDIN60_ROOT "${INSTALL_ROOT}\addin60"
+!endif
+
+!define QMSDEV_GUID "{73036FFA-7B76-47d4-999F-0F9424F7DC12}"
+!include "includes\regsvr.nsh"
+
+!macroend ;ADDIN60_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_SECTIONS
+SectionGroup "${MODULE_ADDIN60_NAME}"
+Section "Visual C++ 6.0" ADDIN60_SEC01
+ SetOutPath "$ADDIN_INSTDIR\6.0"
+ File "${MODULE_ADDIN60_ROOT}\q4msdev.dll"
+
+ call RegisterDevAddin
+
+ SetOutPath "$ADDIN_INSTDIR\6.0"
+ File "${MODULE_ADDIN60_ROOT}\doc\usage.rtf"
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\QMsDev Usage.lnk" "$ADDIN_INSTDIR\6.0\usage.rtf"
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QMsDevInstalled" 1
+SectionEnd
+SectionGroupEnd
+
+Function RegisterDevAddin
+ push $0
+
+ ClearErrors
+ push "$ADDIN_INSTDIR\6.0\q4msdev.dll"
+ call RegSvr
+ IfErrors 0 +3
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Could not register q4msdev.dll"
+ goto done
+
+ WriteRegStr HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "" "0"
+ WriteRegStr HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "Filename" "$ADDIN_INSTDIR\6.0\q4msdev.dll"
+
+ ReadRegStr $0 HKCR "CLSID\${QMSDEV_GUID}" ""
+ WriteRegStr HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "DisplayName" $0
+
+ ReadRegStr $0 HKCR "CLSID\${QMSDEV_GUID}\Description" ""
+ WriteRegStr HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1" "Description" $0
+
+ done:
+ pop $0
+FunctionEnd
+
+Function un.RegisterDevAddin
+ push "$ADDIN_INSTDIR\6.0\q4msdev.dll"
+ call un.RegSvr
+ DeleteRegKey HKCU "SOFTWARE\Microsoft\DevStudio\6.0\AddIns\q4msdev.Q4MsDev.1"
+FunctionEnd
+!macroend ;ADDIN60_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${ADDIN60_SEC01} "This installs the QMsDev Add-in ${MODULE_ADDIN60_VERSION} for Visual Studio 6.0"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_STARTUP
+ push $0
+ SectionSetFlags ${ADDIN60_SEC01} 1
+
+ Call IsQMsDevInstalled
+ pop $0
+ IntCmp $0 0 +3
+ SectionSetFlags ${ADDIN60_SEC01} 16
+ MessageBox MB_OK|MB_ICONEXCLAMATION "The installer has detected that a Qt Add-In for Visual Studio 6.0 is already installed.$\r$\nUninstall the previous version before you reinstall it."
+
+ ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir"
+ strcmp $0 "" 0 +2
+ SectionSetFlags ${ADDIN60_SEC01} 16
+
+ strcpy $ADDIN_INSTDIR "$PROGRAMFILES\Trolltech\QMsAddin"
+
+ pop $0
+!macroend ;ADDIN60_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_UNSTARTUP
+ !insertmacro ConfirmOnRemove "QMsDevInstalled" "QMsDev Add-In"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_UNINSTALL
+ push $0
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "QMsDevInstalled"
+
+ intcmp $0 1 0 DoneUnInstall60
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QMsDevInstalled" 0
+ call un.RegisterDevAddin
+ Delete "$ADDIN_INSTDIR\6.0\q4msdev.dll"
+ Delete "$ADDIN_INSTDIR\6.0\usage.rtf"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\QMsDev Usage.lnk"
+ RmDir "$ADDIN_INSTDIR\6.0"
+ RmDir "$ADDIN_INSTDIR"
+ DoneUnInstall60:
+ pop $0
+!macroend ;ADDIN60_UNINSTALL
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN60_UNFINISH
+!macroend
+
+!else ;MODULE_ADDIN60
+!macro ADDIN60_INITIALIZE
+!macroend
+!macro ADDIN60_SECTIONS
+!macroend
+!macro ADDIN60_DESCRIPTION
+!macroend
+!macro ADDIN60_STARTUP
+!macroend
+!macro ADDIN60_FINISH
+!macroend
+!macro ADDIN60_UNSTARTUP
+!macroend
+!macro ADDIN60_UNINSTALL
+!macroend
+!macro ADDIN60_UNFINISH
+!macroend
+!endif ;MODULE_ADDIN60
+
diff --git a/util/scripts/win-binary/nsis/modules/addin7x.nsh b/util/scripts/win-binary/nsis/modules/addin7x.nsh
new file mode 100644
index 0000000..06016f4
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/addin7x.nsh
@@ -0,0 +1,417 @@
+!ifdef MODULE_ADDIN7X
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_INITIALIZE
+!ifndef MODULE_ADDIN7X_NAME
+ !define MODULE_ADDIN7X_NAME "Qt4 Visual Studio Add-In"
+!endif
+!ifndef MODULE_ADDIN7X_VERSION
+ !define MODULE_ADDIN7X_VERSION ${PRODUCT_VERSION}
+!endif
+!ifndef MODULE_ADDIN7X_ROOT
+ !define MODULE_ADDIN7X_ROOT "${INSTALL_ROOT}\addin7x"
+!endif
+!ifndef MODULE_VSIP_ROOT
+ !error "MODULE_VSIP_ROOT must be in the .conf file..."
+!endif
+
+!include "includes\system.nsh"
+!include "includes\templates.nsh"
+!include "includes\regsvr.nsh"
+!macroend ;ADDIN7X_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_SECTIONS
+
+SectionGroup "${MODULE_ADDIN7X_NAME}"
+
+!ifndef MODULE_ADDIN7X_NO2008
+Section "Visual Studio 2008" ADDIN7X_SEC01
+ strcpy $VS_VERSION "2008"
+ strcpy $VS_VERSION_SHORT "9.0"
+
+ SetOutPath "$ADDIN_INSTDIR\$VS_VERSION_SHORT"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2008\Qt4VSAddin.AddIn"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2008\Qt4VSAddin.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2008\QtProjectLib.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2008\QtProjectEngineLib.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2008\qmakewrapper1Lib.dll"
+ WriteRegStr SHCTX "Software\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders" "$ADDIN_INSTDIR\$VS_VERSION_SHORT" ""
+
+ !insertmacro InstallHelp "$ADDIN_INSTDIR\help" "qt4vs" "$VS_VERSION_SHORT"
+
+ call InstallCommonFiles
+ call RegisterAddin
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2008" 1
+SectionEnd
+!endif
+
+!ifndef MODULE_ADDIN7X_NO2005
+Section "Visual Studio 2005" ADDIN7X_SEC02
+ strcpy $VS_VERSION "2005"
+ strcpy $VS_VERSION_SHORT "8.0"
+
+ SetOutPath "$ADDIN_INSTDIR\$VS_VERSION_SHORT"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\Qt4VSAddin.AddIn"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\Qt4VSAddin.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\QtProjectLib.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\QtProjectEngineLib.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\qmakewrapper1Lib.dll"
+
+ SetOutPath "$ADDIN_INSTDIR\$VS_VERSION_SHORT\en"
+ File "${MODULE_ADDIN7X_ROOT}\src\bin2005\en\Qt4VSAddin.resources.dll"
+
+ WriteRegStr SHCTX "Software\Microsoft\VisualStudio\8.0\AutomationOptions\LookInFolders" "$ADDIN_INSTDIR\$VS_VERSION_SHORT" ""
+
+ !insertmacro InstallHelp "$ADDIN_INSTDIR\help" "qt4vs" "$VS_VERSION_SHORT"
+
+ call InstallCommonFiles
+ call RegisterAddin
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2005" 1
+SectionEnd
+!endif
+
+SectionGroupEnd
+
+Function InstallCommonFiles
+ ; make sure one of the addins is installed
+ IfFileExists "$ADDIN_INSTDIR\8.0\Qt4VSAddin.dll" installCommon
+ IfFileExists "$ADDIN_INSTDIR\9.0\Qt4VSAddin.dll" installCommon done
+
+ installCommon:
+ SetOverwrite ifnewer
+
+ push $ADDIN_INSTDIR
+ call InstallProjectTemplates
+ push $ADDIN_INSTDIR
+ call InstallItemTemplates
+
+ ; Install additional tools and stuff
+ SetOutPath "$ADDIN_INSTDIR"
+ File "${MODULE_ADDIN7X_ROOT}\src\common\qmakewrapper1.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\common\qrceditor.exe"
+ File "${MODULE_ADDIN7X_ROOT}\src\common\QtCore4.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\common\QtGui4.dll"
+ File "${MODULE_ADDIN7X_ROOT}\src\common\QtXml4.dll"
+
+ ; register help
+ IfFileExists "$ADDIN_INSTDIR\help\h2reg.exe" 0 AddinCommonFilesHelp_Done
+ !insertmacro RegisterHelp "$ADDIN_INSTDIR\help" "qt4vs"
+ AddinCommonFilesHelp_Done:
+
+ ; Install VC redistributable
+ Push $0
+ Call IsVS2008RedistInstalled
+ Pop $0
+ ${If} $0 == 0
+ SetOutPath "$ADDIN_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\redist\vcredist_x86.exe"
+ ExecWait '"$ADDIN_INSTDIR\vcredist_x86.exe" /q' $0
+ Delete "$ADDIN_INSTDIR\vcredist_x86.exe"
+ ${EndIf}
+ Pop $0
+
+ SetOverwrite off ;ifnewer
+ done:
+FunctionEnd
+
+Function RegisterAddin
+ push $2
+ push $3
+
+ push "$VS_VERSION_SHORT"
+ call IsDotNETInstalled
+ Pop $3
+ strcpy $2 "$3\regasm.exe"
+
+ ClearErrors
+ push "$ADDIN_INSTDIR\qmakewrapper1.dll"
+ call RegSvr
+ IfErrors 0 Module_Addin_RegisterWizards
+ MessageBox MB_OK "Can not register qmakewrapper1.dll!"
+
+ Module_Addin_RegisterWizards:
+ ClearErrors
+ DetailPrint "Registering the Qt Wizard Engine."
+ nsExec::ExecToLog '"$2" /codebase "$ADDIN_INSTDIR\$VS_VERSION_SHORT\QtProjectEngineLib.dll"'
+ pop $3
+ strcmp "$3" "error" 0 RegEngineDone
+ MessageBox MB_OK "Can not register QtProjectEngineLib.dll!"
+ MessageBox MB_OK '"$2" /codebase "$ADDIN_INSTDIR\$VS_VERSION_SHORT\QtProjectEngineLib.dll"'
+ RegEngineDone:
+
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "" "Qt4 Projects"
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "SortPriority" 16
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "TemplatesDir" "$ADDIN_INSTDIR\projects\$VS_VERSION_SHORT"
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/2" "SortPriority" 16
+
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "" "Qt Forms"
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "TemplatesDir" "$ADDIN_INSTDIR\uiItems"
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "SortPriority" 16
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/2" "" "Qt Resources"
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/2" "TemplatesDir" "$ADDIN_INSTDIR\qrcItems"
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/2" "SortPriority" 16
+
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "" "Qt4 Classes"
+ WriteRegStr SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "TemplatesDir" "$ADDIN_INSTDIR\wizards\$VS_VERSION_SHORT"
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/1" "SortPriority" 16
+ WriteRegDWORD SHCTX "SOFTWARE\Microsoft\VisualStudio\$VS_VERSION_SHORT\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}\/2" "SortPriority" 16
+
+ Done:
+
+ pop $3
+ pop $2
+FunctionEnd
+
+Function un.RegisterAddin
+ push $2
+ push $3
+
+ push "$VS_VERSION_SHORT"
+ call un.IsDotNETInstalled
+ Pop $3
+ strcpy $2 "$3\regasm.exe"
+
+ ClearErrors
+ IfFileExists "$ADDIN_INSTDIR\$VS_VERSION_SHORT\QtProjectEngineLib.dll" 0 UnRegEngineDone
+ nsExec::ExecToLog '"$2" /unregister "$ADDIN_INSTDIR\$VS_VERSION_SHORT\QtProjectEngineLib.dll"'
+ pop $3
+ strcmp "$3" "error" 0 UnRegEngineDone
+ MessageBox MB_OK "Can not unregister QtProjectEngineLib.dll!"
+ UnRegEngineDone:
+
+ pop $3
+ pop $2
+FunctionEnd
+
+Function GetVSVersion
+ push $0
+
+ ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0\Setup\VS" "ProductDir"
+ StrCmp $0 "" 0 foundVS2008 ; found msvc.net 2008
+
+ ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0\Setup\VS" "ProductDir"
+ StrCmp $0 "" 0 foundVS2005 ; found msvc.net 2005
+
+ push "" ;empty string if not found
+ goto done
+
+ foundVS2008:
+ push "2008"
+ goto done
+
+ foundVS2005:
+ push "2005"
+ goto done
+
+ done:
+ exch
+ pop $0
+FunctionEnd
+!macroend ;ADDIN7X_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_DESCRIPTION
+!ifdef ADDIN7X_SEC01
+ !insertmacro MUI_DESCRIPTION_TEXT ${ADDIN7X_SEC01} "This installs the Qt4 Add-in ${MODULE_ADDIN7X_VERSION} for Visual Studio 2008"
+!endif
+!ifdef ADDIN7X_SEC02
+ !insertmacro MUI_DESCRIPTION_TEXT ${ADDIN7X_SEC02} "This installs the Qt4 Add-in ${MODULE_ADDIN7X_VERSION} for Visual Studio 2005"
+!endif
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_STARTUP
+ push $0
+ push $1
+
+!ifdef ADDIN7X_SEC01
+ SectionSetFlags ${ADDIN7X_SEC01} 0
+!endif
+!ifdef ADDIN7X_SEC02
+ SectionSetFlags ${ADDIN7X_SEC02} 0
+!endif
+
+!ifdef ADDIN7X_SEC02
+ ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\8.0" "InstallDir"
+ strcmp $0 "" +3
+ SectionSetFlags ${ADDIN7X_SEC02} 1
+ goto +2
+ SectionSetFlags ${ADDIN7X_SEC02} 16
+!endif
+
+!ifdef ADDIN7X_SEC01
+ ReadRegStr $0 HKLM "Software\Microsoft\VisualStudio\9.0" "InstallDir"
+ strcmp $0 "" +3
+ SectionSetFlags ${ADDIN7X_SEC01} 1
+ goto +2
+ SectionSetFlags ${ADDIN7X_SEC01} 16
+!endif
+
+ strcpy $ADDIN_INSTDIR "$PROGRAMFILES\Nokia\Qt4VSAddin"
+
+ Push "8.0"
+ Call IsIntegrationInstalled
+ Pop $0
+ IntCmp $0 1 Addin7x_Warn
+
+ Push "9.0"
+ Call IsIntegrationInstalled
+ Pop $0
+ IntCmp $0 1 Addin7x_Warn
+
+ Goto Addin7x_Done
+ Addin7x_Warn:
+ MessageBox MB_OK|MB_ICONEXCLAMATION "The installer has detected that a version of the Qt Visual Studio Integration is installed.$\r$\nThe Add-In's conflict with the integration."
+ Addin7x_Done:
+
+ StrCpy $1 ""
+ Push "8.0"
+ Call IsQMsNetInstalled
+ Pop $0
+ IntCmp $0 0 +2
+ StrCpy $1 "$1$\r$\n - Visual Studio 2005"
+
+ Push "9.0"
+ Call IsQMsNetInstalled
+ Pop $0
+ IntCmp $0 0 +2
+ StrCpy $1 "$1$\r$\n - Visual Studio 2008"
+
+ StrCpy $1 ""
+ Push "8.0"
+ Call IsQt4VSAddinInstalled
+ Pop $0
+ IntCmp $0 0 +2
+ StrCpy $1 "$1$\r$\n - Visual Studio 2005"
+
+ Push "9.0"
+ Call IsQt4VSAddinInstalled
+ Pop $0
+ IntCmp $0 0 +2
+ StrCpy $1 "$1$\r$\n - Visual Studio 2008"
+
+ StrCmp $1 "" +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION "The installer has detected that the following versions of the Add-In are already installed:$1$\r$\nUninstall the previous versions before you reinstall them."
+
+ pop $1
+ pop $0
+!macroend ;ADDIN7X_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_FINISH
+!macroend
+
+!macro ADDIN7X_UNSTARTUP
+ !insertmacro ConfirmOnRemove "Qt4VSAddin2008" "$ADDIN_INSTDIR"
+ !insertmacro ConfirmOnRemove "Qt4VSAddin2005" "$ADDIN_INSTDIR"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ADDIN7X_UNINSTALL
+ push $0
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2008"
+ intcmp $0 1 0 DoneUnInstall2008
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2008" 0
+ strcpy $VS_VERSION "2008"
+ strcpy $VS_VERSION_SHORT "9.0"
+ call un.RegisterAddin
+ Delete "$ADDIN_INSTDIR\9.0\Qt4VSAddin.AddIn"
+ Delete "$ADDIN_INSTDIR\9.0\Qt4VSAddin.dll"
+ Delete "$ADDIN_INSTDIR\9.0\QtProjectLib.dll"
+ Delete "$ADDIN_INSTDIR\9.0\QtProjectEngineLib.dll"
+ Delete "$ADDIN_INSTDIR\9.0\qmakewrapper1Lib.dll"
+ RmDir "$ADDIN_INSTDIR\9.0"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\9.0\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegValue SHCTX "Software\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders" "$ADDIN_INSTDIR\9.0"
+ !insertmacro un.InstallHelpInVS "qt4vs" "$VS_VERSION_SHORT"
+
+ push "$ADDIN_INSTDIR"
+ call un.InstallProjectTemplates
+ strcpy $WizardInstDir "$ADDIN_INSTDIR\wizards"
+ RmDir "$ProjectInstDir"
+ DoneUnInstall2008:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2005"
+ intcmp $0 1 0 DoneUnInstall2005
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VSAddin2005" 0
+ strcpy $VS_VERSION "2005"
+ strcpy $VS_VERSION_SHORT "8.0"
+ call un.RegisterAddin
+ Delete "$ADDIN_INSTDIR\8.0\en\Qt4VSAddin.resources.dll"
+ RmDir "$ADDIN_INSTDIR\8.0\en"
+ Delete "$ADDIN_INSTDIR\8.0\Qt4VSAddin.AddIn"
+ Delete "$ADDIN_INSTDIR\8.0\Qt4VSAddin.dll"
+ Delete "$ADDIN_INSTDIR\8.0\QtProjectLib.dll"
+ Delete "$ADDIN_INSTDIR\8.0\QtProjectEngineLib.dll"
+ Delete "$ADDIN_INSTDIR\8.0\qmakewrapper1Lib.dll"
+ RmDir "$ADDIN_INSTDIR\8.0"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\8.0\NewProjectTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\8.0\Projects\{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegKey SHCTX "SOFTWARE\Microsoft\VisualStudio\8.0\Projects\{8BC9CEBA-8B4A-11D0-8D11-00A0C91BC942}\AddItemTemplates\TemplateDirs\${QT4VSADDIN_GUID}"
+ DeleteRegValue SHCTX "Software\Microsoft\VisualStudio\8.0\AutomationOptions\LookInFolders" "$ADDIN_INSTDIR\8.0"
+ !insertmacro un.InstallHelpInVS "qt4vs" "$VS_VERSION_SHORT"
+
+ push "$ADDIN_INSTDIR"
+ call un.InstallProjectTemplates
+ strcpy $WizardInstDir "$ADDIN_INSTDIR\wizards"
+ RmDir "$ProjectInstDir"
+ DoneUnInstall2005:
+
+ strcmp $VS_VERSION "2005" DoUninstallAddinCommon
+ strcmp $VS_VERSION "2008" DoUninstallAddinCommon DoneUninstallAddinCommon
+
+ DoUninstallAddinCommon:
+
+ IfFileExists "$ADDIN_INSTDIR\help\h2reg.exe" 0 DoneUninstallAddinHelp
+ !insertmacro un.RegisterHelp "$ADDIN_INSTDIR\help" "qt4vs"
+ !insertmacro un.InstallHelp "$ADDIN_INSTDIR\help" "qt4vs" "0.0"
+ Push "$ADDIN_INSTDIR\help"
+ Call un.DeleteH2RegFiles
+ DoneUninstallAddinHelp:
+
+ Delete "$ADDIN_INSTDIR\qmakewrapper1.dll"
+ Delete "$ADDIN_INSTDIR\qrceditor.exe"
+ Delete "$ADDIN_INSTDIR\QtCore4.dll"
+ Delete "$ADDIN_INSTDIR\QtGui4.dll"
+ Delete "$ADDIN_INSTDIR\QtXml4.dll"
+
+ RmDir "$ADDIN_INSTDIR\projects"
+ RmDir "$ADDIN_INSTDIR\wizards"
+
+ Delete "$ADDIN_INSTDIR\uiItems\Qt4Files.vsdir"
+ push $ADDIN_INSTDIR
+ call un.InstallItemTemplates
+
+ RmDir "$ADDIN_INSTDIR"
+
+ DoneUninstallAddinCommon:
+ pop $0
+!macroend ;ADDIN7X_UNINSTALL
+
+!macro ADDIN7X_UNFINISH
+!macroend
+
+!else ;MODULE_ADDIN7X
+!macro ADDIN7X_INITIALIZE
+!macroend
+!macro ADDIN7X_SECTIONS
+!macroend
+!macro ADDIN7X_DESCRIPTION
+!macroend
+!macro ADDIN7X_STARTUP
+!macroend
+!macro ADDIN7X_FINISH
+!macroend
+!macro ADDIN7X_UNSTARTUP
+!macroend
+!macro ADDIN7X_UNINSTALL
+!macroend
+!macro ADDIN7X_UNFINISH
+!macroend
+!endif ;MODULE_ADDIN7X
+
diff --git a/util/scripts/win-binary/nsis/modules/debugext.nsh b/util/scripts/win-binary/nsis/modules/debugext.nsh
new file mode 100644
index 0000000..e1ad199
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/debugext.nsh
@@ -0,0 +1,669 @@
+!ifdef MODULE_DEBUGEXT
+
+var DEBUGEXT_INITIALIZED
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_INITIALIZE
+!ifndef MODULE_DEBUGEXT_INSTALLER
+ !define MODULE_DEBUGEXT_INSTALLER "${PRODUCT_NAME} v${PRODUCT_VERSION}"
+!endif
+!ifndef MODULE_DEBUGEXT_ROOT
+ !define MODULE_DEBUGEXT_ROOT "${INSTALL_ROOT}\debugext"
+!endif
+!macroend ;DEBUGEXT_INITIALIZE
+
+
+;------------------------------------------------------------------------------------------------
+!macro CleanAutoExp UN
+Function ${UN}CleanAutoExp
+ exch $1 ;filename autoexp
+ exch
+ exch $0 ;version
+ push $3 ;readline
+ push $4 ;handle autoexp
+ push $5 ;tmpfile handle
+ push $6 ;tmp copy of autoexp.dat
+ push $7
+
+ ClearErrors
+ IfErrors done
+
+ StrCpy $6 "$1_tmp"
+ CopyFiles /FILESONLY "$1" "$6"
+
+ FileOpen $5 $1 w
+ IfErrors done
+
+ FileOpen $4 $6 r
+ IfErrors done
+
+nextline:
+ FileRead $4 $3
+ IfErrors renameFile
+
+ strcmp $0 "" 0 +4
+ strcpy $7 $3 15
+ strcmp $7 ";QT_DEBUG_START" nowrite
+ goto +3
+ strcmp $3 ";QT_DEBUG_START ($0)$\n" nowrite
+ strcmp $3 ";QT_DEBUG_START ($0)$\r$\n" nowrite
+
+ strcpy $7 $3 14 ;qt3 (always remove qt3 stuff)
+ strcmp $7 "; Trolltech Qt" nowrite write
+ nowrite:
+ FileRead $4 $3
+ IfErrors renameFile
+ strcpy $7 $3 13
+ strcmp $7 ";QT_DEBUG_END" nextline
+ strcpy $7 $3 14 ;qt3
+ strcmp $7 "QObject =class" nextline nowrite
+ write:
+ FileWrite $5 $3
+ goto nextline
+
+renameFile:
+ FileClose $5
+ FileClose $4
+ SetDetailsPrint none
+ Delete $6
+ SetDetailsPrint both
+
+done:
+ pop $7
+ pop $6
+ pop $5
+ pop $4
+ pop $3
+ pop $0
+ pop $1
+FunctionEnd
+!macroend ;CleanAutoExp
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_SECTIONS
+
+Section -PreDebugExtSection
+ StrCpy $DEBUGEXT_INITIALIZED "0"
+
+ SetOutPath $TEMP
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat_entries.txt"
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat-autoexpand2003"
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat-autoexpand2005"
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat-autoexpand2008"
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat-visualizer2005"
+ File "${MODULE_DEBUGEXT_ROOT}\autoexp.dat-visualizer2008"
+SectionEnd
+
+SectionGroup "Debugger Extension"
+
+!ifndef MODULE_DEBUGEXT_NOVS2008
+Section "Visual Studio 2008" DEBUGEXT_SEC01
+ push $0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\9.0" "InstallDir"
+ strcmp $0 "" done90
+ push "$0..\Packages\Debugger\"
+ push "2008"
+ call DoUpdateDatFile
+ push "$0usertype.dat"
+ call UpdateUserType
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2008DebugExtInstalled" 1
+ StrCpy $DEBUGEXT_INITIALIZED "1"
+ done90:
+
+ pop $0
+SectionEnd
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2005
+Section "Visual Studio 2005" DEBUGEXT_SEC02
+ push $0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\8.0" "InstallDir"
+ strcmp $0 "" done80
+ push "$0..\Packages\Debugger\"
+ push "2005"
+ call DoUpdateDatFile
+ push "$0usertype.dat"
+ call UpdateUserType
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2005DebugExtInstalled" 1
+ StrCpy $DEBUGEXT_INITIALIZED "1"
+ done80:
+
+ pop $0
+SectionEnd
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2003
+Section "Visual Studio 2003" DEBUGEXT_SEC03
+ push $0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.1" "InstallDir"
+ strcmp $0 "" done71
+ push "$0..\Packages\Debugger\"
+ push "2003"
+ call DoUpdateDatFile
+ push "$0usertype.dat"
+ call UpdateUserType
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2003DebugExtInstalled" 1
+ StrCpy $DEBUGEXT_INITIALIZED "1"
+ done71:
+
+ pop $0
+SectionEnd
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2002
+Section "Visual Studio 2002" DEBUGEXT_SEC04
+ push $0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.0" "InstallDir"
+ strcmp $0 "" done70
+ push "$0..\Packages\Debugger\"
+ push "2002"
+ call DoUpdateDatFile
+ push "$0usertype.dat"
+ call UpdateUserType
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2002DebugExtInstalled" 1
+ StrCpy $DEBUGEXT_INITIALIZED "1"
+ done70:
+
+ pop $0
+SectionEnd
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVC60
+Section "Visual C++ 6.0" DEBUGEXT_SEC05
+ push $0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir"
+ strcmp $0 "" done60
+ push "$0\MsDev98\bin\"
+ push "6.0"
+ call DoUpdateDatFile
+ push "$0\MsDev98\bin\usertype.dat"
+ call UpdateUserType
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VC60DebugExtInstalled" 1
+ StrCpy $DEBUGEXT_INITIALIZED "1"
+ done60:
+
+ pop $0
+SectionEnd
+!endif
+
+SectionGroupEnd
+
+Section -PostDebugExtSection
+ Delete "$TEMP\autoexp.dat_entries.txt"
+ Delete "$TEMP\autoexp.dat-autoexpand2003"
+ Delete "$TEMP\autoexp.dat-autoexpand2005"
+ Delete "$TEMP\autoexp.dat-autoexpand2008"
+ Delete "$TEMP\autoexp.dat-visualizer2005"
+ Delete "$TEMP\autoexp.dat-visualizer2008"
+
+# IntCmp $DEBUGEXT_INITIALIZED 0 nodebugext
+
+# SetOutPath "$INSTDIR\debugext"
+# File "${MODULE_DEBUGEXT_ROOT}\doc\usage.rtf"
+# !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\Debugger Extension Readme.lnk" "$INSTDIR\debugext\usage.rtf"
+
+ nodebugext:
+SectionEnd
+
+Function DoUpdateDatFile
+ exch $0 ; vs version
+ exch
+ exch $1 ;dir
+ push $2
+
+ strcpy $2 "$1\autoexp.dat"
+
+ push $2
+ call BackupFile
+
+
+ push "" ;remove all qt related stuff
+ push $2
+ call CleanAutoExp
+
+ push "[AutoExpand]"
+ push $2
+ ${If} $0 == "6.0"
+ ${OrIf} $0 == "2002"
+ push "$TEMP\autoexp.dat_entries.txt"
+ ${Else}
+ push "$TEMP\autoexp.dat-autoexpand$0"
+ ${EndIf}
+ call InsertAutoExp
+
+ ${If} $0 == "2005"
+ ${OrIf} $0 == "2008"
+ push "[Visualizer]"
+ push $2
+ push "$TEMP\autoexp.dat-visualizer$0"
+ call InsertAutoExp
+ ${EndIf}
+
+ pop $2
+ pop $1
+ pop $0
+FunctionEnd
+
+Function UpdateUserType
+ exch $0 ;usertype filename
+ push $1
+
+ push $0
+ call BackupFile
+
+ ClearErrors
+ FileOpen $1 $0 a
+ IfErrors done
+
+ push "Q_OBJECT"
+ push $1
+ call AddUserType
+ push "Q_ENUMS"
+ push $1
+ call AddUserType
+ push "Q_FLAGS"
+ push $1
+ call AddUserType
+ push "Q_INTERFACES"
+ push $1
+ call AddUserType
+ push "Q_PROPERTY"
+ push $1
+ call AddUserType
+ push "Q_SETS"
+ push $1
+ call AddUserType
+ push "Q_CLASSINFO"
+ push $1
+ call AddUserType
+ push "emit"
+ push $1
+ call AddUserType
+ push "SIGNAL"
+ push $1
+ call AddUserType
+ push "SLOT"
+ push $1
+ call AddUserType
+ push "signals:"
+ push $1
+ call AddUserType
+ push "slots:"
+ push $1
+ call AddUserType
+ push "qobject_cast"
+ push $1
+ call AddUserType
+ push "qvariant_cast"
+ push $1
+ call AddUserType
+
+done:
+ FileClose $1
+
+ pop $1
+ pop $0
+FunctionEnd
+
+Function AddUserType
+ exch $0 ;file handle
+ exch
+ exch $1 ;value
+ push $2
+
+ FileSeek $0 0 ;beginning
+
+scann:
+ FileRead $0 $2
+ IfErrors insert
+ strcmp "$2" "$1" done
+ strcmp "$2" "$1$\r" done
+ strcmp "$2" "$1$\n" done
+ strcmp "$2" "$1$\r$\n" done
+ goto scann
+
+insert:
+ FileSeek $0 -2 CUR ;previous char
+ ClearErrors
+ FileRead $0 $2 2
+ IfErrors +3
+ strcmp $2 "$\r$\n" +2
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "$1$\r$\n"
+
+done:
+ pop $2
+ pop $1
+ pop $0
+FunctionEnd
+
+Function BackupFile
+ exch $0
+ push $1
+ push $2
+
+ IfFileExists $0 0 done
+
+ ; remove extension
+ strlen $1 $0
+ intop $1 $1 - 3
+ strcpy $2 $0 $1
+
+ IfFileExists "$2qto" writeqte writeqto
+
+ writeqto:
+ copyfiles /FILESONLY "$0" "$2qto"
+ goto done
+
+ writeqte:
+ SetDetailsPrint none
+ IfFileExists "$2qte" 0 +2
+ Delete "$2qte"
+ SetDetailsPrint both
+ copyfiles /FILESONLY "$0" "$2qte"
+
+ done:
+ pop $2
+ pop $1
+ pop $0
+FunctionEnd
+
+Function InsertAutoExp
+ exch $0 ;filename qtrules
+ exch
+ exch $1 ;filename autoexp
+ exch
+ exch 2
+ exch $8 ; section name in autoexp file "[AutoExpand]"
+ exch 2
+ push $2 ;handle qtrules
+ push $3 ;readline
+ push $4 ;handle autoexp
+ push $5 ;tmpfile handle
+ push $6 ;tmp copy of autoexp.dat
+ push $7
+
+ ClearErrors
+ IfErrors done
+
+ StrCpy $6 "$1_tmp"
+ CopyFiles /FILESONLY "$1" "$6"
+
+ FileOpen $5 $1 a
+ IfErrors done
+
+ FileOpen $4 $6 r
+ IfErrors done
+
+ FileOpen $2 $0 r
+ IfErrors done
+
+nextline:
+ FileRead $4 $3
+ IfErrors insertloop
+
+ strcpy $7 $3 12
+ strcmp $7 $8 insert copyline
+ copyline:
+ FileWrite $5 $3
+ goto nextline
+
+ insert:
+ FileWrite $5 $3
+ insertloop:
+ FileRead $2 $3
+ IfErrors copyrest
+ strcpy $7 $3 15
+ strcmp $7 ";QT_DEBUG_START" 0 +2
+ strcpy $3 "$7 (${MODULE_DEBUGEXT_INSTALLER})$\r$\n"
+ FileWrite $5 $3
+ goto insertloop
+
+ copyrest:
+ FileRead $4 $3
+ IfErrors renameFile
+ FileWrite $5 $3
+ goto copyrest
+
+renameFile:
+ FileClose $5
+ FileClose $4
+ FileClose $2
+ SetDetailsPrint none
+ Delete $6
+ SetDetailsPrint both
+
+done:
+ pop $7
+ pop $6
+ pop $5
+ pop $4
+ pop $3
+ pop $2
+ pop $0
+ pop $1
+ pop $8
+FunctionEnd
+
+!insertmacro CleanAutoExp ""
+!insertmacro CleanAutoExp "un."
+!macroend ;DEBUGEXT_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_DESCRIPTION
+!ifndef MODULE_DEBUGEXT_NOVS2008
+ !insertmacro MUI_DESCRIPTION_TEXT ${DEBUGEXT_SEC01} "This installs Qt 4 debug extensions. This makes it easier to debug Qt objects in Visual Studio (Overwrites Qt 3 debug extensions)."
+!endif
+!ifndef MODULE_DEBUGEXT_NOVS2005
+ !insertmacro MUI_DESCRIPTION_TEXT ${DEBUGEXT_SEC02} "This installs Qt 4 debug extensions. This makes it easier to debug Qt objects in Visual Studio (Overwrites Qt 3 debug extensions)."
+!endif
+!ifndef MODULE_DEBUGEXT_NOVS2003
+ !insertmacro MUI_DESCRIPTION_TEXT ${DEBUGEXT_SEC03} "This installs Qt 4 debug extensions. This makes it easier to debug Qt objects in Visual Studio (Overwrites Qt 3 debug extensions)."
+!endif
+!ifndef MODULE_DEBUGEXT_NOVS2002
+ !insertmacro MUI_DESCRIPTION_TEXT ${DEBUGEXT_SEC04} "This installs Qt 4 debug extensions. This makes it easier to debug Qt objects in Visual Studio (Overwrites Qt 3 debug extensions)."
+!endif
+!ifndef MODULE_DEBUGEXT_NOVC60
+ !insertmacro MUI_DESCRIPTION_TEXT ${DEBUGEXT_SEC05} "This installs Qt 4 debug extensions. This makes it easier to debug Qt objects in Visual Studio (Overwrites Qt 3 debug extensions)."
+!endif
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_STARTUP
+ push $0
+ push $1
+ push $3
+
+!ifndef MODULE_DEBUGEXT_NOVS2008
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\9.0" "InstallDir"
+ strcmp $0 "" debugext_startup_not90
+ strcpy $1 "$0..\Packages\Debugger\autoexp.dat"
+ ClearErrors
+ FileOpen $3 $1 a
+ IfErrors debugext_startup_not90
+ FileClose $3
+
+ Goto debugext_startup_done90
+ debugext_startup_not90:
+ SectionSetFlags ${DEBUGEXT_SEC01} "16"
+ debugext_startup_done90:
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2005
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\8.0" "InstallDir"
+ strcmp $0 "" debugext_startup_not80
+ strcpy $1 "$0..\Packages\Debugger\autoexp.dat"
+ ClearErrors
+ FileOpen $3 $1 a
+ IfErrors debugext_startup_not80
+ FileClose $3
+
+ Goto debugext_startup_done80
+ debugext_startup_not80:
+ SectionSetFlags ${DEBUGEXT_SEC02} "16"
+ debugext_startup_done80:
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2003
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.1" "InstallDir"
+ strcmp $0 "" debugext_startup_not71
+ strcpy $1 "$0..\Packages\Debugger\autoexp.dat"
+ ClearErrors
+ FileOpen $3 $1 a
+ IfErrors debugext_startup_not71
+ FileClose $3
+
+ Goto debugext_startup_done71
+ debugext_startup_not71:
+ SectionSetFlags ${DEBUGEXT_SEC03} "16"
+ debugext_startup_done71:
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVS2002
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.0" "InstallDir"
+ strcmp $0 "" debugext_startup_not70
+ strcpy $1 "$0..\Packages\Debugger\autoexp.dat"
+ ClearErrors
+ FileOpen $3 $1 a
+ IfErrors debugext_startup_not70
+ FileClose $3
+
+ Goto debugext_startup_done70
+ debugext_startup_not70:
+ SectionSetFlags ${DEBUGEXT_SEC04} "16"
+ debugext_startup_done70:
+!endif
+
+!ifndef MODULE_DEBUGEXT_NOVC60
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir"
+ strcmp $0 "" debugext_startup_not60
+ strcpy $1 "$0\MsDev98\bin\autoexp.dat"
+ ClearErrors
+ FileOpen $3 $1 a
+ IfErrors debugext_startup_not60
+ FileClose $3
+
+ Goto debugext_startup_done60
+ debugext_startup_not60:
+ SectionSetFlags ${DEBUGEXT_SEC05} "16"
+ debugext_startup_done60:
+!endif
+
+ pop $3
+ pop $1
+ pop $0
+!macroend ;DEBUGEXT_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_UNSTARTUP
+ !insertmacro ConfirmOnRemove "VS2008DebugExtInstalled" "Qt Debugger Extension (VS2008)"
+ !insertmacro ConfirmOnRemove "VS2005DebugExtInstalled" "Qt Debugger Extension (VS2005)"
+ !insertmacro ConfirmOnRemove "VS2003DebugExtInstalled" "Qt Debugger Extension (VS2003)"
+ !insertmacro ConfirmOnRemove "VS2002DebugExtInstalled" "Qt Debugger Extension (VS2002)"
+ !insertmacro ConfirmOnRemove "VC60DebugExtInstalled" "Qt Debugger Extension (VC60)"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_UNINSTALL
+Section un."Debugger Extension"
+ push $0
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "VS2008DebugExtInstalled"
+ intcmp $0 1 0 done90
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2008DebugExtInstalled" 0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\9.0" "InstallDir"
+ strcmp $0 "" done90
+ push "$0..\Packages\Debugger\"
+ call un.DoCleanDatFile
+ done90:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "VS2005DebugExtInstalled"
+ intcmp $0 1 0 done80
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2005DebugExtInstalled" 0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\8.0" "InstallDir"
+ strcmp $0 "" done80
+ push "$0..\Packages\Debugger\"
+ call un.DoCleanDatFile
+ done80:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "VS2003DebugExtInstalled"
+ intcmp $0 1 0 done71
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2003DebugExtInstalled" 0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.1" "InstallDir"
+ strcmp $0 "" done71
+ push "$0..\Packages\Debugger\"
+ call un.DoCleanDatFile
+ done71:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "VS2002DebugExtInstalled"
+ intcmp $0 1 0 done70
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VS2002DebugExtInstalled" 0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\7.0" "InstallDir"
+ strcmp $0 "" done70
+ push "$0..\Packages\Debugger\"
+ call un.DoCleanDatFile
+ done70:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "VC60DebugExtInstalled"
+ intcmp $0 1 0 done60
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "VC60DebugExtInstalled" 0
+
+ ReadRegStr $0 SHCTX "Software\Microsoft\VisualStudio\6.0\Setup" "VsCommonDir"
+ strcmp $0 "" done60
+ push "$0\MsDev98\bin\"
+ call un.DoCleanDatFile
+ done60:
+
+# Delete "$INSTDIR\debugext\usage.rtf"
+# RmDir "$INSTDIR\debugext"
+# Delete "$SMPROGRAMS\$STARTMENU_STRING\Debugger Extension Readme.lnk"
+
+ pop $0
+SectionEnd
+
+Function un.DoCleanDatFile
+ exch $0 ;dir
+ push "${MODULE_DEBUGEXT_INSTALLER}"
+ push "$0autoexp.dat"
+ call un.CleanAutoExp
+ pop $0
+FunctionEnd
+
+!macroend ;DEBUGEXT_UNINSTALL
+
+;------------------------------------------------------------------------------------------------
+!macro DEBUGEXT_UNFINISH
+!macroend
+
+!else ;MODULE_DEBUGEXT
+!macro DEBUGEXT_INITIALIZE
+!macroend
+!macro DEBUGEXT_SECTIONS
+!macroend
+!macro DEBUGEXT_DESCRIPTION
+!macroend
+!macro DEBUGEXT_STARTUP
+!macroend
+!macro DEBUGEXT_FINISH
+!macroend
+!macro DEBUGEXT_UNSTARTUP
+!macroend
+!macro DEBUGEXT_UNINSTALL
+!macroend
+!macro DEBUGEXT_UNFINISH
+!macroend
+!endif ;MODULE_DEBUGEXT
+
diff --git a/util/scripts/win-binary/nsis/modules/eclipse.nsh b/util/scripts/win-binary/nsis/modules/eclipse.nsh
new file mode 100644
index 0000000..8a826ab
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/eclipse.nsh
@@ -0,0 +1,398 @@
+!ifdef MODULE_ECLIPSE
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_INITIALIZE
+
+!define ECLIPSE_LOCATION_KEY "EclipseLocation"
+var ECLIPSE_LOCATION
+var ECLIPSE_MINGW_LOCATION
+
+!ifndef MODULE_ECLIPSE_INSTALLER
+ !define MODULE_ECLIPSE_INSTALLER "${PRODUCT_NAME} v${PRODUCT_VERSION}"
+!endif
+!ifndef MODULE_ECLIPSE_ROOT
+ !define MODULE_ECLIPSE_ROOT "${INSTALL_ROOT}\eclipse"
+!endif
+!ifndef MODULE_ECLIPSE_VERSION
+ !define MODULE_ECLIPSE_VERSION ${PRODUCT_VERSION}
+!endif
+
+!define MODULE_ECLIPSE_QT_PREFIX "qtcpp"
+
+!define MODULE_ECLIPSE_QT_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}_${MODULE_ECLIPSE_VERSION}"
+
+!define MODULE_ECLIPSE_QTFEATURE_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}.feature_${MODULE_ECLIPSE_VERSION}"
+
+!define MODULE_ECLIPSE_QTPROJECT_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}project_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTPROJECT_LABEL "Qt Project Integration"
+!define MODULE_ECLIPSE_QTPROJECT_INSTALLEDKEY "EclipseQtProjectInstalled"
+!define MODULE_ECLIPSE_QTPROJECT_WIN32X86_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}project.win32.x86_${MODULE_ECLIPSE_VERSION}"
+
+!define MODULE_ECLIPSE_QTDESIGNER_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}designer_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTDESIGNER_LABEL "Qt Designer Integration"
+!define MODULE_ECLIPSE_QTDESIGNER_INSTALLEDKEY "EclipseQtDesignerInstalled"
+!define MODULE_ECLIPSE_QTDESIGNER_WIN32X86_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}designer.win32.x86_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTDESIGNER_QT_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}designer.${MODULE_ECLIPSE_QT_PREFIX}_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}designerplugins.win32.x86_${MODULE_ECLIPSE_VERSION}"
+
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_ID "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}integrationhelp_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_LABEL "Qt Integration Help"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_INSTALLEDKEY "EclipseQtIntegrationHelpInstalled"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSUBFOLDER "com.trolltech.${MODULE_ECLIPSE_QT_PREFIX}integrationhelp.examples_${MODULE_ECLIPSE_VERSION}"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSOURCE "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSUBFOLDER}"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSUBFOLDER}"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSOURCE}\AddressBook"
+!define MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET}\AddressBook"
+
+!define MODULE_ECLIPSE_MSRT_VERSION "71"
+
+LangString ModuleEclipsePageTitle ${LANG_ENGLISH} "Eclipse Installation Location"
+LangString ModuleEclipsePageDescription ${LANG_ENGLISH} "Select where eclipse is installed, and where MinGW is located."
+
+!define MODULE_ECLIPSE_PAGE "eclipse.ini"
+Page custom ModuleEclipsePageEnter ModuleEclipsePageExit
+
+!include "includes\regsvr.nsh"
+
+!macroend ;ECLIPSE_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_SECTIONS
+
+Section -PreEclipseSection
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${ECLIPSE_LOCATION_KEY}" $ECLIPSE_LOCATION
+SectionEnd
+
+SectionGroup "Eclipse Integration"
+
+Section "${MODULE_ECLIPSE_QTPROJECT_LABEL}" ECLIPSE_SEC01
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "${MODULE_ECLIPSE_QTPROJECT_INSTALLEDKEY}" 1
+ SetOutPath "$ECLIPSE_LOCATION\plugins\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QT_ID}.jar"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTPROJECT_ID}.jar"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTPROJECT_WIN32X86_ID}.jar"
+
+ SetOutPath "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\corporate.gif"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\feature.xml"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\license.html"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-0.9.5"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.0.0"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.0.1"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.4.0"
+
+ Call InstallQtModules
+
+ SetOutPath "$ECLIPSE_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\bin\${MODULE_ECLIPSE_QT_PREFIX}proparser.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\${MODULE_ECLIPSE_QT_PREFIX}qrceditor.dll"
+
+ push "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}proparser.dll"
+ call RegEclipseSvr
+
+ push "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}qrceditor.dll"
+ call RegEclipseSvr
+
+ IfFileExists "$ECLIPSE_MINGW_LOCATION\gcc.exe" 0 done
+ Call MakeEclipseStartFile
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\License.lnk" "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\license.html"
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\Start Eclipse with MinGW.lnk" "%COMSPEC%" "/c $\"$ECLIPSE_INSTDIR\start.bat$\""
+
+ done:
+SectionEnd
+
+Section "${MODULE_ECLIPSE_QTDESIGNER_LABEL}" ECLIPSE_SEC02
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "${MODULE_ECLIPSE_QTDESIGNER_INSTALLEDKEY}" 1
+ SetOutPath "$ECLIPSE_LOCATION\plugins\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNER_ID}.jar"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNER_WIN32X86_ID}.jar"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNER_QT_ID}.jar"
+
+ SetOutPath "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\qt3supportwidgets.dll"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\Qt3Support4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\QtSql4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\QtNetwork4.dll"
+ SetOutPath "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\META-INF\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\META-INF\MANIFEST.MF"
+
+ Call InstallQtModules
+
+ SetOutPath "$ECLIPSE_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtDesigner4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtScript4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtDesignerComponents4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\${MODULE_ECLIPSE_QT_PREFIX}designer.dll"
+
+ push "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}designer.dll"
+ call RegEclipseSvr
+SectionEnd
+
+Section "${MODULE_ECLIPSE_QTINTEGRATIONHELP_LABEL}" ECLIPSE_SEC03
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "${MODULE_ECLIPSE_QTINTEGRATIONHELP_INSTALLEDKEY}" 1
+ SetOutPath "$ECLIPSE_LOCATION\plugins\"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\plugins\${MODULE_ECLIPSE_QTINTEGRATIONHELP_ID}.jar"
+ SetOutPath "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET}\META-INF"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESSOURCE}\META-INF\MANIFEST.MF"
+ SetOutPath "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\adddialog.cpp"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\adddialog.h"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\adddialog.ui"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\addressbook.cpp"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\addressbook.h"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\AddressBook.pro"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\addressbook.ui"
+ File "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKSOURCE}\main.cpp"
+SectionEnd
+
+SectionGroupEnd
+
+; usage:
+; push dll to register
+; call RegEclipseSvr
+Function RegEclipseSvr
+ exch $0 ;filename
+
+ ClearErrors
+ push $0
+ call RegSvr
+ IfErrors 0 +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION 'Could not register "$0"'
+
+ pop $0
+FunctionEnd
+
+#
+# creates a start.bat file with mingw in the path
+#
+Function MakeEclipseStartFile
+ push $0 ; file handle
+
+ ClearErrors
+ FileOpen $0 "$ECLIPSE_INSTDIR\start.bat" w
+ IfErrors done
+
+ FileWrite $0 "@echo off$\r$\n"
+ FileWrite $0 "rem$\r$\n"
+ FileWrite $0 "rem This file is generated by the installer$\r$\n"
+ FileWrite $0 "rem$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "echo Setting up environment...$\r$\n"
+ FileWrite $0 "echo -- Using MinGW in: $ECLIPSE_MINGW_LOCATION $\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "set PATH=$ECLIPSE_MINGW_LOCATION$\r$\n"
+ FileWrite $0 "set PATH=%PATH%;%SystemRoot%\System32$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "echo Starting eclipse...$\r$\n"
+ FileWrite $0 'call "$ECLIPSE_LOCATION\eclipse.exe" -clean'
+ FileWrite $0 "$\r$\n"
+ FileClose $0
+
+ done:
+ pop $0
+FunctionEnd
+
+Function InstallQtModules
+ SetOutPath "$ECLIPSE_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_ECLIPSE_ROOT}\bin\msvcp${MODULE_ECLIPSE_MSRT_VERSION}.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\msvcr${MODULE_ECLIPSE_MSRT_VERSION}.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtCore4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtGui4.dll"
+ File "${MODULE_ECLIPSE_ROOT}\bin\QtXml4.dll"
+FunctionEnd
+
+Function ModuleEclipsePageEnter
+ !insertmacro MUI_HEADER_TEXT "$(ModuleEclipsePageTitle)" "$(ModuleEclipsePageDescription)"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_ECLIPSE_PAGE}"
+FunctionEnd
+
+Function ModuleEclipsePageExit
+ push $0
+ push $1
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_ECLIPSE_PAGE}" "Field 5" "State"
+ IfFileExists "$0\eclipse.exe" eclipse_found
+ MessageBox MB_OK|MB_ICONSTOP "$0\eclipse.exe not found!$\nPlease select a valid installation directory."
+ Goto failed
+ eclipse_found:
+
+ ClearErrors
+ FileOpen $1 "$0\plugins\com.trolltech.writetest" a
+ IfErrors 0 has_write_access
+ MessageBox MB_OK|MB_ICONSTOP "Can't write to $0\plugins.$\nPlease select a valid installation directory."
+ Goto failed
+ has_write_access:
+
+ FileClose $1
+ Delete "$0\plugins\com.trolltech.writetest"
+ StrCpy $ECLIPSE_LOCATION $0
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_ECLIPSE_PAGE}" "Field 3" "State"
+ StrCpy $ECLIPSE_MINGW_LOCATION $0
+ IfFileExists "$ECLIPSE_MINGW_LOCATION\g++.exe" done
+ MessageBox MB_YESNO|MB_ICONSTOP "g++ not found in $ECLIPSE_MINGW_LOCATION . Continue with installation?" IDYES done IDNO failed
+
+ failed:
+ pop $1
+ pop $0
+ Abort
+
+ done:
+ pop $1
+ pop $0
+FunctionEnd
+
+!macroend ;ECLIPSE_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_DESCRIPTION
+!ifdef ECLIPSE_SEC01
+ !insertmacro MUI_DESCRIPTION_TEXT ${ECLIPSE_SEC01} "This installs the ${MODULE_ECLIPSE_QTPROJECT_LABEL} into Eclipse."
+!endif
+!ifdef ECLIPSE_SEC02
+ !insertmacro MUI_DESCRIPTION_TEXT ${ECLIPSE_SEC02} "This installs the ${MODULE_ECLIPSE_QTDESIGNER_LABEL} into Eclipse."
+!endif
+!ifdef ECLIPSE_SEC03
+ !insertmacro MUI_DESCRIPTION_TEXT ${ECLIPSE_SEC03} "This installs the ${MODULE_ECLIPSE_QTINTEGRATIONHELP_LABEL} into Eclipse."
+!endif
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_STARTUP
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_ECLIPSE_PAGE}"
+ SectionSetFlags ${ECLIPSE_SEC01} 17
+ SectionSetFlags ${ECLIPSE_SEC02} 1
+ SectionSetFlags ${ECLIPSE_SEC03} 1
+
+ strcpy $ECLIPSE_INSTDIR "$PROGRAMFILES\Trolltech\Eclipse"
+!macroend ;ECLIPSE_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_UNSTARTUP
+ ReadRegStr $ECLIPSE_LOCATION SHCTX "$PRODUCT_UNIQUE_KEY" "${ECLIPSE_LOCATION_KEY}"
+ !insertmacro ConfirmOnRemove "${MODULE_ECLIPSE_QTPROJECT_INSTALLEDKEY}" "${MODULE_ECLIPSE_QTPROJECT_LABEL}"
+ !insertmacro ConfirmOnRemove "${MODULE_ECLIPSE_QTDESIGNER_INSTALLEDKEY}" "${MODULE_ECLIPSE_QTDESIGNER_LABEL}"
+ !insertmacro ConfirmOnRemove "${MODULE_ECLIPSE_QTINTEGRATIONHELP_INSTALLEDKEY}" "${MODULE_ECLIPSE_QTINTEGRATIONHELP_LABEL}"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_UNINSTALL
+Section un."Eclipse Integration"
+ push $0
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "${MODULE_ECLIPSE_QTPROJECT_INSTALLEDKEY}"
+ intcmp $0 1 0 DoneUnInstallQtProject
+ push "$ECLIPSE_INSTDIR\qtproparser.dll"
+ call un.RegSvr
+ push "$ECLIPSE_INSTDIR\qtqrceditor.dll"
+ call un.RegSvr
+
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QT_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTPROJECT_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTPROJECT_WIN32X86_ID}.jar"
+
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\corporate.gif"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\feature.xml"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\license.html"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-0.9.5"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.0.0"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.0.1"
+ Delete "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}\Changes-1.4.0"
+ RMDir "$ECLIPSE_LOCATION\features\${MODULE_ECLIPSE_QTFEATURE_ID}"
+
+ Delete "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}proparser.dll"
+ Delete "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}qrceditor.dll"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\License.lnk"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Start Eclipse with MinGW.lnk"
+ Delete "$ECLIPSE_INSTDIR\start.bat"
+ DoneUnInstallQtProject:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" ${MODULE_ECLIPSE_QTDESIGNER_INSTALLEDKEY}
+ intcmp $0 1 0 DoneUnInstallQtDesigner
+ push "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}designer.dll"
+ call un.RegSvr
+
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNER_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNER_WIN32X86_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNER_QT_ID}.jar"
+ Delete "$ECLIPSE_INSTDIR\QtDesigner4.dll"
+ Delete "$ECLIPSE_INSTDIR\QtScript4.dll"
+ Delete "$ECLIPSE_INSTDIR\QtDesignerComponents4.dll"
+ Delete "$ECLIPSE_INSTDIR\${MODULE_ECLIPSE_QT_PREFIX}designer.dll"
+
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\META-INF\MANIFEST.MF"
+ RMDir "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\META-INF"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\qt3supportwidgets.dll"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\Qt3Support4.dll"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\QtSql4.dll"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}\QtNetwork4.dll"
+ RMDir "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTDESIGNERPLUGINS_ID}"
+
+ DoneUnInstallQtDesigner:
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "${MODULE_ECLIPSE_QTINTEGRATIONHELP_INSTALLEDKEY}"
+ intcmp $0 1 0 DoneUnInstallQtIntegrationHelp
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_ECLIPSE_QTINTEGRATIONHELP_ID}.jar"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET}\META-INF\MANIFEST.MF"
+ RMDir "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET}\META-INF"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\adddialog.cpp"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\adddialog.h"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\adddialog.ui"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\addressbook.cpp"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\addressbook.h"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\AddressBook.pro"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\addressbook.ui"
+ Delete "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}\main.cpp"
+ RMDir "${MODULE_ECLIPSE_QTINTEGRATIONHELP_ADDRESSBOOKTARGET}"
+ RMDir "${MODULE_ECLIPSE_QTINTEGRATIONHELP_EXAMPLESTARGET}"
+ DoneUnInstallQtIntegrationHelp:
+
+ Delete "$ECLIPSE_INSTDIR\msvcp${MODULE_ECLIPSE_MSRT_VERSION}.dll"
+ Delete "$ECLIPSE_INSTDIR\msvcr${MODULE_ECLIPSE_MSRT_VERSION}.dll"
+ Delete "$ECLIPSE_INSTDIR\QtCore4.dll"
+ Delete "$ECLIPSE_INSTDIR\QtGui4.dll"
+ Delete "$ECLIPSE_INSTDIR\QtXml4.dll"
+
+ RMDir "$ECLIPSE_INSTDIR"
+
+ pop $0
+SectionEnd
+!macroend ;ECLIPSE_UNINSTALL
+
+;------------------------------------------------------------------------------------------------
+!macro ECLIPSE_UNFINISH
+!macroend
+
+!else ;MODULE_ECLIPSE
+!macro ECLIPSE_INITIALIZE
+!macroend
+!macro ECLIPSE_SECTIONS
+!macroend
+!macro ECLIPSE_DESCRIPTION
+!macroend
+!macro ECLIPSE_STARTUP
+!macroend
+!macro ECLIPSE_FINISH
+!macroend
+!macro ECLIPSE_UNSTARTUP
+!macroend
+!macro ECLIPSE_UNINSTALL
+!macroend
+!macro ECLIPSE_UNFINISH
+!macroend
+!endif ;MODULE_ECLIPSE
+
diff --git a/util/scripts/win-binary/nsis/modules/environment.nsh b/util/scripts/win-binary/nsis/modules/environment.nsh
new file mode 100644
index 0000000..a8d2548
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/environment.nsh
@@ -0,0 +1,176 @@
+!ifdef MODULE_ENVIRONMENT
+!macro ENVIRONMENT_INITIALIZE
+ !include "includes\writeEnvStr.nsh"
+ !include "includes\writePathStr.nsh"
+
+ !ifndef MODULE_ENVIRONMENT_QTDIR
+ !ifdef MODULE_MINGW
+ !define MODULE_ENVIRONMENT_QTDIR $MINGW_INSTDIR
+ !endif
+
+ !ifdef MODULE_MSVC
+ !define MODULE_ENVIRONMENT_QTDIR $MSVC_INSTDIR
+ !endif
+ !endif
+
+ !define MODULE_ENVIRONMENT_PAGE "envpage.ini"
+ var MODULE_ENVIRONMENT_SET
+ var MODULE_ENVIRONMENT_OLD
+ LangString ModuleEnvironmentTitle ${LANG_ENGLISH} "Configure Environment"
+ LangString ModuleEnvironmentDescription ${LANG_ENGLISH} "Configure Qt environment variables"
+
+ Page custom ModuleEnvironmentPageEnter ModuleEnvironmentPageExit
+!macroend
+!macro ENVIRONMENT_SECTIONS
+ Section -ModuleEnvironmentRegister
+ push "${MODULE_ENVIRONMENT_QTDIR}"
+ call RegisterQtEnvVariables
+ SectionEnd
+
+ Function ModuleEnvironmentPageEnter
+ push $0
+ Call IsNT
+ pop $0
+ strcmp "$0" "1" +2
+ abort
+ pop $0
+
+ !insertmacro MUI_HEADER_TEXT "$(ModuleEnvironmentTitle)" "$(ModuleEnvironmentDescription)"
+
+ strcmp $MODULE_ENVIRONMENT_SET "1" 0 envCheckNo
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_ENVIRONMENT_PAGE}" "Field 2" "State" "1"
+ goto showEnvPage
+ envCheckNo:
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_ENVIRONMENT_PAGE}" "Field 2" "State" "0"
+
+ showEnvPage:
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_ENVIRONMENT_PAGE}"
+ FunctionEnd
+
+ Function ModuleEnvironmentPageExit
+ !insertmacro MUI_INSTALLOPTIONS_READ $MODULE_ENVIRONMENT_SET "${MODULE_ENVIRONMENT_PAGE}" "Field 2" "State"
+ FunctionEnd
+
+ Function RegisterQtEnvVariables
+ exch $2 ; the installation path = QTDIR
+ push $0 ; I think WriteEnvStr mixes up $0 and $1
+ push $1
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtEnvSet" $MODULE_ENVIRONMENT_SET
+
+ strcmp $MODULE_ENVIRONMENT_SET "1" 0 noenv
+
+ StrCmp $MODULE_ENVIRONMENT_OLD "0" +4
+ DetailPrint "Removing $MODULE_ENVIRONMENT_OLD\bin from PATH"
+ push "$MODULE_ENVIRONMENT_OLD\bin"
+ Call RemoveFromPath ; remove old qtdir
+
+ DetailPrint "Setting QTDIR to $2"
+ push "QTDIR"
+ push $2
+ Call WriteEnvStr ; set the QTDIR
+
+ DetailPrint "Adding $2\bin to PATH"
+ push "$2\bin"
+ Call AddToPath ; set the PATH
+
+
+ push "QMAKESPEC"
+ push ${INSTALL_COMPILER}
+ Call GetMkSpec
+ pop $0
+ DetailPrint "Setting QMAKESPEC to $0"
+ push $0
+ Call WriteEnvStr ; set the QMAKESPEC
+
+ noenv:
+ pop $1
+ pop $0
+ pop $2
+ FunctionEnd
+
+ Function un.RegisterQtEnvVariables
+ exch $0 ; QTDIR
+ push $1
+
+ ClearErrors
+ ReadRegDWORD $MODULE_ENVIRONMENT_SET SHCTX "$PRODUCT_UNIQUE_KEY" "QtEnvSet"
+ intcmp $MODULE_ENVIRONMENT_SET 0 noenv
+
+ DetailPrint "Removing $0\bin from the PATH"
+ push "$0\bin"
+ Call un.RemoveFromPath ; removes qt from the path
+
+ ;Check if QTDIR is equal to installdir
+ ExpandEnvStrings $1 "%QTDIR%"
+
+ StrCmp "$0" "$1" removeenv
+ StrCmp "$0\" "$1" removeenv
+ StrCmp "$0" "$1\" removeenv
+ Goto noenv
+
+ removeenv:
+ DetailPrint "Removing QTDIR"
+ push "QTDIR"
+ Call un.DeleteEnvStr ; removes QTDIR
+
+ DetailPrint "Removing QMAKESPEC"
+ push "QMAKESPEC"
+ Call un.DeleteEnvStr ; removes QMAKESPEC
+
+ noenv:
+ pop $1
+ pop $0
+ FunctionEnd
+!macroend
+!macro ENVIRONMENT_DESCRIPTION
+!macroend
+!macro ENVIRONMENT_STARTUP
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_ENVIRONMENT_PAGE}"
+ push $0
+ ExpandEnvStrings $0 "%QTDIR%"
+
+ StrCmp $0 "%QTDIR%" +4
+ strcpy $MODULE_ENVIRONMENT_SET "0" ;QTDIR exists
+ strcpy $MODULE_ENVIRONMENT_OLD $0
+ Goto +3
+ strcpy $MODULE_ENVIRONMENT_SET "1" ;no QTDIR
+ strcpy $MODULE_ENVIRONMENT_OLD "0"
+
+ Call IsNT
+ pop $0
+ strcmp "$0" "1" +2
+ strcpy $MODULE_ENVIRONMENT_SET "0"
+ pop $0
+!macroend
+!macro ENVIRONMENT_FINISH
+!macroend
+!macro ENVIRONMENT_UNSTARTUP
+!macroend
+!macro ENVIRONMENT_UNINSTALL
+ Section -un.ModuleEnvironmentRegister
+ push "${MODULE_ENVIRONMENT_QTDIR}"
+ call un.RegisterQtEnvVariables
+ SectionEnd
+!macroend
+!macro ENVIRONMENT_UNFINISH
+!macroend
+!else ;MODULE_ENVIRONMENT
+!macro ENVIRONMENT_INITIALIZE
+!macroend
+!macro ENVIRONMENT_SECTIONS
+!macroend
+!macro ENVIRONMENT_DESCRIPTION
+!macroend
+!macro ENVIRONMENT_STARTUP
+!macroend
+!macro ENVIRONMENT_FINISH
+!macroend
+!macro ENVIRONMENT_UNSTARTUP
+!macroend
+!macro ENVIRONMENT_UNINSTALL
+!macroend
+!macro ENVIRONMENT_UNFINISH
+!macroend
+!endif ;MODULE_ENVIRONMENT
+
diff --git a/util/scripts/win-binary/nsis/modules/evaluation.nsh b/util/scripts/win-binary/nsis/modules/evaluation.nsh
new file mode 100644
index 0000000..7bcb31e
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/evaluation.nsh
@@ -0,0 +1,116 @@
+!ifdef MODULE_EVALUATION
+!macro EVALUATION_INITIALIZE
+ !ifndef MODULE_EVALUATION_QTDIR
+ !ifdef MODULE_MINGW
+ !define MODULE_EVALUATION_QTDIR $MINGW_INSTDIR
+ !endif
+
+ !ifdef MODULE_MSVC
+ !define MODULE_EVALUATION_QTDIR $MSVC_INSTDIR
+ !endif
+
+ !ifdef MODULE_QTJAMBI
+ !define MODULE_EVALUATION_QTDIR $QTJAMBI_INSTDIR
+ !endif
+ !endif
+!macroend
+!macro EVALUATION_SECTIONS
+ Section -ModuleEvaluationSection
+ !ifdef MODULE_MSVC_WIN32BUILDTREE & MODULE_MSVC_WIN32BUILDINSTALLDIRNAME
+ push "$MSVC_INSTDIR\${MODULE_MSVC_WIN32BUILDINSTALLDIRNAME}"
+ push "bin"
+ call PatchKeyInBinary
+ !endif
+ !ifdef MODULE_MSVC_WM50BUILDTREE & MODULE_MSVC_WM50BUILDINSTALLDIRNAME
+ push "$MSVC_INSTDIR\${MODULE_MSVC_WM50BUILDINSTALLDIRNAME}"
+ push "lib"
+ call PatchKeyInBinary
+ !endif
+ !ifdef MODULE_MSVC_SSDK50X86BUILDTREE & MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME
+ push "$MSVC_INSTDIR\${MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME}"
+ push "lib"
+ call PatchKeyInBinary
+ !endif
+ !ifndef MODULE_MSVC_WIN32BUILDTREE | MODULE_MSVC_WM50BUILDTREE | MODULE_MSVC_SSDK50X86BUILDTREE
+ push "${MODULE_EVALUATION_QTDIR}"
+ push "bin"
+ call PatchKeyInBinary
+ !endif
+ SectionEnd
+
+ Function PatchKeyInBinary
+ exch $3
+ exch
+ exch $2
+ exch
+ push $0
+ push $1
+
+ DetailPrint "Patching key in core ($2\$3)..."
+ FindFirst $0 $1 "$2\$3\QtCore*.dll"
+ StrCmp $1 "" ErrorPatchingCore
+ qtnsisext::PatchBinary "$2\$3\$1" "qt_qevalkey=" "qt_qevalkey=$LICENSE_KEY"
+
+ FindNext $0 $1
+ StrCmp $1 "" ErrorPatchingCore
+ qtnsisext::PatchBinary "$2\$3\$1" "qt_qevalkey=" "qt_qevalkey=$LICENSE_KEY"
+
+ ErrorPatchingCore:
+
+ DetailPrint "Patching key in gui ($2\$3)..."
+ FindFirst $0 $1 "$2\$3\QtGui*.dll"
+ StrCmp $1 "" ErrorPatchingGUI
+ qtnsisext::PatchBinary "$2\$3\$1" "qt_qevalkey=" "qt_qevalkey=$LICENSE_KEY"
+
+ FindNext $0 $1
+ StrCmp $1 "" ErrorPatchingGUI
+ qtnsisext::PatchBinary "$2\$3\$1" "qt_qevalkey=" "qt_qevalkey=$LICENSE_KEY"
+
+ ErrorPatchingGUI:
+
+ IfFileExists "$2\include\Qt\qconfig.h" 0 NoConfigFileFound
+ CopyFiles /FILESONLY "$2\include\Qt\qconfig.h" "$2\include\QtCore"
+ NoConfigFileFound:
+
+ pop $1
+ pop $0
+ pop $3
+ pop $2
+ FunctionEnd
+!macroend
+!macro EVALUATION_DESCRIPTION
+!macroend
+!macro EVALUATION_STARTUP
+!macroend
+!macro EVALUATION_FINISH
+!macroend
+!macro EVALUATION_UNSTARTUP
+!macroend
+!macro EVALUATION_UNINSTALL
+ Section un.-ModuleEvaluationSection
+ Delete "${MODULE_EVALUATION_QTDIR}\include\QtCore\qconfig.h"
+ RMDir "${MODULE_EVALUATION_QTDIR}\include\QtCore"
+ RMDir "${MODULE_EVALUATION_QTDIR}\include"
+ SectionEnd
+!macroend
+!macro EVALUATION_UNFINISH
+!macroend
+!else ;MODULE_EVALUATION
+!macro EVALUATION_INITIALIZE
+!macroend
+!macro EVALUATION_SECTIONS
+!macroend
+!macro EVALUATION_DESCRIPTION
+!macroend
+!macro EVALUATION_STARTUP
+!macroend
+!macro EVALUATION_FINISH
+!macroend
+!macro EVALUATION_UNSTARTUP
+!macroend
+!macro EVALUATION_UNINSTALL
+!macroend
+!macro EVALUATION_UNFINISH
+!macroend
+!endif ;MODULE_EVALUATION
+
diff --git a/util/scripts/win-binary/nsis/modules/help.nsh b/util/scripts/win-binary/nsis/modules/help.nsh
new file mode 100644
index 0000000..ccd0cd2
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/help.nsh
@@ -0,0 +1,274 @@
+; Help Module
+
+!ifdef MODULE_HELP
+
+;------------------------------------------------------------------------------------------------
+!macro HELP_INITIALIZE
+!ifndef MODULE_HELP_NAME
+ !define MODULE_HELP_NAME "Help Integration"
+!endif
+!ifndef MODULE_HELP_ROOT
+ !define MODULE_HELP_ROOT "${INSTALL_ROOT}\vsip\help"
+!endif
+!ifndef MODULE_HELP_QT_FILE_ROOT
+ !define MODULE_HELP_QT_FILE_ROOT "qt"
+!endif
+
+!include "includes\system.nsh"
+!include "includes\help.nsh"
+
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro HELP_SECTIONS
+
+Section -PreHelpSection
+ ; use default instdir if not set
+ strcmp "$HELP_INSTDIR" "" 0 +2
+ StrCpy $HELP_INSTDIR "$INSTDIR\help"
+SectionEnd
+
+SectionGroup "Help Integration"
+
+!ifndef MODULE_HELP_NOVS2008
+Section "Visual Studio 2008" HELP_SEC01
+ !insertmacro InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "9.0"
+ WriteRegDWORD SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 9.0" 1
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp90Installed" 1
+SectionEnd
+!endif
+
+!ifndef MODULE_HELP_NOVS2005
+Section "Visual Studio 2005" HELP_SEC02
+ !insertmacro InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "8.0"
+ WriteRegDWORD SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 8.0" 1
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp80Installed" 1
+SectionEnd
+!endif
+
+!ifndef MODULE_HELP_NOVS2003
+Section "Visual Studio 2003" HELP_SEC03
+ !insertmacro InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "7.1"
+ WriteRegDWORD SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.1" 1
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp71Installed" 1
+SectionEnd
+!endif
+
+!ifndef MODULE_HELP_NOVS2002
+Section "Visual Studio 2002" HELP_SEC04
+ !insertmacro InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "7.0"
+ WriteRegDWORD SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.0" 1
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp70Installed" 1
+SectionEnd
+!endif
+
+SectionGroupEnd
+
+Section -PostHelpSection
+ IfFileExists "$HELP_INSTDIR\h2reg.exe" 0 PostHelpSectionFinished
+ !insertmacro RegisterHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT}
+PostHelpSectionFinished:
+SectionEnd
+
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro HELP_DESCRIPTION
+!ifdef HELP_SEC01
+ !insertmacro MUI_DESCRIPTION_TEXT ${HELP_SEC01} "This installs the Qt Help Integration for Visual Studio 2008"
+!endif
+!ifdef HELP_SEC02
+ !insertmacro MUI_DESCRIPTION_TEXT ${HELP_SEC02} "This installs the Qt Help Integration for Visual Studio 2005"
+!endif
+!ifdef HELP_SEC03
+ !insertmacro MUI_DESCRIPTION_TEXT ${HELP_SEC03} "This installs the Qt Help Integration for Visual Studio 2003"
+!endif
+!ifdef HELP_SEC04
+ !insertmacro MUI_DESCRIPTION_TEXT ${HELP_SEC04} "This installs the Qt Help Integration for Visual Studio 2002"
+!endif
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro HELP_STARTUP
+ Push $0
+ Push $1
+ Push $2
+
+ StrCmp $RUNNING_AS_ADMIN "false" 0 Module_Help_CheckForInstallation
+!ifdef HELP_SEC01
+ SectionSetFlags ${HELP_SEC01} "16"
+!endif
+!ifdef HELP_SEC02
+ SectionSetFlags ${HELP_SEC02} "16"
+!endif
+!ifdef HELP_SEC03
+ SectionSetFlags ${HELP_SEC03} "16"
+!endif
+ Goto Module_Help_Done
+
+ Module_Help_CheckForInstallation:
+!ifdef HELP_SEC01
+ ReadRegDWORD $0 SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 9.0"
+ intcmp $0 1 0 +2
+ SectionSetFlags ${HELP_SEC01} "16"
+!endif
+
+!ifdef HELP_SEC02
+ ReadRegDWORD $0 SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 8.0"
+ intcmp $0 1 0 +2
+ SectionSetFlags ${HELP_SEC02} "16"
+!endif
+
+!ifdef HELP_SEC03
+ ReadRegDWORD $0 SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.1"
+ intcmp $0 1 0 +2
+ SectionSetFlags ${HELP_SEC03} "16"
+!endif
+
+!ifdef HELP_SEC04
+ ReadRegDWORD $0 SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.0"
+ intcmp $0 1 0 +2
+ SectionSetFlags ${HELP_SEC04} "16"
+!endif
+
+!ifdef HELP_SEC01
+ ClearErrors
+ Push "9.0"
+ Call GetVSInstallationDir
+ Pop $2
+ IfErrors 0 +2
+ SectionSetFlags ${HELP_SEC01} "16"
+!endif
+
+!ifdef HELP_SEC02
+ ClearErrors
+ Push "8.0"
+ Call GetVSInstallationDir
+ Pop $2
+ IfErrors 0 +2
+ SectionSetFlags ${HELP_SEC02} "16"
+!endif
+
+!ifdef HELP_SEC03
+ ClearErrors
+ Push "7.1"
+ Call GetVSInstallationDir
+ Pop $2
+ IfErrors 0 +2
+ SectionSetFlags ${HELP_SEC03} "16"
+!endif
+
+!ifdef HELP_SEC04
+ ClearErrors
+ Push "7.0"
+ Call GetVSInstallationDir
+ Pop $2
+ IfErrors 0 +2
+ SectionSetFlags ${HELP_SEC04} "16"
+!endif
+
+ Module_Help_Done:
+ Pop $2
+ Pop $1
+ Pop $0
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro HELP_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro HELP_UNSTARTUP
+ ; use default instdir if not set
+ strcmp "$HELP_INSTDIR" "" 0 +2
+ StrCpy $HELP_INSTDIR "$INSTDIR\help"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro HELP_UNINSTALL
+Section un."${MODULE_HELP_NAME}"
+ push $0
+ push $1
+ push $2
+ push $3
+ push $4
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp90Installed"
+ ReadRegDWORD $1 SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp80Installed"
+ ReadRegDWORD $2 SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp71Installed"
+ ReadRegDWORD $3 SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp70Installed"
+
+ IntOp $4 $0 | $1
+ IntOp $4 $4 | $2
+ IntOp $4 $4 | $3
+ IntCmp $4 0 Module_Help_End
+
+ !insertmacro un.RegisterHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT}
+
+ IntCmp $0 0 Module_Help_NoVS2008
+ !insertmacro un.InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "9.0"
+ DeleteRegValue SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp90Installed"
+ DeleteRegValue SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 9.0"
+ Module_Help_NoVS2008:
+
+ IntCmp $1 0 Module_Help_NoVS2005
+ !insertmacro un.InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "8.0"
+ DeleteRegValue SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp80Installed"
+ DeleteRegValue SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 8.0"
+ Module_Help_NoVS2005:
+
+ IntCmp $2 0 Module_Help_NoVS2003
+ !insertmacro un.InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "7.1"
+ DeleteRegValue SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp71Installed"
+ DeleteRegValue SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.1"
+ Module_Help_NoVS2003:
+
+ IntCmp $3 0 Module_Help_NoVS2002
+ !insertmacro un.InstallHelp "$HELP_INSTDIR" ${MODULE_HELP_QT_FILE_ROOT} "7.0"
+ DeleteRegValue SHCTX "$PRODUCT_UNIQUE_KEY" "QtHelp70Installed"
+ DeleteRegValue SHCTX "SOFTWARE\Trolltech\QtHelp" "${PRODUCT_NAME} ${PRODUCT_VERSION} - 7.0"
+ Module_Help_NoVS2002:
+
+ DeleteRegKey /ifempty SHCTX "SOFTWARE\Trolltech\QtHelp"
+
+ push "$HELP_INSTDIR"
+ Call un.DeleteH2RegFiles
+
+ Module_Help_End:
+ pop $4
+ pop $3
+ pop $2
+ pop $1
+ pop $0
+SectionEnd
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro HELP_UNFINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!else
+!macro HELP_INITIALIZE
+!macroend
+!macro HELP_SECTIONS
+!macroend
+!macro HELP_DESCRIPTION
+!macroend
+!macro HELP_STARTUP
+!macroend
+!macro HELP_FINISH
+!macroend
+!macro HELP_UNSTARTUP
+!macroend
+!macro HELP_UNINSTALL
+!macroend
+!macro HELP_UNFINISH
+!macroend
+!endif
diff --git a/util/scripts/win-binary/nsis/modules/license.nsh b/util/scripts/win-binary/nsis/modules/license.nsh
new file mode 100644
index 0000000..78b443c
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/license.nsh
@@ -0,0 +1,377 @@
+!ifdef MODULE_LICENSECHECK
+
+!macro LICENSECHECK_INITIALIZE
+ !include "includes\list.nsh"
+ !define TT_QTKEY_INI_FILE "license.ini"
+ !define MODULE_LICENSECHECK_PAGE "licensepage.ini"
+
+ LangString LicenseTitle ${LANG_ENGLISH} "Qt License"
+ LangString LicenseTitleDescription ${LANG_ENGLISH} "Enter your Qt License key."
+
+ LangString LicensePageTitle ${LANG_ENGLISH} "License Agreement"
+ LangString LicensePageDescription ${LANG_ENGLISH} "Please review the license terms before installing $(^Name)."
+
+ Page custom CheckQtLicense CopyKeyAndValidate
+ Page custom ModuleLicensePageEnter ModuleLicensePageExit
+
+ !ifdef MODULE_LICENSECHECK_PACKAGEDATE
+ !echo "Using package date: ${MODULE_LICENSECHECK_PACKAGEDATE}"
+ !endif
+!macroend
+
+!macro LICENSECHECK_SECTIONS
+ Section -ModuleLicenseCheck
+ push $0
+ push $1
+ push $2
+ push $3
+ push $4
+ push $5
+ push $6
+
+ qtnsisext::GetLicenseInfo
+ pop $6 ; ExpiryDate
+ pop $5 ; Products
+ pop $4 ; CustomerID
+ pop $1 ; Licensee
+ pop $3 ; OldLicenseKey
+ pop $0 ; License Key
+
+ strcmp "$0" "$LICENSE_KEY" done ;use the .qt-license that already exists
+
+ ; create a new .qt-license file
+ ExpandEnvStrings $0 "%HOME%"
+ strcmp "$0" "%HOME%" 0 writeLicenseFile
+ ExpandEnvStrings $0 "%USERPROFILE%"
+ strcmp "$0" "%USERPROFILE%" 0 writeLicenseFile
+ ExpandEnvStrings $0 "%HOMEDRIVE%%HOMEPATH%"
+
+ ; if bka exists, write backup to file bkb
+ writeLicenseFile:
+ IfFileExists "$0\.qt-license" 0 noBackup
+
+ strcpy $1 "$0\.qt-license-original"
+ IfFileExists "$1" 0 +2
+ strcpy $1 "$0\.qt-license-backup"
+
+ IfFileExists "$1" 0 +2
+ Delete "$1"
+
+ ClearErrors
+ CopyFiles /FILESONLY "$0\.qt-license" "$1"
+ IfErrors done
+ Delete "$0\.qt-license"
+ IfErrors done
+
+ noBackup:
+ qtnsisext::GetLicenseID $LICENSE_KEY
+ pop $2
+
+ ClearErrors
+ FileOpen $1 "$0\.qt-license" w
+ IfErrors done
+ FileWrite $1 '# Qt license file (Created by the binary installer)$\r$\n'
+
+ strcmp "$4" "" +2
+ FileWrite $1 'CustomerID="$4"$\r$\n'
+
+ FileWrite $1 'LicenseID="$2"$\r$\n'
+ FileWrite $1 'Licensee="$LICENSEE"$\r$\n'
+
+ strcmp "$5" "" +2
+ FileWrite $1 'Products="$5"$\r$\n'
+
+ strcmp "$6" "" +2
+ FileWrite $1 "ExpiryDate=$6$\r$\n"
+
+ strcmp "$3" "" +2
+ FileWrite $1 "LicenseKey=$3$\r$\n"
+ FileWrite $1 "LicenseKeyExt=$LICENSE_KEY$\r$\n"
+ FileClose $1
+
+ done:
+ pop $6
+ pop $5
+ pop $4
+ pop $3
+ pop $2
+ pop $1
+ pop $0
+ SectionEnd
+
+ Function ModuleLicensePageEnter
+ push $0
+ push $1
+ !insertmacro MUI_HEADER_TEXT "$(LicensePageTitle)" "$(LicensePageDescription)"
+
+ GetDlgItem $1 $HWNDPARENT 1
+ EnableWindow $1 0
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_LICENSECHECK_PAGE}" "Field 4" "State" "0"
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_LICENSECHECK_PAGE}" "Field 5" "State" "1"
+
+ !insertmacro MUI_INSTALLOPTIONS_INITDIALOG ${MODULE_LICENSECHECK_PAGE}
+ FindWindow $0 "#32770" "" $HWNDPARENT
+ GetDlgItem $1 $0 1200
+ SetCtlColors $1 0x000000 0xFFFFFF
+ qtnsisext::ShowLicenseFile "$1" "$LICENSE_FILE"
+ !insertmacro MUI_INSTALLOPTIONS_SHOW
+
+ pop $1
+ pop $0
+ FunctionEnd
+
+ Function ModuleLicensePageExit
+ push $0
+ push $1
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_LICENSECHECK_PAGE}" "Settings" "State"
+ strcmp "$0" "4" +2
+ strcmp "$0" "5" 0 NoNotify
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_LICENSECHECK_PAGE}" "Field 4" "State"
+ GetDlgItem $1 $HWNDPARENT 1
+ strcmp "$0" "1" +3
+ EnableWindow $1 0
+ goto +2
+ EnableWindow $1 1
+ pop $1
+ pop $0
+ abort
+ NoNotify:
+
+ pop $1
+ pop $0
+ call CheckLocalLicenseProduct
+ FunctionEnd
+
+ Function CheckQtLicense
+ !insertmacro MUI_HEADER_TEXT "$(LicenseTitle)" "$(LicenseTitleDescription)"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY ${TT_QTKEY_INI_FILE}
+ FunctionEnd
+
+ Function CopyKeyAndValidate
+ IfSilent +3 0
+ !insertmacro MUI_INSTALLOPTIONS_READ $LICENSEE "${TT_QTKEY_INI_FILE}" "Field 2" "State"
+ !insertmacro MUI_INSTALLOPTIONS_READ $LICENSE_KEY "${TT_QTKEY_INI_FILE}" "Field 3" "State"
+
+ call ValidateKey
+ FunctionEnd
+!macroend
+
+Function ValidateKey
+ push $1
+ push $2
+
+ StrLen $1 $LICENSEE
+ IntCmp $1 0 wrongLicensee
+
+ ClearErrors
+ !ifdef MODULE_LICENSECHECK_WINCE
+ qtnsisext::IsValidWinCELicense $LICENSE_KEY
+ !else
+ qtnsisext::IsValidLicense $LICENSE_KEY
+ !endif
+ IfErrors wrongKey
+ pop $1
+ strcmp $1 "0" wrongKey
+
+ !ifdef MODULE_LICENSECHECK_CHECKPRODUCT
+ qtnsisext::HasLicenseProduct $LICENSE_KEY "${MODULE_LICENSECHECK_CHECKPRODUCT}"
+ pop $1
+ strcmp $1 "0" wrongProduct
+ !endif
+
+ qtnsisext::GetLicenseProduct $LICENSE_KEY
+ pop $LICENSE_PRODUCT
+
+ qtnsisext::GetLicensePlatform $LICENSE_KEY
+ pop $LICENSE_PLATFORM
+
+ !ifdef MODULE_LICENSECHECK_PRODUCTLIST
+ push "$LICENSE_PRODUCT"
+ push "${MODULE_LICENSECHECK_PRODUCTLIST}"
+ call ItemInList
+ pop $1
+ strcmp $1 "0" wrongKey
+ !endif
+
+ strcmp "$LICENSE_PRODUCT" "SupportedEvaluation" 0 +2
+ strcpy $LICENSE_PRODUCT "Evaluation"
+ strcmp "$LICENSE_PRODUCT" "UnsupportedEvaluation" 0 +2
+ strcpy $LICENSE_PRODUCT "Evaluation"
+ strcmp "$LICENSE_PRODUCT" "FullSourceEvaluation" 0 +2
+ strcpy $LICENSE_PRODUCT "Evaluation"
+
+ !ifdef MODULE_LICENSECHECK_PACKAGEDATE
+ strcmp "$LICENSE_PRODUCT" "Evaluation" expiryDateCurrent expiryDatePackage
+ expiryDateCurrent:
+ qtnsisext::IsValidDate $LICENSE_KEY ""
+ pop $1
+ strcmp $1 "0" keyExpired
+ goto expiryDateEnd
+ expiryDatePackage:
+ qtnsisext::IsValidDate $LICENSE_KEY "${MODULE_LICENSECHECK_PACKAGEDATE}"
+ pop $1
+ strcmp $1 "0" keyExpired
+ expiryDateEnd:
+ !endif
+
+ !ifndef MODULE_LICENSECHECK_LICENSE
+ ${StrCase} $2 "-$LICENSE_PRODUCT" "U"
+ strcmp $2 "-UNIVERSAL" 0 +2
+ strcpy $2 "-DESKTOP"
+ strcmp $2 "-DESKTOP" 0 +2
+ strcpy $2 "-DESKTOP"
+ strcmp $2 "-DESKTOPLIGHT" 0 +2
+ strcpy $2 "-DESKTOP"
+ strcpy $LICENSE_FILE "$PLUGINSDIR\.LICENSE$2"
+ ${If} $LICENSE_PRODUCT != "Evaluation"
+ ${If} $LICENSE_PLATFORM == "AllOS"
+ strcpy $LICENSE_FILE "$PLUGINSDIR\.LICENSE-ALLOS"
+ ${Else}
+ ${If} $LICENSE_PLATFORM == "Embedded"
+ strcpy $LICENSE_FILE "$PLUGINSDIR\.LICENSE-EMBEDDED"
+ ${EndIf}
+ ${EndIf}
+ ${EndIf}
+ !else
+ strcpy $LICENSE_FILE "$PLUGINSDIR\${MODULE_LICENSECHECK_LICENSE}"
+ !endif
+
+ ; In case there is a .LICENSE we assume that we have a custom package
+ ; custom means alpha,beta,rc or such. We still check for a valid
+ ; license key but display the license provided in that file.
+ ${If} ${FileExists} "$PLUGINSDIR\.LICENSE"
+ strcpy $LICENSE_FILE "$PLUGINSDIR\.LICENSE"
+ ${EndIf}
+
+ qtnsisext::UsesUsLicense $LICENSE_KEY
+ pop $2
+ strcmp "$2" "0" licenseFileCheck
+
+ !ifdef MODULE_LICENSECHECK_USLICENSE
+ strcpy $LICENSE_FILE "$PLUGINSDIR\${MODULE_LICENSECHECK_USLICENSE}"
+ !else
+ strcpy $LICENSE_FILE "$LICENSE_FILE-US"
+ !endif
+
+ licenseFileCheck:
+ IfFileExists $LICENSE_FILE 0 wrongLicenseFile
+
+ goto end
+ wrongLicensee:
+ IfSilent 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "The licensee name is not valid!"
+ Quit
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "The licensee name is not valid. Do you want to try again?" IDRETRY tryAgain 0
+ Quit
+ wrongKey:
+ IfSilent 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "The specified license key is not valid!"
+ Quit
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "The license key you entered is not valid. Do you want to try again?" IDRETRY tryAgain 0
+ Quit
+ keyExpired:
+ IfSilent 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "The specified license key has expired!"
+ Quit
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "The license key you entered has expired. Do you want to try again?" IDRETRY tryAgain 0
+ Quit
+ wrongProduct:
+ IfSilent 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "The license key you specified does not include ${MODULE_LICENSECHECK_CHECKPRODUCT}!"
+ Quit
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "The license key you entered does not include ${MODULE_LICENSECHECK_CHECKPRODUCT}. Do you want to try again?" IDRETRY tryAgain 0
+ Quit
+ wrongLicenseFile:
+ IfSilent 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "No license agreement file found. Please contact support."
+ Quit
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "No license agreement file found. Please contact support." IDRETRY tryAgain 0
+ Quit
+ tryAgain:
+ pop $2
+ pop $1
+ Abort
+ end:
+ pop $2
+ pop $1
+FunctionEnd
+
+
+!macro LICENSECHECK_STARTUP
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${TT_QTKEY_INI_FILE}"
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_LICENSECHECK_PAGE}"
+
+ SetOutPath "$PLUGINSDIR"
+ !ifndef MODULE_LICENSECHECK_LICENSE
+ File "${MODULE_LICENSECHECK_LICENSEDIR}\.LICENSE*"
+ !else
+ File "${MODULE_LICENSECHECK_LICENSEDIR}\${MODULE_LICENSECHECK_LICENSE}"
+ !ifdef MODULE_LICENSECHECK_USLICENSE
+ File "${MODULE_LICENSECHECK_LICENSEDIR}\${MODULE_LICENSECHECK_USLICENSE}"
+ !endif
+ !endif
+
+ push $0
+ push $1
+ push $2
+ push $3
+ push $4
+ push $5
+
+ qtnsisext::GetLicenseInfo
+ pop $5 ; ExpiryDate
+ pop $4 ; Products
+ pop $3 ; CustomerID
+ pop $1 ; Licensee
+ pop $2 ; OldLicenseKey
+ pop $0 ; License Key
+
+ strcmp $LICENSEE "" +2
+ strcpy $1 $LICENSEE
+
+ strcmp $LICENSE_KEY "" +2
+ strcpy $0 $LICENSE_KEY
+
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${TT_QTKEY_INI_FILE}" "Field 2" "State" "$1"
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${TT_QTKEY_INI_FILE}" "Field 3" "State" "$0"
+ IfSilent 0 +4
+ strcpy $LICENSEE "$1"
+ strcpy $LICENSE_KEY "$0"
+ call ValidateKey
+
+ pop $5
+ pop $4
+ pop $3
+ pop $2
+ pop $1
+ pop $0
+!macroend
+
+!macro LICENSECHECK_FINISH
+!macroend
+!macro LICENSECHECK_UNSTARTUP
+!macroend
+!macro LICENSECHECK_UNINSTALL
+!macroend
+!macro LICENSECHECK_UNFINISH
+!macroend
+!else ;MODULE_LICENSECHECK
+!macro LICENSECHECK_INITIALIZE
+ !ifdef LICENSE_FILE
+ !define MUI_LICENSEPAGE_RADIOBUTTONS
+ !insertmacro MUI_PAGE_LICENSE ${LICENSE_FILE}
+ !endif
+!macroend
+!macro LICENSECHECK_SECTIONS
+!macroend
+!macro LICENSECHECK_STARTUP
+!macroend
+!macro LICENSECHECK_FINISH
+!macroend
+!macro LICENSECHECK_UNSTARTUP
+!macroend
+!macro LICENSECHECK_UNINSTALL
+!macroend
+!macro LICENSECHECK_UNFINISH
+!macroend
+!endif ;MODULE_LICENSECHECK
diff --git a/util/scripts/win-binary/nsis/modules/mingw.nsh b/util/scripts/win-binary/nsis/modules/mingw.nsh
new file mode 100644
index 0000000..9d19e8d
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/mingw.nsh
@@ -0,0 +1,629 @@
+!ifdef MODULE_MINGW
+!macro MINGW_INITIALIZE
+!include "includes\qtcommon.nsh"
+!ifndef MODULE_MINGW_NAME
+ !define MODULE_MINGW_NAME "Qt"
+!endif
+!ifndef MODULE_MINGW_VERSION
+ !define MODULE_MINGW_VERSION "${PRODUCT_VERSION}"
+!endif
+!ifndef MODULE_MINGW_BUILDDIR
+ !error "MODULE_MINGW_BUILDDIR not defined!"
+!endif
+!ifndef MODULE_MINGW_URL
+ !define MODULE_MINGW_URL "ftp://ftp.trolltech.com/misc"
+!endif
+!ifndef MODULE_MINGW_COMPILERVERSION
+ !define MODULE_MINGW_COMPILERVERSION "3.4.2"
+!endif
+!ifndef MODULE_MINGW_LICENSE
+ !define MODULE_MINGW_LICENSE "C:\MinGW\COPYING"
+!endif
+
+!define MODULE_MINGW_DOWNLOADPAGE "gwdownload.ini"
+!define MODULE_MINGW_MIRRORPAGE "gwmirror.ini"
+!define MODULE_MINGW_RUNTIME_LIB "mingw*.dll"
+!define MODULE_MINGW_DOWNLOADFILE "MinGW-${MODULE_MINGW_COMPILERVERSION}"
+
+var MODULE_MINGW_DOWNLOAD
+var MODULE_MINGW_SOURCEDOWNLOAD
+var MODULE_MINGW_MIRRORS
+var MODULE_MINGW_INSTOK
+var MODULE_MINGW_COMPILERINSTDIR
+
+LangString ModuleMinGWTitle ${LANG_ENGLISH} "MinGW Installation"
+LangString ModuleMinGWDescription ${LANG_ENGLISH} "You need MinGW to be able to compile Qt applications."
+LangString ModuleMinGWMirrorTitle ${LANG_ENGLISH} "MinGW Download Mirror"
+LangString ModuleMinGWMirrorDescription ${LANG_ENGLISH} "Select a download mirror."
+
+Page custom ModuleMinGWDownloadPageEnter ModuleMinGWDownloadPageExit
+!define MUI_PAGE_CUSTOMFUNCTION_PRE ModuleMinGWLicensePageEnter
+!define MUI_PAGE_HEADER_TEXT "MinGW License Agreement"
+!define MUI_PAGE_HEADER_SUBTEXT "Please review the license terms before installing MinGW."
+!define MUI_LICENSEPAGE_TEXT_TOP "MinGW License Information"
+!insertmacro MUI_PAGE_LICENSE "${MODULE_MINGW_LICENSE}"
+Page custom ModuleMinGWMirrorPageEnter ModuleMinGWMirrorPageExit
+
+!include "includes\qtenv.nsh"
+!macroend
+
+!macro MINGW_SECTIONS
+Section "${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION}" MINGW_SEC01
+ strcmp "$MINGW_INSTDIR" "" 0 +5
+ StrCpy $MINGW_INSTDIR "$INSTDIR\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION}"
+ push $MINGW_INSTDIR
+ call MakeQtDirectory
+ pop $MINGW_INSTDIR
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "MINGWInstalled" 1
+
+ SetOutPath "$MINGW_INSTDIR"
+ SetOverwrite ifnewer
+ !insertmacro MODULE_MINGW_INSTALLFILES
+
+ push "$MINGW_INSTDIR"
+ call DeleteFloatingLicenseProgram
+
+ push "$MINGW_INSTDIR\bin"
+ call AddStartmenuApplication
+
+ push ${MODULE_MINGW_BUILDDIR}
+ push "$MINGW_INSTDIR"
+ call PatchPrlFiles
+
+ IfFileExists "$MINGW_INSTDIR\.qmake.cache" 0 +5
+ push "$MINGW_INSTDIR\.qmake.cache"
+ push ${MODULE_MINGW_BUILDDIR}
+ push $MINGW_INSTDIR
+ call PatchPath
+
+ IfFileExists "$MINGW_INSTDIR\mkspecs\default\qmake.conf" 0 +5
+ push "$MINGW_INSTDIR\mkspecs\default\qmake.conf"
+ push ${MODULE_MINGW_BUILDDIR}
+ push $MINGW_INSTDIR
+ call PatchPath
+
+ Push "bin"
+ push $MINGW_INSTDIR
+ call PatchCommonBinaryFiles
+
+ push $MINGW_INSTDIR
+ call PatchLicenseInformation
+
+ WriteRegStr SHCTX "SOFTWARE\Trolltech\Common\${MODULE_MINGW_VERSION}\$LICENSE_PRODUCT" "Key" "$LICENSE_KEY"
+
+ push $MINGW_INSTDIR
+ call ModuleMinGWMakeEnvFile
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION} Command Prompt.lnk" "%COMSPEC%" "/k $\"$MINGW_INSTDIR\bin\qtvars.bat$\""
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION} (Build Debug Libraries).lnk" "%COMSPEC%" "/k $\"$MINGW_INSTDIR\bin\qtvars.bat compile_debug$\""
+
+ push $0
+ strcmp $MODULE_MINGW_DOWNLOAD "no" DoneMinGWInstall
+ DetailPrint "Installing MinGW into $MODULE_MINGW_COMPILERINSTDIR"
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "MinGWInstDir" "$MODULE_MINGW_COMPILERINSTDIR"
+ nsExec::ExecToLog '"$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.exe" /S /D=$MODULE_MINGW_COMPILERINSTDIR'
+ pop $0
+ strcmp $MODULE_MINGW_SOURCEDOWNLOAD "no" DoneMinGWInstall
+ DetailPrint "Installing MinGW sources into $MODULE_MINGW_COMPILERINSTDIR\src"
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "MinGWSources" 1
+ nsExec::ExecToLog '"$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}-src.exe" /S /D=$MODULE_MINGW_COMPILERINSTDIR\src'
+ pop $0
+ DoneMinGWInstall:
+ pop $0
+
+ DetailPrint "Copying MinGW runtime..."
+ SetDetailsPrint none
+ CopyFiles /SILENT "$MODULE_MINGW_COMPILERINSTDIR\bin\${MODULE_MINGW_RUNTIME_LIB}" "$MINGW_INSTDIR\bin"
+ SetDetailsPrint both
+SectionEnd
+
+Function EnableButtons
+ Push $0
+ GetDlgItem $0 $HWNDPARENT 3
+ EnableWindow $0 1
+ GetDlgItem $0 $HWNDPARENT 1
+ EnableWindow $0 1
+ GetDlgItem $0 $HWNDPARENT 2
+ EnableWindow $0 1
+ Pop $0
+FunctionEnd
+
+Function DisableButtons
+ Push $0
+ GetDlgItem $0 $HWNDPARENT 3
+ EnableWindow $0 0
+ GetDlgItem $0 $HWNDPARENT 1
+ EnableWindow $0 0
+ GetDlgItem $0 $HWNDPARENT 2
+ EnableWindow $0 0
+ Pop $0
+FunctionEnd
+
+Function ModuleMinGWDownloadPageEnter
+ strcmp $MODULE_MINGW_INSTOK "yes" 0 +2
+ Abort
+
+ !insertmacro MUI_HEADER_TEXT "$(ModuleMinGWTitle)" "$(ModuleMinGWTitleDescription)"
+ Call UpdateCtrlStates
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_MINGW_DOWNLOADPAGE}"
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_MINGW_DOWNLOADPAGE}" "Field 8" "State" "0"
+FunctionEnd
+
+Function ModuleMinGWMirrorPageEnter
+ strcmp $MODULE_MINGW_DOWNLOAD "yes" +2
+ Abort
+
+ !insertmacro MUI_HEADER_TEXT "$(ModuleMinGWMirrorTitle)" "$(ModuleMinGWMirrorDescription)"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_MINGW_MIRRORPAGE}"
+FunctionEnd
+
+Function ModuleMinGWLicensePageEnter
+ strcmp $MODULE_MINGW_DOWNLOAD "yes" +2
+ Abort
+FunctionEnd
+
+Function UpdateCtrlStates
+ push $0
+ push $1
+ push $2
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_DOWNLOADPAGE}" "Field 8" "State"
+ intop $0 $0 !
+ FindWindow $2 "#32770" "" $HWNDPARENT
+ GetDlgItem $1 $2 1205
+ EnableWindow $1 $0
+ GetDlgItem $1 $2 1202
+ EnableWindow $1 $0
+ GetDlgItem $1 $2 1203
+ EnableWindow $1 $0
+
+ intop $0 $0 !
+ GetDlgItem $1 $2 1206
+ EnableWindow $1 $0
+ GetDlgItem $1 $2 1207
+ EnableWindow $1 $0
+ GetDlgItem $1 $2 1208
+ EnableWindow $1 $0
+
+ GetDlgItem $1 $HWNDPARENT 1
+ IntCmp $0 0 +3
+ SendMessage $1 ${WM_SETTEXT} 0 "STR:Next >"
+ Goto +2
+ SendMessage $1 ${WM_SETTEXT} 0 "STR:Install"
+
+ pop $2
+ pop $1
+ pop $0
+FunctionEnd
+
+Function ModuleMinGWDownloadPageExit
+ push $0
+ push $1
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_DOWNLOADPAGE}" "Settings" "State"
+ strcmp "$0" "8" 0 NoNotify
+ Call UpdateCtrlStates
+ abort
+ NoNotify:
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_DOWNLOADPAGE}" "Field 8" "State"
+ strcmp "$0" "0" noDownload doDownload
+
+doDownload:
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_DOWNLOADPAGE}" "Field 6" "State"
+ strcmp $0 "" 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "You need to specify an installation directory!"
+ goto tryAgain
+
+ strcpy $MODULE_MINGW_COMPILERINSTDIR $0
+ strcpy $MODULE_MINGW_DOWNLOAD "yes"
+ CreateDirectory "$MINGW_INSTDIR\downloads"
+
+ Call DisableButtons
+ InetLoad::load /BANNER "Mirror Download" "Downloading mirrors from server..." "${MODULE_MINGW_URL}/${MODULE_MINGW_DOWNLOADFILE}.mirrors" "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.mirrors" /END
+ Pop $1 ;Get the return value
+ Call EnableButtons
+
+ StrCmp $1 "OK" +3
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "Was not able to download mirror list ($1)." IDRETRY tryAgain 0
+ Quit
+
+ call ModuleMinGWReadMirrors
+ !insertmacro MUI_INSTALLOPTIONS_WRITE ${MODULE_MINGW_MIRRORPAGE} "Field 3" "ListItems" "$MODULE_MINGW_MIRRORS"
+ goto done
+
+noDownload:
+ strcpy $MODULE_MINGW_DOWNLOAD "no"
+ strcpy $MODULE_MINGW_SOURCEDOWNLOAD "no"
+ call ModuleMinGWChecking
+ strcmp $MODULE_MINGW_INSTOK "yes" done
+ MessageBox MB_ICONEXCLAMATION|MB_YESNO "There is a problem with your MinGW installation:$\r$\n$MODULE_MINGW_INSTOK$\r$\nDo you still want to continue? (Your installation may not work)" IDNO tryAgain
+ goto done
+
+tryAgain:
+ pop $1
+ pop $0
+ Abort
+
+done:
+ pop $1
+ pop $0
+FunctionEnd
+
+Function ModuleMinGWMirrorPageExit
+ push $0
+ push $2
+ push $1
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_MIRRORPAGE}" "Field 3" "State"
+ strcmp "$0" "" 0 +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "You must select a mirror to download from!"
+ goto tryAgain
+
+ push $0
+ call ModuleMinGWGetMirror
+ pop $0
+
+ Call DisableButtons
+ InetLoad::load /BANNER "MinGW Download" "Downloading MinGW from server..." "$0/${MODULE_MINGW_DOWNLOADFILE}.exe" "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.exe" /END
+ Pop $2 ;get the return value
+ Call EnableButtons
+
+ StrCmp $2 "OK" +3
+ MessageBox MB_ICONEXCLAMATION|MB_OK "Was not able to download MinGW ($2). Please try another mirror."
+ Goto tryAgain
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $1 "${MODULE_MINGW_MIRRORPAGE}" "Field 2" "State"
+ strcmp "$1" "0" done
+
+ Call DisableButtons
+ InetLoad::load /BANNER "MinGW Sources Download" "Downloading MinGW Sources from server..." "$0/${MODULE_MINGW_DOWNLOADFILE}-src.exe" "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}-src.exe" /END
+ Pop $2
+ Call EnableButtons
+
+ strcpy $MODULE_MINGW_SOURCEDOWNLOAD "yes"
+
+ StrCmp $2 "OK" +3
+ MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL "Was not able to download MinGW sources ($2). Please try another mirror?" IDRETRY tryAgain 0
+ Quit
+
+ goto done
+
+tryAgain:
+ pop $1
+ pop $2
+ pop $0
+ Abort
+
+done:
+ pop $1
+ pop $2
+ pop $0
+FunctionEnd
+
+Function ModuleMinGWReadMirrors
+ push $0 ;file handle
+ push $1 ;line
+
+ ClearErrors
+ FileOpen $0 "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.mirrors" r
+ IfErrors done
+
+ strcpy $MODULE_MINGW_MIRRORS ""
+
+nextline:
+ FileRead $0 $1
+ IfErrors done
+ push $1
+ call ModuleMinGWRemoveNewLine
+ pop $1
+ strcpy $MODULE_MINGW_MIRRORS "$MODULE_MINGW_MIRRORS|$1"
+ FileRead $0 $1 ;Jump over next line
+ IfErrors done
+ goto nextline
+
+done:
+ FileClose $0
+ strlen $1 $MODULE_MINGW_MIRRORS
+ intcmp $1 0 failed failed cleanup
+
+failed:
+ MessageBox MB_ICONSTOP|MB_OK "Unable to parse mirror list, exiting!"
+ Quit
+
+cleanup:
+ pop $1
+ pop $0
+FunctionEnd
+
+#this just removes the last two chars
+Function ModuleMinGWRemoveNewLine
+exch $0
+push $1
+push $2
+
+strlen $1 $0
+intop $1 $1 - 1
+strcpy $2 $0 1 $1 ;get last char
+
+strcmp "$2" "$\n" 0 +2
+intop $1 $1 - 1
+
+strcpy $2 $0 1 $1 ;get last char
+strcmp "$2" "$\r" 0 +2
+intop $1 $1 - 1
+
+intop $1 $1 + 1
+strcpy $0 $0 $1
+
+pop $2
+pop $1
+exch $0
+FunctionEnd
+
+#push serverid
+#call GetMirror
+#pop server
+Function ModuleMinGWGetMirror
+ exch $1 ;id
+ push $0 ;file handle
+ push $2 ;line
+ push $3 ;tmp
+
+ strcpy $3 ""
+
+ ClearErrors
+ FileOpen $0 "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.mirrors" r
+ IfErrors done
+
+nextline:
+ FileRead $0 $2
+ IfErrors done
+ push $2
+ call ModuleMinGWRemoveNewLine
+ pop $2
+ strcmp $1 $2 0 nextline
+ FileRead $0 $3
+ IfErrors done
+ push $3
+ call ModuleMinGWRemoveNewLine
+ pop $3
+
+done:
+ strcpy $1 $3
+ FileClose $0
+ strlen $2 $1
+ intcmp $2 0 failed failed cleanup
+
+failed:
+ MessageBox MB_ICONSTOP|MB_OK "Unable to parse mirror list, exiting!"
+ Quit
+
+cleanup:
+ pop $3
+ pop $2
+ pop $0
+ exch $1
+FunctionEnd
+
+Function ModuleMinGWChecking
+ push $0
+
+ ### update with plugin
+ strcpy $MODULE_MINGW_INSTOK "yes"
+ strcpy $MODULE_MINGW_COMPILERINSTDIR "C:\MinGW" ;fallback dir
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_MINGW_DOWNLOADPAGE}" "Field 3" "State"
+ strcmp "$0" "" +2
+ strcpy $MODULE_MINGW_COMPILERINSTDIR $0
+
+ IfFileExists "$MODULE_MINGW_COMPILERINSTDIR\bin\g++.exe" +3 0
+ strcpy $MODULE_MINGW_INSTOK "g++ not found in $MODULE_MINGW_COMPILERINSTDIR\bin\"
+ goto DoneChecking
+
+ ; check w32api.h
+ push $MODULE_MINGW_COMPILERINSTDIR
+ qtnsisext::HasValidWin32Library
+ pop $0
+ strcmp "$0" "1" +3 0
+ strcpy $MODULE_MINGW_INSTOK "The installer could not find a valid $MODULE_MINGW_COMPILERINSTDIR\include\w32api.h$\r$\n(The supported version is 3.2)"
+ goto DoneChecking
+
+ ; check version
+ push $MODULE_MINGW_COMPILERINSTDIR
+ qtnsisext::GetMinGWVersion
+ pop $0
+ strcmp "$0" "${MODULE_MINGW_COMPILERVERSION}" +3 0
+ strcpy $MODULE_MINGW_INSTOK "g++ version found does not match ${MODULE_MINGW_COMPILERVERSION} (Found version $0)."
+ goto DoneChecking
+
+DoneChecking:
+ pop $0
+FunctionEnd
+
+#
+# creates a qtvars.bat file in $QTDIR\bin
+# push "c:\qt" #QTDIR
+# call ModuleMinGWMakeEnvFile
+#
+Function ModuleMinGWMakeEnvFile
+ push $0 ; file handle
+
+ ClearErrors
+ FileOpen $0 "$MINGW_INSTDIR\bin\qtvars.bat" w
+ IfErrors WriteMakeFile
+ FileWrite $0 "@echo off$\r$\n"
+ FileWrite $0 "rem$\r$\n"
+ FileWrite $0 "rem This file is generated$\r$\n"
+ FileWrite $0 "rem$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "echo Setting up a MinGW/Qt only environment...$\r$\n"
+ FileWrite $0 "echo -- QTDIR set to $MINGW_INSTDIR$\r$\n"
+ FileWrite $0 "echo -- PATH set to $MINGW_INSTDIR\bin$\r$\n"
+ FileWrite $0 "echo -- Adding $MODULE_MINGW_COMPILERINSTDIR\bin to PATH$\r$\n"
+ FileWrite $0 "echo -- Adding %SystemRoot%\System32 to PATH$\r$\n"
+ FileWrite $0 "echo -- QMAKESPEC set to win32-g++$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "set QTDIR=$MINGW_INSTDIR$\r$\n"
+ FileWrite $0 "set PATH=$MINGW_INSTDIR\bin$\r$\n"
+ FileWrite $0 "set PATH=%PATH%;$MODULE_MINGW_COMPILERINSTDIR\bin$\r$\n"
+ FileWrite $0 "set PATH=%PATH%;%SystemRoot%\System32$\r$\n"
+ FileWrite $0 "set QMAKESPEC=win32-g++$\r$\n"
+ FileWrite $0 "$\r$\n"
+
+ FileWrite $0 'if not "%1"=="compile_debug" goto END$\r$\n'
+ FileWrite $0 "cd %QTDIR%$\r$\n"
+ FileWrite $0 "echo This will configure and compile qt in debug.$\r$\n"
+ FileWrite $0 "echo The release libraries will not be recompiled.$\r$\n"
+ FileWrite $0 "pause$\r$\n"
+ FileWrite $0 "configure -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg$\r$\n"
+ FileWrite $0 "cd %QTDIR%\src$\r$\n"
+ FileWrite $0 "qmake$\r$\n"
+ FileWrite $0 "mingw32-make debug$\r$\n"
+ FileWrite $0 ":END$\r$\n"
+ FileClose $0
+
+WriteMakeFile:
+ ClearErrors
+ FileOpen $0 "$MINGW_INSTDIR\bin\make.bat" w
+ IfErrors done
+ FileWrite $0 "@echo off$\r$\n"
+ FileWrite $0 "mingw32-make %*$\r$\n"
+ FileClose $0
+
+done:
+; pop $1
+ pop $0
+FunctionEnd
+
+Function MINGW_ValidateDirectoryFunc
+ push "${MODULE_MINGW_BUILDDIR}"
+ push $MINGW_INSTDIR
+ call CommonCheckDirectory
+FunctionEnd
+!macroend
+
+!macro MINGW_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${MINGW_SEC01} "This installs ${MODULE_MINGW_NAME} version ${MODULE_MINGW_VERSION} on your system."
+!macroend
+
+!macro MINGW_STARTUP
+ !ifndef MODULE_MINGW_NODEFAULT
+ SectionSetFlags ${MINGW_SEC01} 17
+ !endif
+ strcpy $MINGW_INSTDIR "C:\Qt\${MODULE_MINGW_VERSION}"
+ push $MINGW_INSTDIR
+ call MakeQtDirectory
+ pop $MINGW_INSTDIR
+
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_MINGW_DOWNLOADPAGE}"
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_MINGW_MIRRORPAGE}"
+
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_MINGW_DOWNLOADPAGE}" "Field 3" "State" "C:\MinGW"
+ !insertmacro MUI_INSTALLOPTIONS_WRITE "${MODULE_MINGW_DOWNLOADPAGE}" "Field 6" "State" "C:\MinGW"
+
+ strcpy $MODULE_MINGW_DOWNLOAD "no"
+ strcpy $MODULE_MINGW_SOURCEDOWNLOAD "no"
+!macroend
+
+!macro MINGW_FINISH
+!macroend
+
+!macro MINGW_RUN_FUNCTION
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MINGWInstalled"
+ intcmp $0 1 0 DoneRunFunctionMINGW
+
+ IfFileExists "$MINGW_INSTDIR\bin\qtdemo.exe" 0 +2
+ Exec '$MINGW_INSTDIR\bin\qtdemo.exe'
+ goto DoneRunFunction ;don't run more applications
+
+ DoneRunFunctionMINGW:
+!macroend
+
+!macro MINGW_README_FUNCTION
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MINGWInstalled"
+ intcmp $0 1 0 DoneReadmeFunctionMINGW
+
+ IfFileExists "$MINGW_INSTDIR\bin\assistant.exe" 0 +2
+ Exec '$MINGW_INSTDIR\bin\assistant.exe'
+ goto DoneReadmeFunction ;don't run more applications
+
+ DoneReadmeFunctionMINGW:
+!macroend
+
+!macro MINGW_UNSTARTUP
+ strcmp "$MINGW_INSTDIR" "" 0 +5
+ StrCpy $MINGW_INSTDIR "$INSTDIR\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION}"
+ push $MINGW_INSTDIR
+ call un.MakeQtDirectory
+ pop $MINGW_INSTDIR
+
+ !insertmacro ConfirmOnRemove "MINGWInstalled" "- ${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION} in $MINGW_INSTDIR"
+!macroend
+
+!macro MINGW_UNINSTALL
+Section un.ModuleMinGW
+ push $0
+ push $1
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MINGWInstalled"
+ intcmp $0 1 0 DoneUnInstallMINGW
+
+ Delete "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.mirrors"
+
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MinGWSources"
+ strcmp $0 "" MinGWSourcesUninstallDone ;not installed
+ Delete "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}-src.exe"
+ nsExec::ExecToLog '"$0\src\uninst.exe"'
+ pop $1
+ MinGWSourcesUninstallDone:
+
+ ReadRegStr $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MinGWInstDir"
+ strcmp $0 "" MinGWUninstallDone ;not installed
+ Delete "$MINGW_INSTDIR\downloads\${MODULE_MINGW_DOWNLOADFILE}.exe"
+ nsExec::ExecToLog '"$0\uninst.exe"'
+ pop $1
+ MinGWUninstallDone:
+
+ DetailPrint "Removing start menu shortcuts"
+ call un.RemoveStartmenuApplication
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION} Command Prompt.lnk"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MINGW_NAME} ${MODULE_MINGW_VERSION} (Build Debug Libraries).lnk"
+
+ Delete "$MINGW_INSTDIR\bin\${MODULE_MINGW_RUNTIME_LIB}"
+ Delete "$MINGW_INSTDIR\bin\make.bat"
+ Delete "$MINGW_INSTDIR\bin\qtvars.bat"
+
+ !insertmacro MODULE_MINGW_REMOVE "$MINGW_INSTDIR"
+ RMDir $MINGW_INSTDIR ;removes it if empty
+
+ DoneUnInstallMINGW:
+ pop $1
+ pop $0
+SectionEnd
+!macroend
+!macro MINGW_UNFINISH
+!macroend
+!else ;MODULE_MINGW
+!macro MINGW_INITIALIZE
+!macroend
+!macro MINGW_SECTIONS
+!macroend
+!macro MINGW_DESCRIPTION
+!macroend
+!macro MINGW_STARTUP
+!macroend
+!macro MINGW_FINISH
+!macroend
+!macro MINGW_RUN_FUNCTION
+!macroend
+!macro MINGW_README_FUNCTION
+!macroend
+!macro MINGW_UNSTARTUP
+!macroend
+!macro MINGW_UNINSTALL
+!macroend
+!macro MINGW_UNFINISH
+!macroend
+!endif ;MODULE_MINGW
+
diff --git a/util/scripts/win-binary/nsis/modules/msvc.nsh b/util/scripts/win-binary/nsis/modules/msvc.nsh
new file mode 100644
index 0000000..5c52ec4
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/msvc.nsh
@@ -0,0 +1,439 @@
+!ifdef MODULE_MSVC
+
+!include "includes\system.nsh"
+
+!macro MSVC_INITIALIZE
+!include "includes\qtcommon.nsh"
+!ifndef MODULE_MSVC_NAME
+ !define MODULE_MSVC_NAME "Qt"
+!endif
+!ifndef MODULE_MSVC_VERSION
+ !define MODULE_MSVC_VERSION "${PRODUCT_VERSION}"
+!endif
+!ifndef MODULE_MSVC_BUILDDIR
+ !error "MODULE_MSVC_BUILDDIR not defined!"
+!endif
+var MSVC_QtDesktopInstallBuildTree
+!include "includes\qtenv.nsh"
+!macroend
+
+!macro MSVC_PATCH_QT_INSTALLATION QtBuildTree QtInstallBuildTree QtSourceTree QtInstallSourceTree DLLPDBDirName
+ Push "${QtInstallBuildTree}"
+ Call DeleteFloatingLicenseProgram
+
+ Push "${QtInstallBuildTree}\bin"
+ Call AddStartmenuApplication
+
+ Push "${QtBuildTree}"
+ Push "${QtInstallBuildTree}"
+ Call PatchPrlFiles
+
+ ${If} ${FileExists} "${QtInstallBuildTree}\.qmake.cache"
+ Push "${QtInstallBuildTree}\.qmake.cache"
+ Push "${QtBuildTree}"
+ Push "${QtInstallBuildTree}"
+ Call PatchPath
+ ${If} "${QtInstallBuildTree}" != "${QtInstallSourceTree}"
+ Push "${QtInstallBuildTree}\.qmake.cache"
+ Push "${QtSourceTree}"
+ Push "${QtInstallSourceTree}"
+ Call PatchPath
+ ${EndIf}
+ ${EndIf}
+
+ ${If} ${FileExists} "${QtInstallBuildTree}\mkspecs\default\qmake.conf"
+ Push "${QtInstallBuildTree}\mkspecs\default\qmake.conf"
+ Push "${QtSourceTree}"
+ Push "${QtInstallSourceTree}"
+ Call PatchPath
+ ${EndIf}
+
+ Push "${DLLPDBDirName}"
+ Push "${QtInstallBuildTree}"
+ Call PatchCommonBinaryFiles
+
+!ifndef MODULE_MSVC_SKIPPATCHLICENSEINFORMATION
+ Push "${QtInstallBuildTree}"
+ Call PatchLicenseInformation
+!endif
+
+ Push "${DLLPDBDirName}"
+ Push "${QtBuildTree}"
+ Push "${QtInstallBuildTree}"
+ Call PatchMSVCBinaryFiles
+ ${If} "${QtInstallBuildTree}" != "${QtInstallSourceTree}"
+ Push "${DLLPDBDirName}"
+ Push "${QtSourceTree}"
+ Push "${QtInstallSourceTree}"
+ Call PatchMSVCBinaryFiles
+ ${EndIf}
+!macroend ;MSVC_PATCH_QT_INSTALLATION
+
+!macro MSVC_POST_WIN32_INSTALLFILES QtBuildTree QtInstallBuildTree QtSourceTree QtInstallSourceTree VersionName
+ !insertmacro MSVC_PATCH_QT_INSTALLATION \
+ "${QtBuildTree}" \
+ "${QtInstallBuildTree}" \
+ "${QtSourceTree}" \
+ "${QtInstallSourceTree}" \
+ "bin"
+
+ Push "${VersionName}"
+ Push "${QtInstallBuildTree}"
+ Call MSVC_AddQtVersionToRegistry
+
+ Push "${INSTALL_COMPILER}"
+ Push "${QtInstallBuildTree}"
+ Push ""
+ Push "${VersionName}"
+ Call MSVC_CreateQtVarsBatAndShortcut
+
+ StrCpy $MSVC_QtDesktopInstallBuildTree "${QtInstallBuildTree}"
+!macroend ;MSVC_POST_WIN32_INSTALLFILES
+
+!macro MSVC_POST_WINCE_INSTALLFILES QtBuildTree QtInstallBuildTree QtSourceTree QtInstallSourceTree VersionName WinCESDK
+ !insertmacro MSVC_PATCH_QT_INSTALLATION \
+ "${QtBuildTree}" \
+ "${QtInstallBuildTree}" \
+ "${QtSourceTree}" \
+ "${QtInstallSourceTree}" \
+ "lib"
+
+ Push "${VersionName}"
+ Push "${QtInstallBuildTree}"
+ Call MSVC_AddQtVersionToRegistry
+
+ Push "${INSTALL_COMPILER}ce"
+ Push "${QtInstallBuildTree}"
+ Push "${WinCESDK}"
+ Push "${VersionName}"
+ Call MSVC_CreateQtVarsBatAndShortcut
+!macroend ;MSVC_POST_WINCE_INSTALLFILES
+
+!macro MSVC_PATCH_MSVC_BINARY_FILE BinaryFile QtBuildDir QtInstallDir
+ ${If} ${FileExists} "${BinaryFile}"
+ DetailPrint "Patching ${BinaryFile} (${QtInstallDir})..."
+!ifdef MODULE_MSVC_VC60
+ qtnsisext::PatchVC6Binary "${BinaryFile}" "${QtBuildDir}" "${QtInstallDir}"
+!else
+ qtnsisext::PatchVC7Binary "${BinaryFile}" "${QtBuildDir}" "${QtInstallDir}"
+!endif
+ ${EndIf}
+!macroend
+
+!macro MSVC_SECTIONS
+Section "${MODULE_MSVC_NAME} ${MODULE_MSVC_VERSION}" MSVC_SEC01
+ ${If} "$MSVC_INSTDIR" == ""
+ StrCpy $MSVC_INSTDIR "$INSTDIR\${MODULE_MSVC_NAME} ${MODULE_MSVC_VERSION}"
+ Push $MSVC_INSTDIR
+ Call MakeQtDirectory
+ Pop $MSVC_INSTDIR
+ ${EndIf}
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "MSVCInstalled" 1
+
+ SetOutPath "$MSVC_INSTDIR"
+ SetOverwrite ifnewer
+ !insertmacro MODULE_MSVC_INSTALLFILES
+
+!ifdef MODULE_MSVC_WIN32BUILDTREE & MODULE_MSVC_WIN32BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_WIN32_INSTALLFILES \
+ "${MODULE_MSVC_WIN32BUILDTREE}" /* QtBuildTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_WIN32BUILDINSTALLDIRNAME}" /* QtInstallBuildTree */ \
+ "${MODULE_MSVC_QTSOURCETREE}" /* QtSourceTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_QTSOURCEINSTALLDIRNAME}" /* QtInstallSourceTree */ \
+ "${MODULE_MSVC_VERSION} Desktop" /* VersionName */
+!endif
+!ifdef MODULE_MSVC_WM50BUILDTREE & MODULE_MSVC_WM50BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_WINCE_INSTALLFILES \
+ "${MODULE_MSVC_WM50BUILDTREE}" /* QtBuildTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_WM50BUILDINSTALLDIRNAME}" /* QtInstallBuildTree */ \
+ "${MODULE_MSVC_QTSOURCETREE}" /* QtSourceTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_QTSOURCEINSTALLDIRNAME}" /* QtInstallSourceTree */ \
+ "${MODULE_MSVC_VERSION} ${MODULE_MSVC_WM50VERSIONPRETTY}" /* VersionName */ \
+ ${MODULE_MSVC_WM50SDK} /* WinCESDK */
+!endif
+!ifdef MODULE_MSVC_SSDK50X86BUILDTREE & MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_WINCE_INSTALLFILES \
+ "${MODULE_MSVC_SSDK50X86BUILDTREE}" /* QtBuildTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME}" /* QtInstallBuildTree */ \
+ "${MODULE_MSVC_QTSOURCETREE}" /* QtSourceTree */ \
+ "$MSVC_INSTDIR\${MODULE_MSVC_QTSOURCEINSTALLDIRNAME}" /* QtInstallSourceTree */ \
+ "${MODULE_MSVC_VERSION} ${MODULE_MSVC_SSDK50X86VERSIONPRETTY}" /* VersionName */ \
+ ${MODULE_MSVC_SSDK50X86SDK} /* WinCESDK */
+!endif
+!ifndef MODULE_MSVC_WIN32BUILDTREE | MODULE_MSVC_WM50BUILDTREE | MODULE_MSVC_QTSOURCETREE | MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_WIN32_INSTALLFILES \
+ "${MODULE_MSVC_BUILDDIR}" /* QtBuildTree */ \
+ "$MSVC_INSTDIR" /* QtInstallBuildTree */ \
+ "${MODULE_MSVC_BUILDDIR}" /* QtSourceTree */ \
+ "$MSVC_INSTDIR" /* QtInstallSourceTree */ \
+ "${MODULE_MSVC_VERSION}" /* VersionName */
+!endif
+
+!ifdef MODULE_LICENSECHECK
+ WriteRegStr SHCTX "SOFTWARE\Trolltech\Common\${MODULE_MSVC_VERSION}\$LICENSE_PRODUCT" "Key" "$LICENSE_KEY"
+ call MSVC_UpdateExistingVsipLicenseKeys
+!endif
+
+SectionEnd
+
+Function PatchMSVCBinaryFiles
+ Exch $0 ; Absolute path to where Qt is installed
+ Exch
+ Exch $1 ; Absolute path to where Qt was built
+ Exch
+ Exch 2
+ Exch $2 ; Name of directory containing PDBs
+ Exch 2
+ Push $3 ; FindFirst/FindNext handle
+ Push $4 ; Found .pdb file name
+
+ FindFirst $3 $4 "$0\$2\*.pdb"
+ ${DoWhile} $4 != ""
+ !insertmacro MSVC_PATCH_MSVC_BINARY_FILE "$0\$2\$4" "$1" "$0"
+ FindNext $3 $4
+ ${Loop}
+
+ !insertmacro MSVC_PATCH_MSVC_BINARY_FILE "$0\lib\qtmaind.lib" "$1" "$0"
+
+ Pop $4
+ Pop $3
+ Pop $0
+ Pop $1
+ Pop $2
+FunctionEnd
+
+Function MSVC_AddQtVersionToRegistry
+ Exch $0 ; VersionDir
+ Exch
+ Exch $1 ; VersionName
+ Exch
+ Push $2
+
+ WriteRegStr HKCU "${QT_VERSION_KEY_NAME}\$1\" "InstallDir" "$0"
+ ${If} "$RUNNING_AS_ADMIN" == true
+ WriteRegStr HKLM "${QT_VERSION_KEY_NAME}\$1\" "InstallDir" "$0"
+ ${EndIf}
+
+ ReadRegStr $2 HKCU "${QT_VERSION_KEY_NAME}" "DefaultQtVersion"
+ ${If} $2 == ""
+ WriteRegStr HKCU "${QT_VERSION_KEY_NAME}" "DefaultQtVersion" "$1"
+ ${EndIf}
+
+ Pop $2
+ Pop $0
+ Pop $1
+FunctionEnd ;MSVC_AddQtVersionToRegistry
+
+Function MSVC_CreateQtVarsBatAndShortcut
+ Exch $0 ; VersionName
+ Exch
+ Exch $1 ; WinCESDK
+ Exch
+ Exch 2
+ Exch $2 ; QtBuildTree
+ Exch 2
+ Exch 3
+ Exch $3 ; Compiler
+ Exch 3
+ Push $4 ; Found substring "command.com"
+ Push $5 ; Expanded %COMSPEC%
+
+ ${If} ${FileExists} "$2\bin\qmake.exe"
+ !insertmacro MAKE_QTVARS_FILE "$3" "$2" "$1"
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\Visual Studio with ${MODULE_MSVC_NAME} $0.lnk" "$2\bin\qtvars.bat" "vsstart"
+
+ ExpandEnvStrings $5 "%COMSPEC%"
+ ${StrStr} $4 "$5" "command.com"
+ ${If} "$4" == ""
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MSVC_NAME} $0 Command Prompt.lnk" "%COMSPEC%" "/k $\"$2\bin\qtvars.bat vsvars$\""
+ ${Else}
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MSVC_NAME} $0 Command Prompt.lnk" "%COMSPEC%" "/e:4096 /k $\"$2\bin\qtvars.bat vsvars$\""
+ ${EndIf}
+ ${EndIf}
+
+ Pop $5
+ Pop $4
+ Pop $0
+ Pop $1
+ Pop $2
+ Pop $3
+FunctionEnd ;MSVC_CreateQtVarsBatAndShortcut
+
+Function MSVC_ValidateDirectoryFunc
+ push "${MODULE_MSVC_BUILDDIR}"
+ push $MSVC_INSTDIR
+ call CommonCheckDirectory
+FunctionEnd
+
+Function MSVC_UpdateExistingVsipLicenseKeys
+ Push $0 ; EnumRegKey loop index
+ Push $1 ; Reg key
+ Push $2 ; StrStr result
+
+ StrCpy $0 0
+ loop:
+ EnumRegKey $1 SHCTX SOFTWARE\Trolltech $0
+ StrCmp $1 "" no_reg_key_found
+ ${StrStr} $2 $1 "Qt4VS"
+ StrCmp $2 $1 0 +1
+ WriteRegStr SHCTX "SOFTWARE\Trolltech\$2" "LicenseKey" "$LICENSE_KEY"
+ IntOp $0 $0 + 1
+ goto loop
+ no_reg_key_found:
+
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+!macroend
+
+!macro MSVC_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${MSVC_SEC01} "This installs ${MODULE_MSVC_NAME} version ${MODULE_MSVC_VERSION} on your system."
+!macroend
+
+!macro MSVC_STARTUP
+ !ifdef MODULE_MSVC_VS2005
+ Call IsVS2005SP1Installed
+ Pop $1
+ ${If} $1 == 0
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack 1 for Visual Studio 2005 is not installed.$\n${PRODUCT_NAME} for VS 2005 will not work properly without it."
+ Abort
+ ${EndIf}
+ !endif
+
+ !ifndef MODULE_MSVC_NODEFAULT
+ SectionSetFlags ${MSVC_SEC01} 17
+ !endif
+ strcpy $MSVC_INSTDIR "C:\Qt\${MODULE_MSVC_VERSION}"
+ push $MSVC_INSTDIR
+ call MakeQtDirectory
+ pop $MSVC_INSTDIR
+!macroend
+
+!macro MSVC_FINISH
+!macroend
+
+!macro MSVC_RUN_FUNCTION
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MSVCInstalled"
+ ${If} $0 == 1
+ ${If} ${FileExists} "$MSVC_QtDesktopInstallBuildTree\bin\qtdemo.exe"
+ Exec '$MSVC_QtDesktopInstallBuildTree\bin\qtdemo.exe'
+ ${EndIf}
+ Goto DoneRunFunction ;don't run more applications
+ ${EndIf}
+!macroend
+
+!macro MSVC_README_FUNCTION
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MSVCInstalled"
+ ${If} $0 == 1
+ ${If} ${FileExists} "$MSVC_QtDesktopInstallBuildTree\bin\assistant.exe"
+!ifndef README_STARTPAGE
+ Exec "$MSVC_QtDesktopInstallBuildTree\bin\assistant.exe"
+!else
+ Exec "$MSVC_QtDesktopInstallBuildTree\bin\assistant.exe -showurl $\"${README_STARTPAGE}$\""
+!endif
+ ${EndIf}
+ Goto DoneReadmeFunction ;don't run more applications
+ ${EndIf}
+!macroend
+
+!macro MSVC_UNSTARTUP
+ ${If} "$MSVC_INSTDIR" == ""
+ StrCpy $MSVC_INSTDIR "$INSTDIR\${MODULE_MSVC_NAME} ${MODULE_MSVC_VERSION}"
+ Push $MSVC_INSTDIR
+ Call un.MakeQtDirectory
+ Pop $MSVC_INSTDIR
+ ${EndIf}
+
+ !insertmacro ConfirmOnRemove "MSVCInstalled" "- ${MODULE_MSVC_NAME} ${MODULE_MSVC_VERSION} in $MSVC_INSTDIR"
+!macroend
+
+!macro MSVC_POST_UNINSTALLFILES QtInstallBuildTree VersionName
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Visual Studio with ${MODULE_MSVC_NAME} ${VersionName}.lnk"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\${MODULE_MSVC_NAME} ${VersionName} Command Prompt.lnk"
+ Delete "${QtInstallBuildTree}\bin\qtvars.bat"
+
+ Push "${VersionName}"
+ Push "${QtInstallBuildTree}"
+ Call un.MSVC_RemoveQtVersionFromRegistry
+!macroend ;MSVC_POST_UNINSTALLFILES
+
+!macro MSVC_UNINSTALL
+Section un."${MODULE_MSVC_NAME} ${MODULE_MSVC_VERSION}"
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "MSVCInstalled"
+ ${If} $0 == 1
+ DetailPrint "Removing start menu shortcuts and registry entries"
+ Call un.RemoveStartmenuApplication
+!ifdef MODULE_MSVC_WIN32BUILDTREE & MODULE_MSVC_WIN32BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_UNINSTALLFILES \
+ "$MSVC_INSTDIR\${MODULE_MSVC_WIN32BUILDINSTALLDIRNAME}" \
+ "${MODULE_MSVC_VERSION} Desktop"
+!endif
+!ifdef MODULE_MSVC_WM50BUILDTREE & MODULE_MSVC_WM50BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_UNINSTALLFILES \
+ "$MSVC_INSTDIR\${MODULE_MSVC_WM50BUILDINSTALLDIRNAME}" \
+ "${MODULE_MSVC_VERSION} ${MODULE_MSVC_WM50VERSIONPRETTY}"
+!endif
+!ifdef MODULE_MSVC_SSDK50X86BUILDTREE & MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME & MODULE_MSVC_QTSOURCETREE & MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_UNINSTALLFILES \
+ "$MSVC_INSTDIR\${MODULE_MSVC_SSDK50X86BUILDINSTALLDIRNAME}" \
+ "${MODULE_MSVC_VERSION} ${MODULE_MSVC_SSDK50X86VERSIONPRETTY}"
+!endif
+!ifndef MODULE_MSVC_WIN32BUILDTREE | MODULE_MSVC_WM50BUILDTREE | MODULE_MSVC_QTSOURCETREE | MODULE_MSVC_QTSOURCEINSTALLDIRNAME
+ !insertmacro MSVC_POST_UNINSTALLFILES \
+ "$MSVC_INSTDIR" \
+ "${MODULE_MSVC_VERSION}"
+!endif
+ !insertmacro MODULE_MSVC_REMOVE "$MSVC_INSTDIR"
+ RMDir $MSVC_INSTDIR ;removes it if empty
+ ${EndIf}
+SectionEnd
+
+Function un.MSVC_RemoveQtVersionFromRegistry
+ Exch $0 ; QtInstallBuildTree
+ Exch
+ Exch $1 ; VersionName
+ Exch
+ Push $2 ; Temp
+
+ ReadRegStr $2 HKCU "${QT_VERSION_KEY_NAME}\$1" "InstallDir"
+ ${If} "$2" == "$0"
+ DeleteRegKey HKCU "${QT_VERSION_KEY_NAME}\$1"
+ ${EndIf}
+
+ ReadRegStr $2 HKLM "${QT_VERSION_KEY_NAME}\$1" "InstallDir"
+ ${If} "$2" == "$0"
+ DeleteRegKey HKLM "${QT_VERSION_KEY_NAME}\$1"
+ ${EndIf}
+
+ Pop $2
+ Pop $0
+ Pop $1
+FunctionEnd
+!macroend
+!macro MSVC_UNFINISH
+!macroend
+!else ;MODULE_MSVC
+!macro MSVC_INITIALIZE
+!macroend
+!macro MSVC_SECTIONS
+!macroend
+!macro MSVC_DESCRIPTION
+!macroend
+!macro MSVC_STARTUP
+!macroend
+!macro MSVC_FINISH
+!macroend
+!macro MSVC_README_FUNCTION
+!macroend
+!macro MSVC_RUN_FUNCTION
+!macroend
+!macro MSVC_UNSTARTUP
+!macroend
+!macro MSVC_UNINSTALL
+!macroend
+!macro MSVC_UNFINISH
+!macroend
+!endif ;MODULE_MSVC
+
diff --git a/util/scripts/win-binary/nsis/modules/opensource.nsh b/util/scripts/win-binary/nsis/modules/opensource.nsh
new file mode 100644
index 0000000..19f154d
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/opensource.nsh
@@ -0,0 +1,56 @@
+!ifdef MODULE_OPENSOURCE
+!macro OPENSOURCE_INITIALIZE
+ !define MODULE_OPENSOURCE_PAGE "opensource.ini"
+ page custom ModuleOpenSourceShowPage
+!macroend
+!macro OPENSOURCE_SECTIONS
+ Section -ModuleOpenSourceSection
+ !ifdef MODULE_OPENSOURCE_ROOT
+ SetOutPath "$INSTDIR"
+ File "${MODULE_OPENSOURCE_ROOT}\OPENSOURCE-NOTICE.TXT"
+ !endif
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\OpenSource Notice.lnk" "$INSTDIR\OPENSOURCE-NOTICE.TXT"
+ SectionEnd
+
+ Function ModuleOpenSourceShowPage
+ !insertmacro MUI_HEADER_TEXT "Open Source Edition" " "
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_OPENSOURCE_PAGE}"
+ strcpy "$LICENSEE" "Open Source"
+ strcpy "$LICENSE_PRODUCT" "OpenSource"
+ FunctionEnd
+!macroend
+!macro OPENSOURCE_DESCRIPTION
+!macroend
+!macro OPENSOURCE_STARTUP
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_OPENSOURCE_PAGE}"
+!macroend
+!macro OPENSOURCE_FINISH
+!macroend
+!macro OPENSOURCE_UNSTARTUP
+!macroend
+!macro OPENSOURCE_UNINSTALL
+ Section -un.ModuleOpenSourceSection
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\OpenSource Notice.lnk"
+ SectionEnd
+!macroend
+!macro OPENSOURCE_UNFINISH
+!macroend
+!else ;MODULE_OPENSOURCE
+!macro OPENSOURCE_INITIALIZE
+!macroend
+!macro OPENSOURCE_SECTIONS
+!macroend
+!macro OPENSOURCE_DESCRIPTION
+!macroend
+!macro OPENSOURCE_STARTUP
+!macroend
+!macro OPENSOURCE_FINISH
+!macroend
+!macro OPENSOURCE_UNSTARTUP
+!macroend
+!macro OPENSOURCE_UNINSTALL
+!macroend
+!macro OPENSOURCE_UNFINISH
+!macroend
+!endif ;MODULE_OPENSOURCE
+
diff --git a/util/scripts/win-binary/nsis/modules/qsa.nsh b/util/scripts/win-binary/nsis/modules/qsa.nsh
new file mode 100644
index 0000000..ab74300
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/qsa.nsh
@@ -0,0 +1,255 @@
+!ifdef MODULE_QSA
+!macro QSA_INITIALIZE
+ !include "includes\qtenv.nsh"
+ !define MODULE_QSA_OPTIONPAGE "qsa.ini"
+ !ifndef MODULE_QSA_NAME
+ !define MODULE_QSA_NAME "QSA"
+ !endif
+ !ifndef MODULE_QSA_VERSION
+ !define MODULE_QSA_VERSION ${PRODUCT_VERSION}
+ !endif
+ !ifndef MODULE_QSA_ROOT
+ !define MODULE_QSA_ROOT "${INSTALL_ROOT}\qsa"
+ !endif
+ !ifndef MODULE_QSA_INTEGRATE
+ !include "includes\qtdir.nsh"
+ !insertmacro QTDIR_INITIALIZE
+ !endif
+
+ var MODULE_QSA_NOIDE
+ var MODULE_QSA_NOEDITOR
+
+ LangString ModuleQSATitle ${LANG_ENGLISH} "${MODULE_QSA_NAME} ${MODULE_QSA_VERSION} Build Options"
+ LangString ModuleQSADescription ${LANG_ENGLISH} "Do you want build the QSA Workbench and the QSA Editor?"
+ Page custom ModuleQSAOptionsPageEnter ModuleQSAOptionsPageExit
+!macroend
+!macro QSA_SECTIONS
+ Section "${MODULE_QSA_NAME} ${MODULE_QSA_VERSION}" QSA_SEC01
+ push $0
+ strcmp "$QSA_INSTDIR" "" 0 +2
+ StrCpy $QSA_INSTDIR "$INSTDIR\${MODULE_QSA_NAME} ${MODULE_QSA_VERSION}"
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QSAInstalled" 1
+
+ SetOutPath "$QSA_INSTDIR"
+ SetOverwrite ifnewer
+ File /r "${MODULE_QSA_ROOT}\*.*"
+
+ call QsaModuleWriteBuildFile
+
+ DetailPrint "Please wait while building ${MODULE_QSA_NAME} ${MODULE_QSA_VERSION}..."
+ nsExec::ExecToLog "$QSA_INSTDIR\qsabuild.bat"
+ pop $0
+ strcmp "$0" "0" +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Building ${MODULE_QSA_NAME} ${MODULE_QSA_VERSION} failed.$\r$\nLook at the output, resolve the problem, and try to rebuild it manually.$\r$\n(errorcode: $0)"
+
+ call ModuleQSAAddShortCuts
+
+ pop $0
+ SectionEnd
+
+ !ifndef MODULE_QSA_INTEGRATE
+ !insertmacro QTDIR_FUNCTIONS
+ !endif
+
+ Function ModuleQSAOptionsPageEnter
+ !insertmacro MUI_HEADER_TEXT "$(ModuleQSATitle)" "$(ModuleQSADescription)"
+ push $0
+ ${strstr} $0 "$QTDIR_SELECTED" "4.0.0"
+ strcmp $0 "" +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION "QSA 1.2.0 requires Qt 4.0.1 snapshots or later"
+ pop $0
+
+
+ strcmp "$MODULE_QSA_NOIDE" "" +3
+ !insertmacro MUI_INSTALLOPTIONS_WRITE ${MODULE_QSA_OPTIONPAGE} "Field 2" "State" "1"
+ goto +2
+ !insertmacro MUI_INSTALLOPTIONS_WRITE ${MODULE_QSA_OPTIONPAGE} "Field 2" "State" "0"
+
+ strcmp "$MODULE_QSA_NOEDITOR" "" +3
+ !insertmacro MUI_INSTALLOPTIONS_WRITE ${MODULE_QSA_OPTIONPAGE} "Field 3" "State" "1"
+ goto +2
+ !insertmacro MUI_INSTALLOPTIONS_WRITE ${MODULE_QSA_OPTIONPAGE} "Field 3" "State" "0"
+
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_QSA_OPTIONPAGE}"
+ FunctionEnd
+
+Function ModuleQSAAddShortCuts
+ push $0
+ push $1
+ push $2
+ push $3
+
+ !insertmacro CreateConditionalShortCutDirectory "$SMPROGRAMS\$STARTMENU_STRING\Examples"
+
+ FindFirst $0 $1 "$QSA_INSTDIR\examples\*.*"
+loop:
+ StrCmp $1 "" done
+ IfFileExists "$QSA_INSTDIR\examples\$1\release\$1.exe" 0 +3
+ strcpy $2 "release"
+ goto +3
+ IfFileExists "$QSA_INSTDIR\examples\$1\debug\$1.exe" 0 example_shortcuts_next
+ strcpy $2 "debug"
+
+ FileOpen $3 "$QSA_INSTDIR\examples\$1\$1.bat" w
+ IfErrors example_shortcuts_next
+ FileWrite $3 "@rem ----------------------$\r$\n"
+ FileWrite $3 "@rem This file is generated$\r$\n"
+ FileWrite $3 "@rem ----------------------$\r$\n"
+ FileWrite $3 "$\r$\n"
+ FileWrite $3 "set PATH=$QTDIR_SELECTED\bin;%PATH%$\r$\n"
+ FileWrite $3 "start $2\$1.exe$\r$\n"
+ FileClose $3
+
+ SetOutPath "$QSA_INSTDIR\examples\$1"
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\Examples\$1.lnk" "%COMSPEC%" "/c $1.bat"
+example_shortcuts_next:
+ FindNext $0 $1
+ Goto loop
+
+ done:
+ SetOutPath "$QSA_INSTDIR"
+ pop $3
+ pop $2
+ pop $1
+ pop $0
+FunctionEnd
+
+
+ Function ModuleQSAOptionsPageExit
+ push $0
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 ${MODULE_QSA_OPTIONPAGE} "Field 2" "State"
+ strcmp "$0" "1" +3
+ strcpy $MODULE_QSA_NOIDE ""
+ goto +2
+ strcpy $MODULE_QSA_NOIDE "-no-ide "
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 ${MODULE_QSA_OPTIONPAGE} "Field 3" "State"
+ strcmp "$0" "1" +3
+ strcpy $MODULE_QSA_NOEDITOR ""
+ goto +2
+ strcpy $MODULE_QSA_NOEDITOR "-no-editor "
+
+ pop $0
+ FunctionEnd
+
+ Function QsaModuleWriteBuildFile
+ push $0 ; file handle
+ push $1 ; compiler
+ push $2 ; qmakespec
+ push $3 ; vars file
+
+ push $COMPILER_SELECTED
+ call GetShortCompilerName
+ pop $1
+
+ push $1
+ call GetMkSpec
+ pop $2
+
+ push $1
+ call GetVSVarsFile
+ pop $3
+
+ ClearErrors
+ FileOpen $0 "$QSA_INSTDIR\qsabuild.bat" w
+ IfErrors done
+ FileWrite $0 "@rem ----------------------$\r$\n"
+ FileWrite $0 "@rem This file is generated$\r$\n"
+ FileWrite $0 "@rem ----------------------$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "@echo Setting QTDIR to $QTDIR_SELECTED$\r$\n"
+ FileWrite $0 "@set QTDIR=$QTDIR_SELECTED$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "@echo Adding %QTDIR%\bin to PATH$\r$\n"
+ FileWrite $0 "@set PATH=%QTDIR%\bin;%PATH%$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "@echo Setting QMAKESPEC to $2$\r$\n"
+ FileWrite $0 "@set QMAKESPEC=$2$\r$\n"
+ FileWrite $0 "$\r$\n"
+ strcmp "$3" "" +3
+ FileWrite $0 '@call "$3"$\r$\n'
+ FileWrite $0 "$\r$\n"
+ FileWrite $0 "@echo Running configure in $QSA_INSTDIR$\r$\n"
+ FileWrite $0 "@cd $QSA_INSTDIR$\r$\n"
+ FileWrite $0 "@configure $MODULE_QSA_NOIDE$MODULE_QSA_NOEDITOR-automake$\r$\n"
+ FileWrite $0 "$\r$\n"
+ FileClose $0
+ done:
+
+ pop $3
+ pop $2
+ pop $1
+ pop $0
+ FunctionEnd
+!macroend
+!macro QSA_CHECKLICENSEPRODUCT
+ push $0
+ qtnsisext::HasLicenseProduct $LICENSE_KEY "QSA"
+ pop $0
+ strcmp $0 "1" QSALicenseOK
+ SectionSetText ${QSA_SEC01} "${MODULE_QSA_NAME} (No License)"
+ SectionSetFlags ${QSA_SEC01} 16
+ QSALicenseOK:
+ pop $0
+!macroend
+!macro QSA_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${QSA_SEC01} "This installs ${MODULE_QSA_NAME} version ${MODULE_QSA_VERSION} on your system."
+!macroend
+!macro QSA_STARTUP
+ !ifndef MODULE_QSA_INTEGRATE
+ !insertmacro QTDIR_STARTUP
+ !endif
+ strcpy $QSA_INSTDIR "C:\${MODULE_QSA_NAME}\${MODULE_QSA_VERSION}"
+ strcpy $MODULE_QSA_NOIDE ""
+ strcpy $MODULE_QSA_NOEDITOR ""
+
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_QSA_OPTIONPAGE}"
+!macroend
+!macro QSA_FINISH
+!macroend
+!macro QSA_RUN_FUNCTION
+!macroend
+!macro QSA_UNSTARTUP
+ strcmp "$QSA_INSTDIR" "" 0 +2
+ StrCpy $QSA_INSTDIR "$INSTDIR\${MODULE_QSA_NAME} ${MODULE_QSA_VERSION}"
+
+ !insertmacro ConfirmOnRemove "QSAInstalled" "$QSA_INSTDIR"
+!macroend
+!macro QSA_UNINSTALL
+ Section un."${MODULE_QSA_NAME} ${MODULE_QSA_VERSION}"
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "QSAInstalled"
+ intcmp $0 1 0 DoneUnInstallQSA
+
+ DetailPrint "Removing installation directory..."
+ RMDir /r "$QSA_INSTDIR"
+ RmDir /r "$SMPROGRAMS\$STARTMENU_STRING\Examples"
+
+ DoneUnInstallQSA:
+ SectionEnd
+!macroend
+!macro QSA_UNFINISH
+!macroend
+!else ;MODULE_QSA
+!macro QSA_INITIALIZE
+!macroend
+!macro QSA_SECTIONS
+!macroend
+!macro QSA_CHECKLICENSEPRODUCT
+!macroend
+!macro QSA_DESCRIPTION
+!macroend
+!macro QSA_STARTUP
+!macroend
+!macro QSA_FINISH
+!macroend
+!macro QSA_RUN_FUNCTION
+!macroend
+!macro QSA_UNSTARTUP
+!macroend
+!macro QSA_UNINSTALL
+!macroend
+!macro QSA_UNFINISH
+!macroend
+!endif ;MODULE_QSA
+
diff --git a/util/scripts/win-binary/nsis/modules/qtdemo.nsh b/util/scripts/win-binary/nsis/modules/qtdemo.nsh
new file mode 100644
index 0000000..9f4fe5f
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/qtdemo.nsh
@@ -0,0 +1,112 @@
+!ifdef MODULE_QTDEMO
+
+;-------------------------------
+; Test which version of Microsoft DirectX is installed
+; Returns e.g. 900 for version 9
+;
+; Original code is from nsis.sourceforge.net
+Function GetDXVersion
+ Push $0
+ Push $1
+
+ ClearErrors
+ ReadRegStr $0 HKLM "Software\Microsoft\DirectX" "Version"
+ IfErrors noDirectX
+
+ StrCpy $1 $0 2 5 ; get the minor version
+ StrCpy $0 $0 2 2 ; get the major version
+ IntOp $0 $0 * 100 ; $0 = major * 100 + minor
+ IntOp $0 $0 + $1
+ Goto done
+
+noDirectX:
+ StrCpy $0 0
+
+done:
+ Pop $1
+ Exch $0
+FunctionEnd
+
+;-------------------------------
+; Test if Visual Studio Redistributables 2005+ SP1 installed
+; Returns -1 if there is no VC redistributables installed
+; otherwise returns version number (e.g. 134274064 for VS2005 SP1)
+;
+; Original code is from nsis.sourceforge.net
+Function CheckVCRedist
+ Push $0
+ ClearErrors
+ ReadRegDword $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" "Version"
+
+ IfErrors 0 done
+ StrCpy $0 -1
+
+done:
+ Exch $0
+FunctionEnd
+
+
+!macro INSTALLVCREDIST VCREDIST_EXE
+ Push $R0
+ DetailPrint "Checking for Microsoft Visual C++ 2005 SP1 Redistributable Runtime ..."
+ Call CheckVCRedist
+ Pop $R0
+ IntCmp $R0 134274064 vcexists +1 +1 ; 134274064 = 800dc10
+ MessageBox MB_YESNO|MB_ICONINFORMATION "Qt demo requires the Microsoft Visual C++ 2005 SP1 Runtime to be installed. Do you want to install the Runtime now?" IDYES vcinstall IDNO vcdone
+vcinstall:
+ DetailPrint "Installing Microsoft Visual C++ 2005 SP1 Runtime ..."
+ nsExec::Exec '"$INSTDIR\${VCREDIST_EXE}" /q:a /c:"VCREDI~1.EXE /q:a /c:""msiexec /i vcredist.msi /qb!"" "' $R0
+ IntCmp $R0 1 vcdone vcdone +1 ; return value 0,1 -> done
+ IntCmp $R0 3010 0 vcerror vcerror ; other return values
+ MessageBox MB_OK|MB_ICONINFORMATION "Please reboot after finishing this installation"
+ Goto vcdone
+vcerror:
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Installing the Microsoft Visual C++ 2005 SP1 Runtime failed (error code $R0)! Please try to run '$INSTDIR\${VCREDIST_EXE}' manually"
+ Goto vcdone
+vcexists:
+ DetailPrint "Microsoft Visual C++ 2005 SP1 Runtime SP1 is already installed"
+vcdone:
+ Pop $R0
+!macroend
+
+!macro INSTALLDIRECTX DIRECTX_EXE
+ Push $R0
+ DetailPrint "Checking for Microsoft Direct X version 9 or higher ..."
+ Call GetDXVersion
+ Pop $R0
+ IntCmp $R0 900 dxexists +1 dxexists
+ MessageBox MB_YESNO|MB_ICONINFORMATION "The mediaplayer demo requires Microsoft Direct X 9 or higher to be installed. Do you want to download and install Direct X 9 now?" IDYES dxinstall IDNO dxdone
+dxinstall:
+ DetailPrint "Running Microsoft Direct X installer ..."
+ nsExec::Exec '"$INSTDIR\${DIRECTX_EXE}"'
+ Goto dxdone
+dxexists:
+ DetailPrint "Microsoft Direct X version 9 or higher is already installed (version detected: $R0)"
+dxdone:
+ Pop $R0
+!macroend
+
+!macro QTDEMO_STARTUP
+ SectionSetFlags ${QTDEMO_SEC01} 17 ; selected & read-only
+!macroend
+
+!macro QTDEMO_SECTIONS
+ Section "Prerequisites" QTDEMO_SEC01
+ !ifdef MODULE_QTDEMO_VCREDIST
+ !insertmacro INSTALLVCREDIST "${MODULE_QTDEMO_VCREDIST}"
+ !endif
+ !ifdef MODULE_QTDEMO_DIRECTX
+ !insertmacro INSTALLDIRECTX "${MODULE_QTDEMO_DIRECTX}"
+ !endif
+ SectionEnd
+!macroend
+
+!else ;MODULE_QTDEMO
+
+!macro QTDEMO_STARTUP
+!macroend
+
+!macro QTDEMO_SECTIONS
+!macroend
+
+!endif \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/modules/qtjambi.nsh b/util/scripts/win-binary/nsis/modules/qtjambi.nsh
new file mode 100644
index 0000000..948945b
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/qtjambi.nsh
@@ -0,0 +1,98 @@
+!ifdef MODULE_QTJAMBI
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_INITIALIZE
+!include "includes\qtcommon.nsh"
+!ifndef MODULE_QTJAMBI_NAME
+ !define MODULE_QTJAMBI_NAME "Qt Jambi"
+!endif
+!ifndef MODULE_QTJAMBI_VERSION
+ !define MODULE_QTJAMBI_VERSION ${PRODUCT_VERSION}
+!endif
+
+!macroend ;QTJAMBI_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_SECTIONS
+SectionGroup "${MODULE_QTJAMBI_NAME}"
+Section "QtJambi" QTJAMBI_SEC01
+ SetOutPath "$QTJAMBI_INSTDIR"
+ SetOverwrite ifnewer
+ !insertmacro MODULE_QTJAMBI_INSTALLFILES
+
+ !insertmacro CreateConditionalShortCutWithParameters "$SMPROGRAMS\$STARTMENU_STRING\Readme.lnk" "notepad" "$QTJAMBI_INSTDIR\README"
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\Examples and Demos.lnk" "$QTJAMBI_INSTDIR\qtjambi.exe"
+
+ Push "bin"
+ push $QTJAMBI_INSTDIR
+ call PatchCommonBinaryFiles
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtJambiInstalled" 1
+SectionEnd
+SectionGroupEnd
+!macroend ;QTJAMBI_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${QTJAMBI_SEC01} "This installs the Qt Jambi ${MODULE_QTJAMBI_VERSION} for Visual Studio 6.0"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_STARTUP
+ push $0
+ SectionSetFlags ${QTJAMBI_SEC01} 1
+!ifdef MODULE_ENVIRONMENT
+ strcpy $QTJAMBI_INSTDIR "C:\Qt\qtjambi-win32-eval-${MODULE_QTJAMBI_VERSION}"
+!else
+ strcpy $QTJAMBI_INSTDIR "C:\Qt\qtjambi-win32-commercial-${MODULE_QTJAMBI_VERSION}"
+!endif
+
+ pop $0
+!macroend ;QTJAMBI_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_UNSTARTUP
+ !insertmacro ConfirmOnRemove "QtJambiInstalled" "Qt Jambi"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_UNINSTALL
+ push $0
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "QtJambiInstalled"
+
+ intcmp $0 1 0 DoneUnInstallQtJambi
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "QtJambiInstalled" 0
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Readme.lnk"
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Examples and Demos.lnk"
+ !insertmacro MODULE_QTJAMBI_REMOVE "$QTJAMBI_INSTDIR"
+ RMDir $QTJAMBI_INSTDIR ;removes it if empty
+ DoneUnInstallQtJambi:
+ pop $0
+!macroend ;QTJAMBI_UNINSTALL
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBI_UNFINISH
+!macroend
+
+!else ;MODULE_QTJAMBI
+!macro QTJAMBI_INITIALIZE
+!macroend
+!macro QTJAMBI_SECTIONS
+!macroend
+!macro QTJAMBI_DESCRIPTION
+!macroend
+!macro QTJAMBI_STARTUP
+!macroend
+!macro QTJAMBI_FINISH
+!macroend
+!macro QTJAMBI_UNSTARTUP
+!macroend
+!macro QTJAMBI_UNINSTALL
+!macroend
+!macro QTJAMBI_UNFINISH
+!macroend
+!endif ;MODULE_QTJAMBI
+
diff --git a/util/scripts/win-binary/nsis/modules/qtjambieclipse.nsh b/util/scripts/win-binary/nsis/modules/qtjambieclipse.nsh
new file mode 100644
index 0000000..d8cae70
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/qtjambieclipse.nsh
@@ -0,0 +1,223 @@
+!ifdef MODULE_QTJAMBIECLIPSE
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_INITIALIZE
+
+!define ECLIPSE_LOCATION_KEY "EclipseLocation"
+var ECLIPSE_LOCATION
+
+!ifndef MODULE_QTJAMBIECLIPSE_INSTALLER
+ !define MODULE_QTJAMBIECLIPSE_INSTALLER "${PRODUCT_NAME} v${PRODUCT_VERSION}"
+!endif
+!ifndef MODULE_QTJAMBIECLIPSE_ROOT
+ !define MODULE_QTJAMBIECLIPSE_ROOT "${INSTALL_ROOT}\qtjambieclipse"
+!endif
+!ifndef MODULE_QTJAMBIECLIPSE_VERSION
+ !define MODULE_QTJAMBIECLIPSE_VERSION ${PRODUCT_VERSION}
+!endif
+
+!define MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION "1.0.0"
+
+!define MODULE_QTJAMBIECLIPSE_QT_ID "com.trolltech.qt_${MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION}"
+!define MODULE_QTJAMBIECLIPSE_QTJAMBI_ID "com.trolltech.qtjambi_${MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION}"
+!define MODULE_QTJAMBIECLIPSE_QTDESIGNER_ID "com.trolltech.qtdesigner_${MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION}"
+!define MODULE_QTJAMBIECLIPSE_QTDESIGNER_QTJAMBI_ID "com.trolltech.qtdesigner.qtjambi_${MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION}"
+!define MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID "com.trolltech.qtdesignerplugins"
+
+!define MODULE_QTJAMBIECLIPSE_BINARIES "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\com.trolltech.qtdesigner.win32.x86_${MODULE_QTJAMBIECLIPSE_QTJAMBIVERSION}"
+
+LangString ModuleQtjambieclipsePageTitle ${LANG_ENGLISH} "Eclipse Installation Location"
+LangString ModuleQtjambieclipsePageDescription ${LANG_ENGLISH} "Select where eclipse is installed."
+
+!define MODULE_QTJAMBIECLIPSE_PAGE "qtjambieclipse.ini"
+Page custom ModuleQtjambieclipsePageEnter ModuleQtjambieclipsePageExit
+
+!include "includes\regsvr.nsh"
+
+!define MODULE_QTJAMBIECLIPSE_INCOMPATIBLEPRODUCT "Qt Eclipse Integration"
+
+!macroend ;QTJAMBIECLIPSE_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_SECTIONS
+
+Section -PreEclipseSection
+ WriteRegStr SHCTX "$PRODUCT_UNIQUE_KEY" "${ECLIPSE_LOCATION_KEY}" $ECLIPSE_LOCATION
+SectionEnd
+
+SectionGroup "Eclipse Integration"
+
+Section "Qt Jambi Eclipse Integration" QTJAMBIECLIPSE_SEC01
+ SetOutPath "$ECLIPSE_LOCATION\plugins\"
+ SetOverwrite ifnewer
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QT_ID}.jar"
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QTJAMBI_ID}.jar"
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNER_ID}.jar"
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNER_QTJAMBI_ID}.jar"
+
+ SetOutPath "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}"
+ SetOverwrite ifnewer
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}\JambiCustomWidget.dll"
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}\JambiLanguage.dll"
+
+ SetOutPath "$QTJAMBIECLIPSE_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_QTJAMBIECLIPSE_ROOT}\LICENSE.QT_JAMBI_ECLIPSE_INTEGRATION"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\msvcp71.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\msvcr71.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtCore4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtGui4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtXml4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtScript4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtDesigner4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\QtDesignerComponents4.dll"
+ File "${MODULE_QTJAMBIECLIPSE_BINARIES}\qtdesigner.dll"
+
+ push "$QTJAMBIECLIPSE_INSTDIR\qtdesigner.dll"
+ call RegEclipseSvr
+
+ push "$QTJAMBIECLIPSE_INSTDIR\qtdesigner.dll"
+ call RegEclipseSvr
+
+ Rename "$QTJAMBIECLIPSE_INSTDIR\LICENSE.QT_JAMBI_ECLIPSE_INTEGRATION" "$QTJAMBIECLIPSE_INSTDIR\LICENSE.txt"
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\License.lnk" "$QTJAMBIECLIPSE_INSTDIR\LICENSE.txt"
+SectionEnd
+
+SectionGroupEnd
+
+; usage:
+; push dll to register
+; call RegEclipseSvr
+Function RegEclipseSvr
+ exch $0 ;filename
+
+ ClearErrors
+ push $0
+ call RegSvr
+ IfErrors 0 +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION 'Could not register "$0"'
+
+ pop $0
+FunctionEnd
+
+Function ModuleQtjambieclipsePageEnter
+ !insertmacro MUI_HEADER_TEXT "$(ModuleQtjambieclipsePageTitle)" "$(ModuleQtjambieclipsePageDescription)"
+ !insertmacro MUI_INSTALLOPTIONS_DISPLAY "${MODULE_QTJAMBIECLIPSE_PAGE}"
+FunctionEnd
+
+Function ModuleQtjambieclipsePageExit
+ push $0
+ push $1
+
+ !insertmacro MUI_INSTALLOPTIONS_READ $0 "${MODULE_QTJAMBIECLIPSE_PAGE}" "Field 2" "State"
+ IfFileExists "$0\eclipse.exe" eclipse_found
+ MessageBox MB_OK|MB_ICONSTOP "$0\eclipse.exe not found!$\nPlease select a valid installation directory."
+ Goto failed
+ eclipse_found:
+
+ ClearErrors
+ FileOpen $1 "$0\plugins\com.trolltech.writetest" a
+ IfErrors 0 has_write_access
+ MessageBox MB_OK|MB_ICONSTOP "Can't write to $0\plugins.$\nPlease select a valid installation directory."
+ Goto failed
+ has_write_access:
+
+ FileClose $1
+ Delete "$0\plugins\com.trolltech.writetest"
+ StrCpy $ECLIPSE_LOCATION $0
+
+ Goto done
+ failed:
+ pop $1
+ pop $0
+ Abort
+
+ done:
+ pop $1
+ pop $0
+FunctionEnd
+
+!macroend ;QTJAMBIECLIPSE_SECTIONS
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_DESCRIPTION
+!ifdef QTJAMBIECLIPSE_SEC01
+ !insertmacro MUI_DESCRIPTION_TEXT ${QTJAMBIECLIPSE_SEC01} "This installs the Qt Jambi plugin into Eclipse."
+!endif
+!macroend
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_STARTUP
+ push "${MODULE_QTJAMBIECLIPSE_INCOMPATIBLEPRODUCT}"
+ call WarnIfInstalledProductDetected
+
+ !insertmacro MUI_INSTALLOPTIONS_EXTRACT "${MODULE_QTJAMBIECLIPSE_PAGE}"
+ SectionSetFlags ${QTJAMBIECLIPSE_SEC01} 17
+
+ strcpy $QTJAMBIECLIPSE_INSTDIR "$PROGRAMFILES\Trolltech\Qt Jambi Eclipse Integration"
+!macroend ;QTJAMBIECLIPSE_STATUP
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_FINISH
+!macroend ;QTJAMBIECLIPSE_FINISH
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_UNSTARTUP
+ ReadRegStr $ECLIPSE_LOCATION SHCTX "$PRODUCT_UNIQUE_KEY" "${ECLIPSE_LOCATION_KEY}"
+!macroend ;QTJAMBIECLIPSE_UNSTARTUP
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_UNINSTALL
+Section un."Eclipse Integration"
+ push "$QTJAMBIECLIPSE_INSTDIR\qtdesigner.dll"
+ call un.RegSvr
+
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QT_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTJAMBI_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNER_ID}.jar"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNER_QTJAMBI_ID}.jar"
+
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}\JambiCustomWidget.dll"
+ Delete "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}\JambiLanguage.dll"
+ RMDir "$ECLIPSE_LOCATION\plugins\${MODULE_QTJAMBIECLIPSE_QTDESIGNERPLUGINS_ID}"
+
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\License.lnk"
+
+ Delete "$QTJAMBIECLIPSE_INSTDIR\LICENSE.txt"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\msvcp71.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\msvcr71.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtCore4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtGui4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtXml4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtScript4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtDesigner4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\QtDesignerComponents4.dll"
+ Delete "$QTJAMBIECLIPSE_INSTDIR\qtdesigner.dll"
+
+ RMDir "$QTJAMBIECLIPSE_INSTDIR"
+SectionEnd
+!macroend ;QTJAMBIECLIPSE_UNINSTALL
+
+;------------------------------------------------------------------------------------------------
+!macro QTJAMBIECLIPSE_UNFINISH
+!macroend
+
+!else ;MODULE_QTJAMBIECLIPSE
+!macro QTJAMBIECLIPSE_INITIALIZE
+!macroend
+!macro QTJAMBIECLIPSE_SECTIONS
+!macroend
+!macro QTJAMBIECLIPSE_DESCRIPTION
+!macroend
+!macro QTJAMBIECLIPSE_STARTUP
+!macroend
+!macro QTJAMBIECLIPSE_FINISH
+!macroend
+!macro QTJAMBIECLIPSE_UNSTARTUP
+!macroend
+!macro QTJAMBIECLIPSE_UNINSTALL
+!macroend
+!macro QTJAMBIECLIPSE_UNFINISH
+!macroend
+!endif ;MODULE_QTJAMBIECLIPSE
+
diff --git a/util/scripts/win-binary/nsis/modules/registeruiext.nsh b/util/scripts/win-binary/nsis/modules/registeruiext.nsh
new file mode 100644
index 0000000..51f7df5
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/registeruiext.nsh
@@ -0,0 +1,174 @@
+; UI Extension Module
+
+!ifdef MODULE_REGISTERUIEXT
+
+;------------------------------------------------------------------------------------------------
+!macro REGISTERUIEXT_INITIALIZE
+ !include "includes\system.nsh"
+
+ !ifndef MODULE_REGISTERUIEXT_QTDIR
+ !ifdef MODULE_MINGW
+ !define MODULE_REGISTERUIEXT_QTDIR $MINGW_INSTDIR
+ !endif
+
+ !ifdef MODULE_MSVC
+ !define MODULE_REGISTERUIEXT_QTDIR $MSVC_INSTDIR
+ !endif
+ !endif
+
+ !define MODULE_REGISTERUIEXT_INTERNAL_DESC "Trolltech.DesignerForm"
+ !define MODULE_REGISTERUIEXT_DESC_DESIGNER "Open with Qt Designer"
+ !define MODULE_REGISTERUIEXT_DESC_DEVENV "Open with Visual Studio .NET"
+ !define MODULE_REGISTERUIEXT_FILE_DESC "Qt Designer File"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_SECTIONS
+
+Function GetSelectedVSIP
+ Push $0
+ Push $1
+
+ StrCpy $0 ""
+!ifdef MODULE_VSIP
+!ifdef VSIP_SEC01
+ SectionGetFlags ${VSIP_SEC01} $1
+ IntOp $1 $1 & 1
+ IntCmp $1 0 +2
+ StrCpy $0 "7.1"
+!endif
+!ifdef VSIP_SEC02
+ SectionGetFlags ${VSIP_SEC02} $1
+ IntOp $1 $1 & 1
+ IntCmp $1 0 +2
+ StrCpy $0 "8.0"
+!endif
+!ifdef VSIP_SEC03
+ SectionGetFlags ${VSIP_SEC03} $1
+ IntOp $1 $1 & 1
+ IntCmp $1 0 +2
+ StrCpy $0 "9.0"
+!endif
+!endif
+
+ Pop $1
+ Exch $0
+FunctionEnd
+
+SectionGroup "File Associations"
+Section "UI Files (*.ui)" REGISTERUIEXT_SEC01
+ call ModuleRegisterUI
+SectionEnd
+SectionGroupEnd
+
+Function ModuleRegisterUI
+ push $0
+ push $1
+
+ WriteRegDWORD SHCTX "$PRODUCT_UNIQUE_KEY" "UIExtRegistered" 1
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}" "" "${MODULE_REGISTERUIEXT_FILE_DESC}"
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\shell" "" "open"
+
+ Call GetSelectedVSIP
+ Pop $1
+
+ StrCmp "$1" "" 0 RegisterVSIP
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\shell\open" "" "${MODULE_REGISTERUIEXT_DESC_DESIGNER}"
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\shell\open\command" "" "${MODULE_REGISTERUIEXT_QTDIR}\bin\designer.exe $\"%1$\""
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\DefaultIcon" "" "${MODULE_REGISTERUIEXT_QTDIR}\bin\designer.exe,0"
+ goto RegisterFinished
+
+ RegisterVSIP:
+ Push $1
+ Call GetVSInstallationDir
+ Pop $0
+
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\shell\open" "" "${MODULE_REGISTERUIEXT_DESC_DEVENV}"
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\shell\${MODULE_REGISTERUIEXT_DESC_DEVENV}\command" "" "$0\devenv.exe $\"%1$\""
+ WriteRegStr HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}\DefaultIcon" "" "$VSIP_INSTDIR\ui.ico"
+ RegisterFinished:
+ WriteRegStr HKCR ".ui" "" "${MODULE_REGISTERUIEXT_INTERNAL_DESC}"
+
+ pop $1
+ pop $0
+FunctionEnd
+
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${REGISTERUIEXT_SEC01} "This will associate the file extention .ui with the Qt GUI editor."
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_STARTUP
+ ${If} $RUNNING_AS_ADMIN == false
+ SectionSetFlags ${REGISTERUIEXT_SEC01} 16
+ ${EndIf}
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_UNSTARTUP
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_UNINSTALL
+Function un.ModuleRegisterUI
+ push $1
+ ReadRegStr $1 HKCR ".ui" ""
+ strcmp $1 "${MODULE_REGISTERUIEXT_INTERNAL_DESC}" 0 continue
+ ; do not delete this key since a subkey openwithlist
+ ; or open withprogid may exist
+ WriteRegStr HKCR ".ui" "" ""
+ continue:
+ ; just delete it since nobody else is supposed to use it
+ DeleteRegKey HKCR "${MODULE_REGISTERUIEXT_INTERNAL_DESC}"
+
+ pop $1
+FunctionEnd
+
+Section -un.ModuleRegisterUIExtSection
+ push $0
+ ReadRegDWORD $0 SHCTX "$PRODUCT_UNIQUE_KEY" "UIExtRegistered"
+ intcmp $0 1 0 DoneUnRegister
+ call un.ModuleRegisterUI
+ DoneUnRegister:
+ pop $0
+SectionEnd
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro REGISTERUIEXT_UNFINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!else
+!macro REGISTERUIEXT_INITIALIZE
+!macroend
+!macro REGISTERUIEXT_SECTIONS
+!macroend
+!macro REGISTERUIEXT_DESCRIPTION
+!macroend
+!macro REGISTERUIEXT_STARTUP
+!macroend
+!macro REGISTERUIEXT_FINISH
+!macroend
+!macro REGISTERUIEXT_UNSTARTUP
+!macroend
+!macro REGISTERUIEXT_UNINSTALL
+!macroend
+!macro REGISTERUIEXT_UNFINISH
+!macroend
+!endif
diff --git a/util/scripts/win-binary/nsis/modules/vsip.nsh b/util/scripts/win-binary/nsis/modules/vsip.nsh
new file mode 100644
index 0000000..a11763b
--- /dev/null
+++ b/util/scripts/win-binary/nsis/modules/vsip.nsh
@@ -0,0 +1,1030 @@
+; Integration Module
+
+!ifdef MODULE_VSIP
+
+;------------------------------------------------------------------------------------------------
+!macro VSIP_INITIALIZE
+
+!ifndef MODULE_VSIP_NAME
+ !define MODULE_VSIP_NAME "Qt Visual Studio Integration"
+!endif
+!ifndef MODULE_VSIP_VERSION
+ !define MODULE_VSIP_VERSION ${PRODUCT_VERSION}
+!endif
+!ifndef MODULE_VSIP_ROOT
+ !define MODULE_VSIP_ROOT "${INSTALL_ROOT}\vsip"
+!endif
+!ifndef MODULE_HELP_ROOT
+ !define MODULE_HELP_ROOT "${MODULE_VSIP_ROOT}\help"
+!endif
+
+
+!include "includes\templates.nsh"
+!include "includes\system.nsh"
+!include "includes\help.nsh"
+!include "includes\regsvr.nsh"
+!include "includes\qtcommon.nsh"
+!include "WinMessages.nsh"
+
+!macroend ;VSIP_INITIALIZE
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_SECTIONS
+
+SectionGroup "Qt Visual Studio Integration"
+!ifndef MODULE_VSIP_NO2003
+Section "Visual Studio 2003" VSIP_SEC01
+ WriteRegStr SHCTX "SOFTWARE\\Trolltech\\Qt4VS2003" "LicenseKey" $LICENSE_KEY
+
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+
+ WriteRegDWord SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2003" "1"
+
+ StrCpy $VS_VERSION_SHORT "7.1"
+ StrCpy $VS_VERSION "2003"
+ Push $VS_VERSION_SHORT
+ Call InstallVSIP
+
+ !insertmacro InstallHelp "$VSIP_INSTDIR\help" "qt4vs" "$VS_VERSION_SHORT"
+
+ ;install readme file
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\Readme.txt"
+ File "${MODULE_VSIP_ROOT}\ui.ico"
+ File "${MODULE_VSIP_ROOT}\Changes-${MODULE_VSIP_VERSION}"
+SectionEnd
+!endif
+
+!ifndef MODULE_VSIP_NO2005
+Section "Visual Studio 2005" VSIP_SEC02
+ WriteRegStr SHCTX "SOFTWARE\\Trolltech\\Qt4VS2005" "LicenseKey" $LICENSE_KEY
+
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+
+ WriteRegDWord SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2005" "1"
+
+ StrCpy $VS_VERSION_SHORT "8.0"
+ StrCpy $VS_VERSION "2005"
+ Push $VS_VERSION_SHORT
+ Call InstallVSIP
+
+ !insertmacro InstallHelp "$VSIP_INSTDIR\help" "qt4vs" "$VS_VERSION_SHORT"
+
+ ;install readme file
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\Readme.txt"
+ File "${MODULE_VSIP_ROOT}\ui.ico"
+ File "${MODULE_VSIP_ROOT}\Changes-${MODULE_VSIP_VERSION}"
+SectionEnd
+!endif
+
+!ifndef MODULE_VSIP_NO2008
+Section "Visual Studio 2008" VSIP_SEC03
+ WriteRegStr SHCTX "SOFTWARE\\Trolltech\\Qt4VS2008" "LicenseKey" $LICENSE_KEY
+
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+
+ WriteRegDWord SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2008" "1"
+
+ StrCpy $VS_VERSION_SHORT "9.0"
+ StrCpy $VS_VERSION "2008"
+ Push $VS_VERSION_SHORT
+ Call InstallVSIP
+
+ !insertmacro InstallHelp "$VSIP_INSTDIR\help" "qt4vs" "$VS_VERSION_SHORT"
+
+ ;install readme file
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\Readme.txt"
+ File "${MODULE_VSIP_ROOT}\ui.ico"
+ File "${MODULE_VSIP_ROOT}\Changes-${MODULE_VSIP_VERSION}"
+SectionEnd
+!endif
+
+SectionGroupEnd
+
+Section -PostVSIPSection
+ IfFileExists "$VSIP_INSTDIR\help\h2reg.exe" 0 PostVSIPSectionHelp_Done
+ !insertmacro RegisterHelp "$VSIP_INSTDIR\help" "qt4vs"
+ PostVSIPSectionHelp_Done:
+
+ IfFileExists "$VSIP_INSTDIR\Readme.txt" 0 PostVSIPSection_Done
+ !insertmacro CreateConditionalShortCut "$SMPROGRAMS\$STARTMENU_STRING\Visual Studio Integration Readme.lnk" "$VSIP_INSTDIR\Readme.txt"
+ PostVSIPSection_Done:
+SectionEnd
+
+Function InstallVSIP
+ Exch $0
+
+ Push $0
+ Call InstallIntegration
+
+ Push $0
+ Call RegisterIntegration
+
+ Push $VSIP_INSTDIR
+ Call InstallProjectTemplates
+
+ Push $VSIP_INSTDIR
+ Call InstallItemTemplates
+
+ Call InstallResources
+
+ Call InstallSamples
+
+ Push $0
+ Call InstallAddin
+
+ Pop $0
+FunctionEnd
+
+
+Function InstallIntegration
+ Exch $0
+ Push $1
+
+ CreateDirectory "$VSIP_INSTDIR\bin"
+ SetOutPath "$VSIP_INSTDIR\bin"
+ SetOverwrite ifnewer
+
+ ; Install common files
+ File "${MODULE_VSIP_ROOT}\bin\QtCore4.dll"
+ File "${MODULE_VSIP_ROOT}\bin\QtGui4.dll"
+ File "${MODULE_VSIP_ROOT}\bin\QtXml4.dll"
+ File "${MODULE_VSIP_ROOT}\bin\QtScript4.dll"
+
+ File "${MODULE_VSIP_ROOT}\bin\QtDesigner4.dll"
+ File "${MODULE_VSIP_ROOT}\bin\QtDesignerComponents4.dll"
+ File "${MODULE_VSIP_ROOT}\bin\FormEditor1.dll"
+
+ DetailPrint "Patching $VSIP_INSTDIR\bin\QtCore4.dll..."
+ Push "$VSIP_INSTDIR"
+ Push "$VSIP_INSTDIR\bin\QtCore4.dll"
+ Call PatchBinaryPaths
+
+ CreateDirectory "$VSIP_INSTDIR\bin\$0"
+ SetOutPath "$VSIP_INSTDIR\bin\$0"
+ SetOverwrite ifnewer
+
+ StrCmp $0 "7.1" 0 MODULE_VSIP_2005_1
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Qt4VSa.dll"
+ SetFileAttributes "$VSIP_INSTDIR\bin\7.1\Qt4VSa.dll" HIDDEN
+ ClearErrors
+
+ ; Install Integration Libs
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Axformeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\formeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\QtProjectLib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Microsoft.VisualStudio.dll"
+
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Qt4VS2003.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Trolltech.Qt4VS2003Base.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Microsoft.VisualStudio.Designer.Interfaces.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\RegQt4VS2003.exe"
+
+ File "${MODULE_VSIP_ROOT}\bin\7.1\QtProjectEngineLib.dll"
+
+ ; Install MS Interop Assemblies
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Microsoft.VisualStudio.OLE.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Microsoft.VisualStudio.Shell.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\Microsoft.VisualStudio.TextManager.Interop.dll"
+
+ Goto MODULE_VSIP_ALL
+
+ MODULE_VSIP_2005_1:
+ StrCmp $0 "8.0" 0 MODULE_VSIP_2008
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Qt4VSa.dll"
+ SetFileAttributes "$VSIP_INSTDIR\bin\8.0\Qt4VSa.dll" HIDDEN
+ ClearErrors
+
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Axformeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\formeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\QtProjectLib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Microsoft.VisualStudio.dll"
+
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Qt4VS2005.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Trolltech.Qt4VS2005Base.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\RegQt4VS2005.exe"
+
+ File "${MODULE_VSIP_ROOT}\bin\8.0\QtProjectEngineLib.dll"
+
+ ; Install MS Interop Assemblies
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Microsoft.VisualStudio.OLE.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Microsoft.VisualStudio.Shell.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\Microsoft.VisualStudio.TextManager.Interop.dll"
+ Goto MODULE_VSIP_ALL
+
+ MODULE_VSIP_2008:
+ StrCmp $0 "9.0" 0 MODULE_VSIP_ALL
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Qt4VSa.dll"
+ SetFileAttributes "$VSIP_INSTDIR\bin\9.0\Qt4VSa.dll" HIDDEN
+ ClearErrors
+
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Axformeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\formeditor1Lib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\QtProjectLib.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Microsoft.VisualStudio.dll"
+
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Qt4VS2008.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Trolltech.Qt4VS2008Base.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\RegQt4VS2008.exe"
+
+ File "${MODULE_VSIP_ROOT}\bin\9.0\QtProjectEngineLib.dll"
+
+ ; Install MS Interop Assemblies
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Microsoft.VisualStudio.OLE.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Microsoft.VisualStudio.Shell.Interop.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\Microsoft.VisualStudio.TextManager.Interop.dll"
+
+
+ MODULE_VSIP_ALL:
+ !insertmacro InstallUnManagedTranslation $0 "1033"
+ !insertmacro InstallUnManagedTranslation $0 "1031"
+ !insertmacro InstallUnManagedTranslation $0 "1041"
+ !insertmacro InstallManagedTranslation $0 "de"
+ !insertmacro InstallManagedTranslation $0 "ja"
+
+ ;CreateDirectory "$VSIP_INSTDIR\bin\$0\1033"
+ ;SetOutPath "$VSIP_INSTDIR\bin\$0\1033"
+ ;SetOverwrite ifnewer
+
+ ;StrCmp $0 "8.0" 0 +2
+ ; File "${MODULE_VSIP_ROOT}\bin\8.0\1033\Qt4VS2005UI.dll"
+
+ ;StrCmp $0 "7.1" 0 +2
+ ;File "${MODULE_VSIP_ROOT}\bin\7.1\1033\Qt4VS2003UI.dll"
+
+ SetOutPath "$VSIP_INSTDIR\plugins\designer"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\plugins\designer\qaxwidget.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\qt3supportwidgets.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\customwidgetplugin.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\worldtimeclockplugin.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\containerextension.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\taskmenuextension.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\QtNetwork4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\Qt3Support4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\QtSql4.dll"
+ ${If} $0 != "7.1"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\phonon4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\QtWebKit4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\designer\qwebview.dll"
+ ${EndIf}
+
+ SetOutPath "$VSIP_INSTDIR\plugins\imageformats"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\QtSvg4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\qsvg4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\qgif4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\qjpeg4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\qtiff4.dll"
+ File "${MODULE_VSIP_ROOT}\plugins\imageformats\qico4.dll"
+
+ ; Install VC redistributable
+ Push $0
+ Call IsVS2008RedistInstalled
+ Pop $0
+ ${If} $0 == 0
+ SetOutPath "$VSIP_INSTDIR"
+ SetOverwrite ifnewer
+ File "${MODULE_VSIP_ROOT}\redist\vcredist_x86.exe"
+ ExecWait '"$VSIP_INSTDIR\vcredist_x86.exe" /q' $0
+ Delete "$VSIP_INSTDIR\vcredist_x86.exe"
+ ${EndIf}
+ Pop $0
+
+ ; Install usertype.dat
+
+ Push $0
+ Call GetVSInstallationDir
+ Pop $1
+ SetOutPath "$1"
+ SetOverwrite off ;ifnewer
+ File "${MODULE_VSIP_ROOT}\usertype.dat"
+
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+Function InstallAddin
+ Exch $0
+ CreateDirectory "$VSIP_INSTDIR\bin\$0"
+ ClearErrors
+ SetOutPath "$VSIP_INSTDIR\bin\$0"
+ SetOverwrite ifnewer
+
+ StrCmp $0 "7.1" MODULE_VSIP_ADDIN_71
+ StrCmp $0 "8.0" MODULE_VSIP_ADDIN_80
+ File "${MODULE_VSIP_ROOT}\bin\9.0\StartQtVSIP.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\StartQtVSIP2008.AddIn"
+ WriteRegStr SHCTX "Software\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders" "$VSIP_INSTDIR\bin\$0" ""
+ Goto MODULE_VSIP_ADDIN_End
+
+ MODULE_VSIP_ADDIN_80:
+ File "${MODULE_VSIP_ROOT}\bin\8.0\StartQtVSIP.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\StartQtVSIP2005.AddIn"
+ WriteRegStr SHCTX "Software\Microsoft\VisualStudio\8.0\AutomationOptions\LookInFolders" "$VSIP_INSTDIR\bin\$0" ""
+ Goto MODULE_VSIP_ADDIN_End
+
+ MODULE_VSIP_ADDIN_71:
+ Push $1
+ Push $2
+
+ Push $0
+ Call IsDotNETInstalled
+ Pop $1
+
+ File "${MODULE_VSIP_ROOT}\bin\7.1\StartQtVSIP.dll"
+
+ ClearErrors
+ DetailPrint "Registering StartQtVSIP..."
+ nsExec::ExecToLog '"$1\regasm.exe" /codebase "StartQtVSIP.dll"'
+ Pop $2
+ StrCmp $2 "error" 0 +3
+ MessageBox MB_OK 'The command $\n"$1\regasm.exe" /codebase "StartQtVSIP.dll"$\n failed.'
+ Goto MODULE_VSIP_ADDIN_71_End
+
+ WriteRegDWORD SHCTX "Software\Microsoft\VisualStudio\7.1\Addins\StartQtVSIP" "CommandLineSafe" 0x00000001
+ WriteRegDWORD SHCTX "Software\Microsoft\VisualStudio\7.1\Addins\StartQtVSIP" "CommandPreload" 0x00000000
+ WriteRegDWORD SHCTX "Software\Microsoft\VisualStudio\7.1\Addins\StartQtVSIP" "LoadBehavior" 0x00000003
+
+ MODULE_VSIP_ADDIN_71_End:
+ Pop $2
+ Pop $1
+
+ MODULE_VSIP_ADDIN_End:
+ Pop $0
+FunctionEnd
+
+
+Function RegisterIntegration
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+
+ Push $0
+ Call GetVSInstallationDir
+ Pop $1
+
+ Push $0
+ Call IsDotNETInstalled
+ Pop $2
+
+ SetOutPath "$VSIP_INSTDIR\bin"
+
+; MessageBox MB_OK '"$2\regasm.exe" /codebase "$0\bin\QtProjectEngineLib.dll"'
+; MessageBox MB_OK '"$0\bin\RegQt4VS${MODULE_VSIP_VS_VERSION}.exe" /templatepath:"$0//" "$0\bin\Qt4VS${MODULE_VSIP_VS_VERSION}.dll"'
+; MessageBox MB_OK "Can not setup devenv! The command $\n$1\devenv.exe /setup$\n failed. Try to run in manually!"
+
+ ClearErrors ; clear the error flag
+ nsExec::ExecToLog '"$2\regasm.exe" /codebase "$VSIP_INSTDIR\bin\$0\QtProjectEngineLib.dll"'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_RegFormEditor
+ MessageBox MB_OK "Can not register QtProjectEngineLib.dll!"
+ MessageBox MB_OK '"$2\regasm.exe" /codebase "$VSIP_INSTDIR\bin\$0\QtProjectEngineLib.dll"'
+
+ Module_VSIP_RegFormEditor:
+ ClearErrors
+ push "$VSIP_INSTDIR\bin\formeditor1.dll"
+ call RegSvr
+ IfErrors 0 Module_VSIP_RegPackage
+ MessageBox MB_OK "Can not register formeditor1.dll!"
+
+ Module_VSIP_RegPackage:
+ StrCpy $VS_VERSION "2008"
+ StrCmp $0 "8.0" 0 +2
+ StrCpy $VS_VERSION "2005"
+ StrCmp $0 "7.1" 0 +2
+ StrCpy $VS_VERSION "2003"
+ nsExec::ExecToLog '"$VSIP_INSTDIR\bin\$0\RegQt4VS$VS_VERSION.exe" /root:Software\Microsoft\VisualStudio\$0 /templatepath:"$VSIP_INSTDIR//" "$VSIP_INSTDIR\bin\$0\Qt4VS$VS_VERSION.dll"'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_SetupVS
+ MessageBox MB_OK "Can not register package!"
+
+ Module_VSIP_SetupVS:
+ DetailPrint "Calling devenv /setup ..."
+ nsExec::Exec '"$1\devenv.exe" /setup'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_SetupOK
+ MessageBox MB_OK "Can not setup devenv! The command $\n$1\devenv.exe /setup$\n failed. Try to run in manually!"
+ goto Module_VSIP_EndRegisterPackage
+ Module_VSIP_SetupOK:
+ DetailPrint "Running setup was successfull."
+ Module_VSIP_EndRegisterPackage:
+
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+Function InstallSamples
+ CreateDirectory "$VSIP_INSTDIR\samples\AddressBook"
+ SetOutPath "$VSIP_INSTDIR\samples\AddressBook"
+ SetOverwrite ifnewer
+
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\adddialog.cpp"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\adddialog.h"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\adddialog.ui"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\addressbook.cpp"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\addressbook.h"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\AddressBook.ico"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\AddressBook.rc"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\addressbook.ui"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\AddressBook.vcproj"
+ File "${MODULE_VSIP_ROOT}\samples\AddressBook\main.cpp"
+FunctionEnd
+
+Function InstallResources
+ CreateDirectory "$VSIP_INSTDIR\resources"
+
+ SetOutPath "$VSIP_INSTDIR\resources"
+ SetOverWrite ifnewer
+
+ !insertmacro InstallResourceFiles "bmp" "bitmap"
+ !insertmacro InstallResourceFiles "txt" "text"
+ !insertmacro InstallResourceFiles "htm" "page"
+ !insertmacro InstallResourceFiles "xml" "xmlfile"
+ !insertmacro InstallResourceFiles "png" "image"
+ !insertmacro InstallResourceFiles "ui" "form"
+FunctionEnd
+
+Function un.InstallVSIP
+ Exch $0
+
+ Push $0
+ Call un.InstallAddin
+
+ Call un.InstallSamples
+
+ Call un.InstallResources
+
+ Push $VSIP_INSTDIR
+ Call un.InstallProjectTemplates
+
+ Push $VSIP_INSTDIR
+ Call un.InstallItemTemplates
+
+ Push $0
+ Call un.RegisterIntegration
+
+ Push $0
+ Call un.InstallIntegration
+
+ Pop $0
+FunctionEnd
+
+
+Function un.InstallIntegration
+ Exch $0
+ Push $1
+
+ Delete "$VSIP_INSTDIR\bin\$0\Microsoft.VisualStudio.TextManager.Interop.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Microsoft.VisualStudio.Shell.Interop.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Microsoft.VisualStudio.OLE.Interop.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\QtProjectEngineLib.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Microsoft.VisualStudio.dll"
+
+ StrCmp $0 "7.1" 0 MODULE_VSIP_UNINST_2005
+ ;Delete "$VSIP_INSTDIR\bin\$0\1033\Qt4VS2003UI.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\RegQt4VS2003.exe"
+ Delete "$VSIP_INSTDIR\bin\$0\Microsoft.VisualStudio.Designer.Interfaces.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Trolltech.Qt4VS2003Base.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Qt4VS2003.dll"
+ Goto MODULE_VSIP_CONTINUE
+
+ MODULE_VSIP_UNINST_2005:
+ StrCmp $0 "8.0" 0 MODULE_VSIP_UNINST_2008
+ ;Delete "$VSIP_INSTDIR\bin\$0\1033\Qt4VS2005UI.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\RegQt4VS2005.exe"
+ Delete "$VSIP_INSTDIR\bin\$0\Trolltech.Qt4VS2005Base.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Qt4VS2005.dll"
+ Goto MODULE_VSIP_CONTINUE
+
+ MODULE_VSIP_UNINST_2008:
+ ;Delete "$VSIP_INSTDIR\bin\$0\1033\Qt4VS2008UI.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\RegQt4VS2008.exe"
+ Delete "$VSIP_INSTDIR\bin\$0\Trolltech.Qt4VS2008Base.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Qt4VS2008.dll"
+
+ MODULE_VSIP_CONTINUE:
+ !insertmacro UnInstallUnManagedTranslation $0 "1033"
+ !insertmacro UnInstallUnManagedTranslation $0 "1031"
+ !insertmacro UnInstallUnManagedTranslation $0 "1041"
+ !insertmacro UnInstallManagedTranslation $0 "de"
+ !insertmacro UnInstallManagedTranslation $0 "ja"
+
+ ;RmDir "$VSIP_INSTDIR\bin\$0\1033"
+
+ Delete "$VSIP_INSTDIR\bin\$0\QtProjectLib.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\formeditor1Lib.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Axformeditor1Lib.dll"
+ Delete "$VSIP_INSTDIR\bin\$0\Qt4VSa.dll"
+ RmDir "$VSIP_INSTDIR\bin\$0"
+
+ Delete "$VSIP_INSTDIR\bin\FormEditor1.dll"
+ Delete "$VSIP_INSTDIR\bin\QtDesigner4.dll"
+ Delete "$VSIP_INSTDIR\bin\QtDesignerComponents4.dll"
+ Delete "$VSIP_INSTDIR\bin\QtCore4.dll"
+ Delete "$VSIP_INSTDIR\bin\QtGui4.dll"
+ Delete "$VSIP_INSTDIR\bin\QtXml4.dll"
+ Delete "$VSIP_INSTDIR\bin\QtScript4.dll"
+ RmDir "$VSIP_INSTDIR\bin"
+
+ Push $0
+ Call un.GetVSInstallationDir
+ Pop $1
+ ;Delete "$1\usertype.dat"
+
+ Delete "$VSIP_INSTDIR\plugins\imageformats\QtSvg4.dll"
+ Delete "$VSIP_INSTDIR\plugins\imageformats\qsvg4.dll"
+ Delete "$VSIP_INSTDIR\plugins\imageformats\qgif4.dll"
+ Delete "$VSIP_INSTDIR\plugins\imageformats\qjpeg4.dll"
+ Delete "$VSIP_INSTDIR\plugins\imageformats\qtiff4.dll"
+ Delete "$VSIP_INSTDIR\plugins\imageformats\qico4.dll"
+ RmDir "$VSIP_INSTDIR\plugins\imageformats"
+
+ Delete "$VSIP_INSTDIR\plugins\designer\qaxwidget.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\qt3supportwidgets.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\customwidgetplugin.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\worldtimeclockplugin.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\containerextension.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\taskmenuextension.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\qwebview.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\QtSql4.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\QtNetwork4.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\phonon4.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\QtWebKit4.dll"
+ Delete "$VSIP_INSTDIR\plugins\designer\Qt3Support4.dll"
+ RmDir "$VSIP_INSTDIR\plugins\designer"
+ RmDir "$VSIP_INSTDIR\plugins"
+
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+Function un.InstallAddin
+ Exch $0
+
+ StrCmp $0 "7.1" MODULE_VSIP_ADDIN_71 0
+ StrCmp $0 "8.0" MODULE_VSIP_ADDIN_80 0
+ Delete "$VSIP_INSTDIR\bin\$0\StartQtVSIP2008.AddIn"
+ DeleteRegValue SHCTX "Software\Microsoft\VisualStudio\9.0\AutomationOptions\LookInFolders" "$VSIP_INSTDIR\bin\$0"
+ Goto MODULE_VSIP_ADDIN_End
+
+ MODULE_VSIP_ADDIN_80:
+ Delete "$VSIP_INSTDIR\bin\$0\StartQtVSIP2005.AddIn"
+ DeleteRegValue SHCTX "Software\Microsoft\VisualStudio\8.0\AutomationOptions\LookInFolders" "$VSIP_INSTDIR\bin\$0"
+ Goto MODULE_VSIP_ADDIN_End
+
+ MODULE_VSIP_ADDIN_71:
+ Push $1
+ Push $2
+
+ Push $0
+ Call un.IsDotNETInstalled
+ Pop $1
+
+ ClearErrors
+ DetailPrint "Unregistering StartQtVSIP..."
+ nsExec::ExecToLog '"$1\regasm.exe" /unregister "$VSIP_INSTDIR\bin\$0\StartQtVSIP.dll"'
+ Pop $2
+ StrCmp $2 "error" 0 +3
+ MessageBox MB_OK 'The command $\n"$1\regasm.exe" /unregister "$VSIP_INSTDIR\bin\$0\StartQtVSIP.dll"$\n failed.'
+ Goto MODULE_VSIP_ADDIN_71_End
+
+ DeleteRegKey SHCTX "Software\Microsoft\VisualStudio\7.1\Addins\StartQtVSIP"
+
+ MODULE_VSIP_ADDIN_71_End:
+ Pop $2
+ Pop $1
+
+ MODULE_VSIP_ADDIN_End:
+
+ Delete "$VSIP_INSTDIR\bin\$0\StartQtVSIP.dll"
+ Pop $0
+FunctionEnd
+
+
+Function un.RegisterIntegration
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+
+ Push $0
+ Call un.GetVSInstallationDir
+ Pop $1
+
+ Push $0
+ Call un.IsDotNETInstalled
+ Pop $2
+
+; UnRegPackage:
+ IfErrors 0 ; clear the error flag
+ StrCpy $VS_VERSION "2003"
+ StrCmp $0 "8.0" 0 +2
+ StrCpy $VS_VERSION "2005"
+ StrCmp $0 "9.0" 0 +2
+ StrCpy $VS_VERSION "2008"
+
+ IfFileExists "$VSIP_INSTDIR\bin\$0\RegQt4VS$VS_VERSION.exe" 0 Module_VSIP_UnRegProjectEngine
+ nsExec::ExecToLog '"$VSIP_INSTDIR\bin\$0\RegQt4VS$VS_VERSION.exe" /root:Software\Microsoft\VisualStudio\$0 /unregister "$VSIP_INSTDIR\bin\$0\Qt4VS$VS_VERSION.dll"'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_UnRegProjectEngine
+ MessageBox MB_OK "Can not unregister Package!"
+
+ Module_VSIP_UnRegProjectEngine:
+ IfFileExists "$VSIP_INSTDIR\bin\$0\QtProjectEngineLib.dll" 0 Module_VSIP_UnRegFormEditor
+ nsExec::ExecToLog '"$2\regasm.exe" /unregister "$VSIP_INSTDIR\bin\$0\QtProjectEngineLib.dll"'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_UnRegFormEditor
+ MessageBox MB_OK "Can not unregister QtProjectEngineLib.dll!"
+
+ Module_VSIP_UnRegFormEditor:
+ IfFileExists "$VSIP_INSTDIR\bin\formeditor1.dll" 0 Module_VSIP_SetupVS
+
+ ClearErrors
+ SetOutPath "$VSIP_INSTDIR\bin"
+ push "$VSIP_INSTDIR\bin\formeditor1.dll"
+ call un.RegSvr
+
+ Module_VSIP_SetupVS:
+ SetOutPath "$1" ; don't stay in .\bin
+ StrCmp $1 "" Module_VSIP_EndUnReg 0
+ DetailPrint "Calling devenv /setup ..."
+ nsExec::Exec '"$1\devenv.exe" /setup'
+ Pop $3
+ StrCmp $3 "error" 0 Module_VSIP_SetupOK
+ MessageBox MB_OK "Can not setup devenv! The command $\n$1\devenv.exe /setup$\n failed. Try to run in manually!"
+ Goto Module_VSIP_EndUnReg
+ Module_VSIP_SetupOK:
+ DetailPrint "Running setup was successfull."
+ Module_VSIP_EndUnReg:
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+Function un.InstallSamples
+ Delete "$VSIP_INSTDIR\samples\AddressBook\adddialog.cpp"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\adddialog.h"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\adddialog.ui"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\addressbook.cpp"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\addressbook.h"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\AddressBook.ico"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\AddressBook.rc"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\addressbook.ui"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\AddressBook.vcproj"
+ Delete "$VSIP_INSTDIR\samples\AddressBook\main.cpp"
+ RMDir "$VSIP_INSTDIR\samples\AddressBook"
+ RMDir "$VSIP_INSTDIR\samples"
+FunctionEnd
+
+Function un.InstallResources
+ !insertmacro UnInstallResourceFiles "bmp" "bitmap"
+ !insertmacro UnInstallResourceFiles "txt" "text"
+ !insertmacro UnInstallResourceFiles "htm" "page"
+ !insertmacro UnInstallResourceFiles "xml" "xmlfile"
+ !insertmacro UnInstallResourceFiles "png" "image"
+ !insertmacro UnInstallResourceFiles "ui" "form"
+
+ RmDir "$VSIP_INSTDIR\resources"
+FunctionEnd
+!macroend
+
+!macro InstallResourceFiles TYPE TMPLNAME
+ File "${MODULE_VSIP_ROOT}\resources\${TYPE}.xml"
+ File "${MODULE_VSIP_ROOT}\resources\${TYPE}icon.bmp"
+ File "${MODULE_VSIP_ROOT}\resources\${TMPLNAME}.${TYPE}"
+!macroend
+
+!macro UnInstallResourceFiles TYPE TMPLNAME
+ Delete "$VSIP_INSTDIR\resources\${TYPE}.xml"
+ Delete "$VSIP_INSTDIR\resources\${TYPE}icon.bmp"
+ Delete "$VSIP_INSTDIR\resources\${TMPLNAME}.${TYPE}"
+!macroend
+
+!macro InstallUnManagedTranslation VS_SHORT LOCALE
+ CreateDirectory "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+ SetOutPath "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+ SetOverwrite ifnewer
+
+ StrCmp ${VS_SHORT} "9.0" 0 +2
+ File "${MODULE_VSIP_ROOT}\bin\9.0\${LOCALE}\Qt4VS2008UI.dll"
+
+ StrCmp ${VS_SHORT} "8.0" 0 +2
+ File "${MODULE_VSIP_ROOT}\bin\8.0\${LOCALE}\Qt4VS2005UI.dll"
+
+ StrCmp ${VS_SHORT} "7.1" 0 +2
+ File "${MODULE_VSIP_ROOT}\bin\7.1\${LOCALE}\Qt4VS2003UI.dll"
+!macroend
+
+!macro UnInstallUnManagedTranslation VS_SHORT LOCALE
+ StrCmp ${VS_SHORT} "9.0" 0 +2
+ Delete "$VSIP_INSTDIR\bin\9.0\${LOCALE}\Qt4VS2008UI.dll"
+
+ StrCmp ${VS_SHORT} "8.0" 0 +2
+ Delete "$VSIP_INSTDIR\bin\8.0\${LOCALE}\Qt4VS2005UI.dll"
+
+ StrCmp ${VS_SHORT} "7.1" 0 +2
+ Delete "$VSIP_INSTDIR\bin\7.1\${LOCALE}\Qt4VS2003UI.dll"
+
+ RMDir "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+!macroend
+
+!macro InstallManagedTranslation VS_SHORT LOCALE
+ CreateDirectory "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+ SetOutPath "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+ SetOverwrite ifnewer
+
+ StrCmp ${VS_SHORT} "9.0" 0 +3
+ File "${MODULE_VSIP_ROOT}\bin\9.0\${LOCALE}\Qt4VS2008.resources.dll"
+ File "${MODULE_VSIP_ROOT}\bin\9.0\${LOCALE}\QtProjectLib.resources.dll"
+
+ StrCmp ${VS_SHORT} "8.0" 0 +3
+ File "${MODULE_VSIP_ROOT}\bin\8.0\${LOCALE}\Qt4VS2005.resources.dll"
+ File "${MODULE_VSIP_ROOT}\bin\8.0\${LOCALE}\QtProjectLib.resources.dll"
+
+ StrCmp ${VS_SHORT} "7.1" 0 +3
+ File "${MODULE_VSIP_ROOT}\bin\7.1\${LOCALE}\Qt4VS2003.resources.dll"
+ File "${MODULE_VSIP_ROOT}\bin\7.1\${LOCALE}\QtProjectLib.resources.dll"
+!macroend
+
+!macro UnInstallManagedTranslation VS_SHORT LOCALE
+ StrCmp ${VS_SHORT} "9.0" 0 +2
+ Delete "$VSIP_INSTDIR\bin\9.0\${LOCALE}\Qt4VS2008.resources.dll"
+
+ StrCmp ${VS_SHORT} "8.0" 0 +2
+ Delete "$VSIP_INSTDIR\bin\8.0\${LOCALE}\Qt4VS2005.resources.dll"
+
+ StrCmp ${VS_SHORT} "7.1" 0 +2
+ Delete "$VSIP_INSTDIR\bin\7.1\${LOCALE}\Qt4VS2003.resources.dll"
+
+ Delete "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}\QtProjectLib.resources.dll"
+ RMDir "$VSIP_INSTDIR\bin\${VS_SHORT}\${LOCALE}"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_DESCRIPTION
+ !insertmacro MUI_DESCRIPTION_TEXT ${VSIP_SEC01} "Qt Integration for Visual Studio .NET 2003 v${MODULE_VSIP_VERSION}."
+ !insertmacro MUI_DESCRIPTION_TEXT ${VSIP_SEC02} "Qt Integration for Visual Studio .NET 2005 v${MODULE_VSIP_VERSION}."
+ !insertmacro MUI_DESCRIPTION_TEXT ${VSIP_SEC03} "Qt Integration for Visual Studio .NET 2008 v${MODULE_VSIP_VERSION}."
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_STARTUP
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+ Push $6
+
+ ClearErrors
+ StrCmp "$RUNNING_AS_ADMIN" "false" 0 Module_VSIP_CheckForInstallation
+!ifndef MODULE_VSIP_NO2003
+ SectionSetFlags ${VSIP_SEC01} "16"
+!endif
+!ifndef MODULE_VSIP_NO2005
+ SectionSetFlags ${VSIP_SEC02} "16"
+!endif
+!ifndef MODULE_VSIP_NO2008
+ SectionSetFlags ${VSIP_SEC03} "16"
+!endif
+ Module_VSIP_CheckForInstallation:
+
+ StrCpy $2 "0"
+ StrCpy $4 "0"
+ StrCpy $5 "0"
+
+ ClearErrors
+
+ Push "7.1"
+ Call IsIntegrationInstalled
+ Pop $1
+
+!ifndef MODULE_VSIP_NO2003
+ Push "7.1"
+ Call IsQMsNetInstalled
+ Pop $4
+
+ IntCmp $1 0 +2
+ SectionSetFlags ${VSIP_SEC01} "16"
+
+ Push "7.1"
+ Call GetVSInstallationDir
+ Pop $3
+ StrCmp $3 "" 0 +2
+ SectionSetFlags ${VSIP_SEC01} "16"
+!endif
+
+ ClearErrors
+
+ Push "8.0"
+ Call IsIntegrationInstalled
+ Pop $1
+
+!ifndef MODULE_VSIP_NO2005
+ Push "8.0"
+ Call IsQMsNetInstalled
+ Pop $2
+
+ IntCmp $1 0 +2
+ SectionSetFlags ${VSIP_SEC02} "16"
+
+ Push "8.0"
+ Call GetVSInstallationDir
+ Pop $3
+ StrCmp $3 "" 0 +3
+ SectionSetFlags ${VSIP_SEC02} "16"
+ Goto VSIP_STARTUP_2008
+
+ Call IsVS2005SP1Installed
+ Pop $1
+ ${If} $1 == 0
+ SectionSetFlags ${VSIP_SEC02} ${SF_RO}
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack 1 for Visual Studio 2005 is not installed.$\n${PRODUCT_NAME} for VS 2005 will not work properly without it.$\nYou will not be able to choose the ${PRODUCT_NAME} for VS 2005 component for installation."
+ ${EndIf}
+
+ Call IsDotNet2SP1Installed
+ Pop $1
+ ${If} $1 == 0
+ StrCpy $6 "1"
+ SectionSetFlags ${VSIP_SEC02} ${SF_RO}
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack 1 for .NET Framework 2.0 is not installed.$\n${PRODUCT_NAME} for VS 2005 will not work properly without it.$\nYou will not be able to choose the ${PRODUCT_NAME} for VS 2005 component for installation."
+ ${Else}
+ StrCpy $6 "0"
+ ${EndIf}
+VSIP_STARTUP_2008:
+!endif
+
+ ClearErrors
+
+ Push "9.0"
+ Call IsIntegrationInstalled
+ Pop $1
+
+!ifndef MODULE_VSIP_NO2008
+ Push "9.0"
+ Call IsQMsNetInstalled
+ Pop $5
+
+ IntCmp $1 0 +2
+ SectionSetFlags ${VSIP_SEC03} "16"
+
+ Push "9.0"
+ Call GetVSInstallationDir
+ Pop $3
+ StrCmp $3 "" 0 +2
+ SectionSetFlags ${VSIP_SEC03} "16"
+
+ ${If} $6 == "0"
+ Call IsDotNet2SP1Installed
+ Pop $1
+ ${If} $1 == 0
+ SectionSetFlags ${VSIP_SEC02} ${SF_RO}
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack 1 for .NET Framework 2.0 is not installed.$\n${PRODUCT_NAME} for VS 2008 will not work properly without it.$\nYou will not be able to choose the ${PRODUCT_NAME} for VS 2008 component for installation."
+ ${EndIf}
+ ${EndIf}
+!endif
+
+ IntOp $1 $2 + $4
+ IntOp $1 $1 + $5
+ IntCmp $1 0 +2
+ MessageBox MB_OK|MB_ICONEXCLAMATION "The installer has detected that the Qt Visual Studio Add-In is installed.$\r$\nThe Add-In conflicts with the integration."
+
+ StrCpy $VSIP_INSTDIR "$PROGRAMFILES\Nokia\Qt VS Integration"
+
+!ifndef MODULE_VSIP_NO2003
+ SectionSetSize ${VSIP_SEC01} 7000
+!endif
+!ifndef MODULE_VSIP_NO2005
+ SectionSetSize ${VSIP_SEC02} 7000
+!endif
+!ifndef MODULE_VSIP_NO2008
+ SectionSetSize ${VSIP_SEC03} 7000
+!endif
+
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_FINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_UNSTARTUP
+ !insertmacro ConfirmOnRemove "Qt4VS2003" "Qt Visual Studio Integration (VS2003)"
+ !insertmacro ConfirmOnRemove "Qt4VS2005" "Qt Visual Studio Integration (VS2005)"
+ !insertmacro ConfirmOnRemove "Qt4VS2008" "Qt Visual Studio Integration (VS2008)"
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_UNINSTALL
+
+ Push $0
+ Push $1
+ Push $2
+
+ ReadRegDWord $0 SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2003"
+ IntCmp $0 1 0 MODULE_VSIP_UNINSTALL2005
+ StrCpy $VS_VERSION_SHORT "7.1"
+ StrCpy $VS_VERSION "2003"
+ Push $VS_VERSION_SHORT
+ Call un.InstallVSIP
+ !insertmacro un.InstallHelpInVS "qt4vs" "$VS_VERSION_SHORT"
+
+ MODULE_VSIP_UNINSTALL2005:
+ ReadRegDWord $1 SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2005"
+ IntCmp $1 1 0 MODULE_VSIP_UNINSTALL2008
+ StrCpy $VS_VERSION_SHORT "8.0"
+ StrCpy $VS_VERSION "2005"
+ Push $VS_VERSION_SHORT
+ Call un.InstallVSIP
+ !insertmacro un.InstallHelpInVS "qt4vs" "$VS_VERSION_SHORT"
+
+ MODULE_VSIP_UNINSTALL2008:
+ ReadRegDWord $2 SHCTX "$PRODUCT_UNIQUE_KEY" "Qt4VS2008"
+ IntCmp $2 1 0 MODULE_VSIP_UNINSTALL_COMMON
+ StrCpy $VS_VERSION_SHORT "9.0"
+ StrCpy $VS_VERSION "2008"
+ Push $VS_VERSION_SHORT
+ Call un.InstallVSIP
+ !insertmacro un.InstallHelpInVS "qt4vs" "$VS_VERSION_SHORT"
+
+ MODULE_VSIP_UNINSTALL_COMMON:
+ Delete "$SMPROGRAMS\$STARTMENU_STRING\Visual Studio Integration Readme.lnk"
+
+ IfFileExists "$VSIP_INSTDIR\help\h2reg.exe" 0 MODULE_VSIP_UNINSTALL_HELP_DONE
+ !insertmacro un.RegisterHelp "$VSIP_INSTDIR\help" "qt4vs"
+ !insertmacro un.InstallHelp "$VSIP_INSTDIR\help" "qt4vs" "0.0"
+ Push "$VSIP_INSTDIR\help"
+ Call un.DeleteH2RegFiles
+ MODULE_VSIP_UNINSTALL_HELP_DONE:
+
+ Delete "$VSIP_INSTDIR\Readme.txt"
+ Delete "$VSIP_INSTDIR\ui.ico"
+ Delete "$VSIP_INSTDIR\Changes-${MODULE_VSIP_VERSION}"
+ RmDir "$VSIP_INSTDIR"
+
+ Pop $2
+ Pop $1
+ Pop $0
+
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!macro VSIP_UNFINISH
+!macroend
+
+;------------------------------------------------------------------------------------------------
+
+!else
+!macro VSIP_INITIALIZE
+!macroend
+!macro VSIP_SECTIONS
+!macroend
+!macro VSIP_MERGE_HELP_NAMESPACE_SECTIONS
+!macroend
+!macro VSIP_DESCRIPTION
+!macroend
+!macro VSIP_STARTUP
+!macroend
+!macro VSIP_FINISH
+!macroend
+!macro VSIP_UNSTARTUP
+!macroend
+!macro VSIP_CLEANUP_HELP_NAMESPACE
+!macroend
+!macro VSIP_UNINSTALL
+!macroend
+!macro VSIP_UNFINISH
+!macroend
+!endif
diff --git a/util/scripts/win-binary/nsis/opensource.ini b/util/scripts/win-binary/nsis/opensource.ini
new file mode 100644
index 0000000..03d6178
--- /dev/null
+++ b/util/scripts/win-binary/nsis/opensource.ini
@@ -0,0 +1,38 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=4
+
+[Field 1]
+Type=Label
+Text=You are now installing the Open Source Edition of Qt. It is licensed under GNU LGPL version 2.1 and the GPL version 3.
+Left=0
+Right=300
+Top=0
+Bottom=78
+
+[Field 2]
+Type=Link
+Text=http://qtsoftware.com/developer/downloads/qt
+State=http://qtsoftware.com/developer/downloads/qt
+Left=0
+Right=278
+Top=80
+Bottom=88
+
+[Field 3]
+Type=Link
+Text=http://qtsoftware.com/company/model
+State=http://qtsoftware.com/company/model
+Left=0
+Right=267
+Top=112
+Bottom=120
+
+[Field 4]
+Type=Label
+Text=To read more about Nokia's licensing, please go to:
+Left=0
+Right=278
+Top=97
+Bottom=105
+
diff --git a/util/scripts/win-binary/nsis/qsa.ini b/util/scripts/win-binary/nsis/qsa.ini
new file mode 100644
index 0000000..7af62e2
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qsa.ini
@@ -0,0 +1,28 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=3
+
+[Field 1]
+Type=Groupbox
+Text=QSA Build Options
+Left=0
+Right=299
+Top=9
+Bottom=65
+
+[Field 2]
+Type=Checkbox
+Text=Don't compile QSA Workbench into QSA.
+Left=20
+Right=284
+Top=27
+Bottom=37
+
+[Field 3]
+Type=Checkbox
+Text=Don't compile QSA Workbench nor QSA Editor into QSA.
+Left=20
+Right=247
+Top=45
+Bottom=56
+
diff --git a/util/scripts/win-binary/nsis/qtdir.ini b/util/scripts/win-binary/nsis/qtdir.ini
new file mode 100644
index 0000000..698a1d6
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtdir.ini
@@ -0,0 +1,70 @@
+; Ini file generated by the HM NIS Edit IO designer.
+[Settings]
+NumFields=8
+
+[Field 1]
+Type=Groupbox
+Text=Select Qt Version
+Left=0
+Right=299
+Top=65
+Bottom=130
+
+[Field 2]
+Type=Label
+Text=Please choose a Qt Version from the detected versions list. If the Qt Version you want to use is missing from the list, you should specify QTDIR manually.
+Left=4
+Right=294
+Top=1
+Bottom=20
+
+[Field 3]
+Type=Droplist
+Text=Droplist
+Flags=NOTIFY
+Left=9
+Right=290
+Top=85
+Bottom=138
+ListItems=
+
+[Field 4]
+Type=Label
+Text=Detected Qt Versions:
+Left=9
+Right=154
+Top=76
+Bottom=84
+
+[Field 5]
+Type=DirRequest
+Left=9
+Right=290
+Top=110
+Bottom=123
+
+[Field 6]
+Type=Label
+Text=Specify QTDIR manually:
+Left=9
+Right=154
+Top=102
+Bottom=110
+
+[Field 7]
+Type=Groupbox
+Text=Select a Compiler
+Left=0
+Right=299
+Top=24
+Bottom=59
+
+[Field 8]
+Type=Droplist
+Text=Droplist
+ListItems=
+Left=9
+Right=290
+Top=39
+Bottom=89
+
diff --git a/util/scripts/win-binary/nsis/qtjambieclipse.ini b/util/scripts/win-binary/nsis/qtjambieclipse.ini
new file mode 100644
index 0000000..2898c24
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtjambieclipse.ini
@@ -0,0 +1,26 @@
+[Settings]
+NumFields=3
+
+[Field 1]
+Type=Groupbox
+Text=Eclipse Installation
+Left=1
+Right=300
+Top=8
+Bottom=59
+
+[Field 2]
+Type=DirRequest
+State=C:\Eclipse
+Left=12
+Right=286
+Top=33
+Bottom=46
+
+[Field 3]
+Type=Label
+Text=Select the Eclipse installation you want to use:
+Left=12
+Right=157
+Top=22
+Bottom=30
diff --git a/util/scripts/win-binary/nsis/qtnsisext/binpatch.cpp b/util/scripts/win-binary/nsis/qtnsisext/binpatch.cpp
new file mode 100644
index 0000000..1c5109c
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/binpatch.cpp
@@ -0,0 +1,216 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <stdio.h>
+#include <locale>
+
+#include "binpatch.h"
+
+// returns positive value if it finds a null termination inside the buffer
+long BinPatch::getBufferStringLength(char *data, char *end)
+{
+ long size = 0;
+ while (data < end) {
+ if (*data == '\0')
+ return size;
+ ++data;
+ ++size;
+ }
+
+ return -1;
+}
+
+// returns true if data ends with one of the tokens. (Sep. with ;)
+bool BinPatch::endsWithTokens(const char *data)
+{
+ if(strlen(endTokens) > 0) {
+ char endstmp[1024];
+ ulong tlen = ulong(strlen(data));
+
+ if(strlen(endTokens) >= sizeof(endstmp))
+ return false;
+
+ strcpy(endstmp, endTokens);
+
+ char *token = strtok(endstmp, ";");
+
+ while(token != NULL) {
+ // check if it ends with the token
+ if ((tlen >= strlen(token))
+ && (stricmp((data+tlen)-strlen(token), token) == 0))
+ return true;
+ token = strtok(NULL, ";");
+ }
+ } else {
+ return true; //true if no tokens
+ }
+
+ return false; //no matching tokens
+}
+
+bool BinPatch::patchHelper(char *inbuffer, const char *oldstr, const char *newstr, size_t len, long *rw)
+{
+ char nc1 = *oldstr;
+ char nc2 = 0;
+ char *inend = inbuffer + len;
+ size_t oldlen = strlen(oldstr);
+ size_t newlen = strlen(newstr);
+ char *instart = inbuffer;
+ *rw = 0;
+ bool write = true;
+
+ isupper(nc1) ? nc2 = tolower(nc1) : nc2 = toupper(nc1);
+
+ while(inbuffer < inend) {
+ if ((*inbuffer == nc1) || (*inbuffer == nc2)) {
+ if (inbuffer > (inend-oldlen) || inbuffer > (inend-newlen)) {
+ *rw = (long)(inend-inbuffer); //rewind, not enough to make a compare
+ break;
+ }
+
+ if (strnicmp(inbuffer, oldstr, oldlen) == 0) {
+ if (useLength && (instart == inbuffer)) {
+ *rw = (long)(len+1); //we don't have access to the length byte, rewind all + 1!
+ write = false;
+ break;
+ }
+
+ long oldsize = -1;
+ if (useLength) { //VC60
+ oldsize = (unsigned char)(*(inbuffer-1));
+
+ // vc60 pdb files sometimes uses 0A, then it should be null terminated
+ if (oldsize < (long)oldlen) {
+ if (oldsize != 0x0A) { //strange case... skip
+ inbuffer+=oldlen;
+ continue;
+ }
+
+ oldsize = getBufferStringLength(inbuffer, inend);
+
+ if (oldsize < 0) {
+ *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer
+ break;
+ }
+ }
+
+ if (inbuffer > (inend-oldsize)) {
+ *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer
+ break;
+ }
+ } else { //VC7x
+ oldsize = getBufferStringLength(inbuffer, inend);
+ if (oldsize < 0) {
+ *rw = (long)(inend-inbuffer); //rewind, entire string not in buffer
+ break;
+ }
+ }
+
+ char oldPath[1024];
+ if (oldsize > sizeof(oldPath)) {
+ //at least don't crash
+ inbuffer+=oldsize;
+ continue;
+ }
+ memset(oldPath, '\0', sizeof(oldPath));
+ strncpy(oldPath, newstr, newlen);
+
+ if (insertReplace)
+ strncat(oldPath, inbuffer+oldlen, oldsize-oldlen);
+
+ // just replace if it ends with a token in endTokens
+ if (endsWithTokens(oldPath)) {
+ if (oldsize < (long)strlen(oldPath))
+ oldsize = (long)strlen(oldPath);
+
+ memcpy(inbuffer, oldPath, oldsize);
+ }
+
+ inbuffer+=oldsize;
+ continue;
+ }
+ }
+ ++inbuffer;
+ }
+
+ return write;
+}
+
+bool BinPatch::patch(const char *oldstr, const char *newstr)
+{
+ size_t oldlen = strlen(oldstr);
+ size_t newlen = strlen(newstr);
+
+ if ((!fileName || strlen(fileName) < 1)
+ || (!oldstr || oldlen < 1)
+ || (!newstr || newlen < 1))
+ return false;
+
+ FILE *input;
+
+ if (!(input = fopen(fileName, "r+b")))
+ {
+ fprintf(stderr, "Cannot open file %s!\n", fileName);
+ return false;
+ }
+
+ char data[60000];
+ long rw = 0;
+ long offset = 0;
+
+ size_t len;
+ len = fread(data, sizeof(char), sizeof(data), input);
+
+ do {
+ if (patchHelper(data, oldstr, newstr, len, &rw)) {
+ fseek(input, offset, SEEK_SET); //overwrite
+ fwrite(data, sizeof(char), len, input);
+ }
+
+ offset += (long)((-rw) + len);
+ if (fseek(input, offset, SEEK_SET) != 0)
+ break;
+ len = fread(data, sizeof(char), sizeof(data), input);
+ } while(!(feof(input) && (len <= oldlen || len <= newlen)));
+
+ fclose(input);
+
+ return true;
+}
diff --git a/util/scripts/win-binary/nsis/qtnsisext/binpatch.h b/util/scripts/win-binary/nsis/qtnsisext/binpatch.h
new file mode 100644
index 0000000..7cbc6a5
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/binpatch.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef BINPATCH_H
+#define BINPATCH_H
+
+#include <string.h>
+
+typedef unsigned long ulong;
+typedef unsigned int uint;
+
+class BinPatch
+{
+public:
+ BinPatch(const char *file)
+ : useLength(false), insertReplace(false)
+ {
+ strcpy(endTokens, "");
+ strcpy(fileName, file);
+ }
+
+ void enableUseLength(bool enabled)
+ { useLength = enabled; }
+ void enableInsertReplace(bool enabled)
+ { insertReplace = enabled; }
+ void setEndTokens(const char *tokens)
+ { strcpy(endTokens, tokens); }
+
+ bool patch(const char *oldstr, const char *newstr);
+
+private:
+ long getBufferStringLength(char *data, char *end);
+ bool endsWithTokens(const char *data);
+
+ bool patchHelper(char *inbuffer, const char *oldstr,
+ const char *newstr, size_t len, long *rw);
+
+ bool useLength;
+ bool insertReplace;
+ char endTokens[1024];
+ char fileName[1024];
+};
+
+#endif \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/qtnsisext/exdll.h b/util/scripts/win-binary/nsis/qtnsisext/exdll.h
new file mode 100644
index 0000000..3f5a0ef
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/exdll.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef _EXDLL_H_
+#define _EXDLL_H_
+
+// only include this file from one place in your DLL.
+// (it is all static, if you use it in two places it will fail)
+
+#define EXDLL_INIT() { \
+ g_stringsize=string_size; \
+ g_stacktop=stacktop; \
+ g_variables=variables; }
+
+// For page showing plug-ins
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+#define NOTIFY_BYE_BYE 'x'
+
+typedef struct _stack_t {
+ struct _stack_t *next;
+ char text[1]; // this should be the length of string_size
+} stack_t;
+
+
+static unsigned int g_stringsize;
+static stack_t **g_stacktop;
+static char *g_variables;
+
+static int __stdcall popstring(char *str); // 0 on success, 1 on empty stack
+static void __stdcall pushstring(char *str);
+
+enum
+{
+INST_0, // $0
+INST_1, // $1
+INST_2, // $2
+INST_3, // $3
+INST_4, // $4
+INST_5, // $5
+INST_6, // $6
+INST_7, // $7
+INST_8, // $8
+INST_9, // $9
+INST_R0, // $R0
+INST_R1, // $R1
+INST_R2, // $R2
+INST_R3, // $R3
+INST_R4, // $R4
+INST_R5, // $R5
+INST_R6, // $R6
+INST_R7, // $R7
+INST_R8, // $R8
+INST_R9, // $R9
+INST_CMDLINE, // $CMDLINE
+INST_INSTDIR, // $INSTDIR
+INST_OUTDIR, // $OUTDIR
+INST_EXEDIR, // $EXEDIR
+INST_LANG, // $LANGUAGE
+__INST_LAST
+};
+
+
+// utility functions (not required but often useful)
+static int __stdcall popstring(char *str)
+{
+ stack_t *th;
+ if (!g_stacktop || !*g_stacktop) return 1;
+ th=(*g_stacktop);
+ lstrcpy(str,th->text);
+ *g_stacktop = th->next;
+ GlobalFree((HGLOBAL)th);
+ return 0;
+}
+
+static void __stdcall pushstring(char *str)
+{
+ stack_t *th;
+ if (!g_stacktop) return;
+ th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize);
+ lstrcpyn(th->text,str,g_stringsize);
+ th->next=*g_stacktop;
+ *g_stacktop=th;
+}
+
+static char * __stdcall getuservariable(int varnum)
+{
+ if (varnum < 0 || varnum >= __INST_LAST) return NULL;
+ return g_variables+varnum*g_stringsize;
+}
+
+static void __stdcall setuservariable(int varnum, char *var)
+{
+ if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
+ lstrcpy(g_variables + varnum*g_stringsize, var);
+}
+
+
+
+#endif//_EXDLL_H_ \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/qtnsisext/licensefinder.cpp b/util/scripts/win-binary/nsis/qtnsisext/licensefinder.cpp
new file mode 100644
index 0000000..7de1618
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/licensefinder.cpp
@@ -0,0 +1,250 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "licensefinder.h"
+
+LicenseFinder::LicenseFinder()
+{
+ searched = false;
+ memset(licensee, '\0', sizeof(licensee)*sizeof(char));
+ memset(m_key, '\0', sizeof(m_key)*sizeof(char));
+ memset(m_oldkey, '\0', sizeof(m_oldkey)*sizeof(char));
+ memset(m_customerId, '\0', sizeof(m_customerId)*sizeof(char));
+ memset(m_products, '\0', sizeof(m_products)*sizeof(char));
+ memset(m_expiryDate, '\0', sizeof(m_expiryDate)*sizeof(char));
+}
+
+char *LicenseFinder::getLicensee()
+{
+ if (!searched)
+ searchLicense();
+
+ return licensee;
+}
+
+char *LicenseFinder::getLicenseKey()
+{
+ if (!searched)
+ searchLicense();
+
+ return m_key;
+}
+
+char *LicenseFinder::getOldLicenseKey()
+{
+ if (!searched)
+ searchLicense();
+
+ return m_oldkey;
+}
+
+char *LicenseFinder::getCustomerID()
+{
+ if (!searched)
+ searchLicense();
+
+ return m_customerId;
+}
+
+char *LicenseFinder::getProducts()
+{
+ if (!searched)
+ searchLicense();
+
+ return m_products;
+}
+
+char *LicenseFinder::getExpiryDate()
+{
+ if (!searched)
+ searchLicense();
+
+ return m_expiryDate;
+}
+
+void LicenseFinder::searchLicense()
+{
+ searched = true;
+ char *path = getenv("HOME");
+ if (path && lookInDirectory(path))
+ return;
+
+ path = getenv("USERPROFILE");
+ if (path && lookInDirectory(path))
+ return;
+
+ path = getenv("HOMEDRIVE");
+ if (path) {
+ char *dir = getenv("HOMEPATH");
+ if (dir) {
+ char *combined = (char*)malloc(sizeof(char)*(strlen(path) + strlen(dir) + 1));
+ strcpy(combined, path);
+ strcat(combined, dir);
+ lookInDirectory(combined);
+ free(combined);
+ }
+ }
+}
+
+bool LicenseFinder::lookInDirectory(const char *dir)
+{
+ FILE *f;
+ char file[_MAX_PATH];
+ char buf[60000];
+
+ // reset the buffers again, just to be safe :)
+ memset(file, '\0', sizeof(file));
+ memset(buf, '\0', sizeof(buf));
+ memset(licensee, '\0', sizeof(licensee));
+ memset(m_key, '\0', sizeof(m_key));
+ memset(m_oldkey, '\0', sizeof(m_oldkey));
+ memset(m_customerId, '\0', sizeof(m_customerId));
+ memset(m_products, '\0', sizeof(m_products));
+ memset(m_expiryDate, '\0', sizeof(m_expiryDate));
+
+ if (((strlen(dir)+strlen("\\.qt-license"))*sizeof(char)) >= _MAX_PATH)
+ return false;
+
+ strcpy(file, dir);
+ strcat(file, "\\.qt-license");
+ if ((f = fopen(file, "r")) == NULL)
+ return false;
+
+ size_t r = fread(buf, sizeof(char), 59999, f);
+ buf[r] = '\0';
+
+ /* Licensee */
+ const char *pat1 = "Licensee=\"";
+ char *tmp = findPattern(buf, pat1, ulong(r));
+ if (tmp && (strlen(tmp) > 1)) {
+ char *end = strchr(tmp, '\"');
+ if (end && ((end-tmp) < MAX_LICENSEE_LENGTH))
+ strncpy(licensee, tmp, end-tmp);
+ }
+
+ /* LicenseKey */
+ const char *pat2 = "LicenseKeyExt=";
+ tmp = findPattern(buf, pat2, ulong(r));
+ if (tmp) {
+ char *end = strchr(tmp, '\r');
+ if (!end)
+ end = strchr(tmp, '\n');
+ if (end && ((end-tmp) < MAX_KEY_LENGTH))
+ strncpy(m_key, tmp, end-tmp);
+ else if (strlen(tmp) < MAX_KEY_LENGTH)
+ strcpy(m_key, tmp);
+ }
+
+ /* OldLicenseKey */
+ const char *pat3 = "LicenseKey=";
+ tmp = findPattern(buf, pat3, ulong(r));
+ if (tmp) {
+ char *end = strchr(tmp, '\r');
+ if (!end)
+ end = strchr(tmp, '\n');
+ if (end && ((end-tmp) < MAX_KEY_LENGTH))
+ strncpy(m_oldkey, tmp, end-tmp);
+ else if (strlen(tmp) < MAX_KEY_LENGTH)
+ strcpy(m_oldkey, tmp);
+ }
+
+ /* CustomerID */
+ const char *pat4 = "CustomerID=\"";
+ tmp = findPattern(buf, pat4, ulong(r));
+ if (tmp && (strlen(tmp) > 1)) {
+ char *end = strchr(tmp, '\"');
+ if (end && ((end-tmp) < MAX_QT3INFO_LENGTH))
+ strncpy(m_customerId, tmp, end-tmp);
+ }
+
+ /* Products */
+ const char *pat5 = "Products=\"";
+ tmp = findPattern(buf, pat5, ulong(r));
+ if (tmp && (strlen(tmp) > 1)) {
+ char *end = strchr(tmp, '\"');
+ if (end && ((end-tmp) < MAX_QT3INFO_LENGTH))
+ strncpy(m_products, tmp, end-tmp);
+ }
+
+ /* ExpiryDate */
+ const char *pat6 = "ExpiryDate=";
+ tmp = findPattern(buf, pat6, ulong(r));
+ if (tmp) {
+ char *end = strchr(tmp, '\r');
+ if (!end)
+ end = strchr(tmp, '\n');
+ if (end && ((end-tmp) < MAX_QT3INFO_LENGTH))
+ strncpy(m_expiryDate, tmp, end-tmp);
+ else if (strlen(tmp) < MAX_QT3INFO_LENGTH)
+ strcpy(m_expiryDate, tmp);
+ }
+
+ fclose(f);
+
+ return true;
+}
+
+/* copied from binpatch.cpp */
+char *LicenseFinder::findPattern(char *h, const char *n, ulong hlen)
+{
+ if (!h || !n || hlen == 0)
+ return 0;
+
+ ulong nlen;
+
+ char nc = *n++;
+ nlen = ulong(strlen(n));
+ char hc;
+
+ do {
+ do {
+ hc = *h++;
+ if (hlen-- < 1)
+ return 0;
+ } while (hc != nc);
+ if (nlen > hlen)
+ return 0;
+ } while (strncmp(h, n, nlen) != 0);
+ return h + nlen;
+} \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/qtnsisext/licensefinder.h b/util/scripts/win-binary/nsis/qtnsisext/licensefinder.h
new file mode 100644
index 0000000..0957d65
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/licensefinder.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef LICENSEFINDER_H
+#define LICENSEFINDER_H
+
+#define MAX_KEY_LENGTH 512
+#define MAX_LICENSEE_LENGTH 512
+#define MAX_QT3INFO_LENGTH 512
+
+typedef unsigned long ulong;
+
+class LicenseFinder
+{
+public:
+ LicenseFinder();
+ char *getLicenseKey();
+ char *getOldLicenseKey();
+ char *getLicensee();
+ char *getCustomerID();
+ char *getProducts();
+ char *getExpiryDate();
+
+private:
+ void searchLicense();
+ bool lookInDirectory(const char* dir);
+ char *findPattern(char *h, const char *n, ulong hlen);
+ bool searched;
+ char m_key[MAX_KEY_LENGTH];
+ char m_oldkey[MAX_KEY_LENGTH];
+ char licensee[MAX_LICENSEE_LENGTH];
+ char m_customerId[MAX_QT3INFO_LENGTH];
+ char m_products[MAX_QT3INFO_LENGTH];
+ char m_expiryDate[MAX_QT3INFO_LENGTH];
+};
+
+#endif \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/qtnsisext/mingw.cpp b/util/scripts/win-binary/nsis/qtnsisext/mingw.cpp
new file mode 100644
index 0000000..15ff3c1
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/mingw.cpp
@@ -0,0 +1,156 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <windows.h>
+#include <io.h>
+#include <stdio.h>
+#include "mingw.h"
+
+HANDLE hChildStdoutWr, hChildStdoutRd;
+
+#define VERSION_SIZE 30
+#define WIN32_VERSION_STRING "__W32API_VERSION 3.2"
+
+BOOL CreateChildProcess(char *command)
+{
+ PROCESS_INFORMATION piProcInfo;
+ STARTUPINFOA siStartInfo;
+ BOOL bFuncRetn = FALSE;
+
+ ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
+
+ ZeroMemory( &siStartInfo, sizeof(STARTUPINFOA) );
+ siStartInfo.cb = sizeof(STARTUPINFOA);
+ siStartInfo.hStdError = hChildStdoutWr;
+ siStartInfo.hStdOutput = hChildStdoutWr;
+ siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ bFuncRetn = CreateProcessA(NULL,
+ command,
+ NULL, // process security attributes
+ NULL, // thread security attributes
+ TRUE, // inherit handles
+ CREATE_NO_WINDOW,
+ NULL, // use environment
+ NULL, // use current directory
+ &siStartInfo,
+ &piProcInfo);
+
+ if (bFuncRetn == 0)
+ return 0;
+ else
+ {
+ CloseHandle(piProcInfo.hProcess);
+ CloseHandle(piProcInfo.hThread);
+ return bFuncRetn;
+ }
+}
+
+void getMinGWVersion(char *path, int *major, int *minor, int *patch)
+{
+ char command[MINGW_BUFFER_SIZE];
+ char instr[VERSION_SIZE];
+
+ strcpy(command, path);
+ strcat(command, "\\bin\\gcc.exe --version");
+
+ SECURITY_ATTRIBUTES saAttr;
+
+ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
+ saAttr.bInheritHandle = TRUE;
+ saAttr.lpSecurityDescriptor = NULL;
+
+ if (!CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0))
+ return;;
+
+ if (CreateChildProcess(command) == 0)
+ return;
+
+ DWORD nBytes = 0;
+ ReadFile(hChildStdoutRd, instr, VERSION_SIZE, &nBytes, NULL);
+ instr[VERSION_SIZE-1] = '\0';
+
+ char *gcc = strstr(instr, "(GCC)");
+ if (gcc == NULL)
+ return;
+
+ sscanf(gcc, "(GCC) %d.%d.%d ", major, minor, patch);
+}
+
+bool hasValidIncludeFiles(char *path)
+{
+ char filename[MINGW_BUFFER_SIZE];
+ char buffer[MINGW_BUFFER_SIZE];
+
+ strcpy(filename, path);
+ strcat(filename, "\\include\\w32api.h");
+
+ FILE *finc;
+ if ((finc = fopen(filename, "rb")) == NULL)
+ return false;
+
+ memset(buffer, '\0', sizeof(char)*MINGW_BUFFER_SIZE);
+ fread(buffer, sizeof(char), MINGW_BUFFER_SIZE-1, finc);
+
+ if (strstr(buffer, WIN32_VERSION_STRING) != NULL)
+ return true;
+
+ return false;
+}
+
+bool shInEnvironment()
+{
+ char chpath[_MAX_PATH];
+ char *env = getenv("PATH");
+ char seps[] = ";";
+ char *path;
+
+ path = strtok(env, seps);
+ while(path != NULL)
+ {
+ sprintf(chpath, "%s\\sh.exe", path);
+ if(_access(chpath, 0) != -1)
+ return true;
+
+ path = strtok(NULL, seps);
+ }
+
+ return false;
+}
diff --git a/util/scripts/win-binary/nsis/qtnsisext/mingw.h b/util/scripts/win-binary/nsis/qtnsisext/mingw.h
new file mode 100644
index 0000000..e975a9e
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/mingw.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#define MINGW_BUFFER_SIZE 1024
+
+void getMinGWVersion(char *path, int *major, int *minor, int *patch);
+bool hasValidIncludeFiles(char *path);
+bool shInEnvironment(); \ No newline at end of file
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.exe b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.exe
new file mode 100755
index 0000000..b9ec6d2
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.exe
Binary files differ
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.vcproj b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.vcproj
new file mode 100644
index 0000000..aeed5ec
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatcher.vcproj
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="qtlibspatcher"
+ ProjectGUID="{DC56C66A-5D15-46C8-91E6-AB36FC26F8DA}"
+ RootNamespace="qtlibspatcher"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\binpatch.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\qtlibspatchermain.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\binpatch.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtlibspatchermain.cpp b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatchermain.cpp
new file mode 100644
index 0000000..008cc46
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtlibspatchermain.cpp
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "binpatch.h"
+#include <stdio.h>
+
+bool patchBinaryWithQtPathes(const char *fileName, const char *baseQtPath)
+{
+ bool result = true;
+
+ static const struct
+ {
+ const char *variable;
+ const char *subDirectory;
+ } variables[] = {
+ {"qt_prfxpath=", ""},
+ {"qt_docspath=", "/doc"},
+ {"qt_hdrspath=", "/include"},
+ {"qt_libspath=", "/lib"},
+ {"qt_binspath=", "/bin"},
+ {"qt_plugpath=", "/plugins"},
+ {"qt_datapath=", ""},
+ {"qt_trnspath=", "/translations"},
+ {"qt_xmplpath=", "/examples"},
+ {"qt_demopath=", "/demos"}
+ };
+
+ for (int i = 0; i < sizeof(variables)/sizeof(variables[0]); i++) {
+ char newStr[256] = "";
+ strncpy(newStr, variables[i].variable, sizeof(newStr));
+ newStr[sizeof(newStr) - 1] = 0;
+ strncat(newStr, baseQtPath, sizeof(newStr) - strlen(newStr) - 1);
+ newStr[sizeof(newStr) - 1] = 0;
+ strncat(newStr, variables[i].subDirectory, sizeof(newStr) - strlen(newStr) - 1);
+ newStr[sizeof(newStr) - 1] = 0;
+ BinPatch binFile(fileName);
+ if (!binFile.patch(variables[i].variable, newStr)) {
+ result = false;
+ break;
+ }
+ }
+
+ return result;
+}
+
+bool patchBinariesWithQtPathes(const char *baseQtPath)
+{
+ bool result = true;
+
+ static const char *filesToPatch[] = {
+ "/bin/qmake.exe",
+ "/bin/QtCore4.dll",
+ "/bin/QtCored4.dll"
+ };
+
+ for (int i = 0; i < sizeof(filesToPatch)/sizeof(filesToPatch[0]); i++) {
+ char fileName[FILENAME_MAX] = "";
+ strncpy(fileName, baseQtPath, sizeof(fileName));
+ fileName[sizeof(fileName)-1] = '\0';
+ strncat(fileName, filesToPatch[i], sizeof(fileName) - strlen(fileName) - 1);
+ fileName[sizeof(fileName)-1] = '\0';
+ if (!patchBinaryWithQtPathes(fileName, baseQtPath)) {
+ result = false;
+ break;
+ }
+ }
+
+ return result;
+}
+
+bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
+{
+ bool result = true;
+
+ static const struct
+ {
+ const char *fileName;
+ const char *sourceLocation;
+ } libraries[] = {
+ {"/bin/Qt3Supportd4.dll", "/src/qt3support/"},
+ {"/bin/QtCored4.dll", "/src/corelib/"},
+ {"/bin/QtGuid4.dll", "/src/gui/"},
+ {"/bin/QtHelpd4.dll", "/tools/assistant/lib/"},
+ {"/bin/QtNetworkd4.dll", "/src/network/"},
+ {"/bin/QtOpenGLd4.dll", "/src/opengl/"},
+ {"/bin/QtScriptd4.dll", "/src/script/"},
+ {"/bin/QtSqld4.dll", "/src/sql/"},
+ {"/bin/QtSvgd4.dll", "/src/svg/"},
+ {"/bin/QtTestd4.dll", "/src/testlib/"},
+ {"/bin/QtWebKitd4.dll", "/src/3rdparty/webkit/WebCore/"},
+ {"/bin/QtXmld4.dll", "/src/xml/"},
+ {"/bin/QtXmlPatternsd4.dll", "/src/xmlpatterns/"},
+ {"/plugins/accessible/qtaccessiblecompatwidgetsd4.dll", "/src/plugins/accessible/compat/"},
+ {"/plugins/accessible/qtaccessiblewidgetsd4.dll", "/src/plugins/accessible/widgets/"},
+ {"/plugins/codecs/qcncodecsd4.dll", "/src/plugins/codecs/cn/"},
+ {"/plugins/codecs/qjpcodecsd4.dll", "/src/plugins/codecs/jp/"},
+ {"/plugins/codecs/qkrcodecsd4.dll", "/src/plugins/codecs/kr/"},
+ {"/plugins/codecs/qtwcodecsd4.dll", "/src/plugins/codecs/tw/"},
+ {"/plugins/iconengines/qsvgicond4.dll", "/src/plugins/iconengines/svgiconengine/"},
+ {"/plugins/imageformats/qgifd4.dll", "/src/plugins/imageformats/gif/"},
+ {"/plugins/imageformats/qjpegd4.dll", "/src/plugins/imageformats/jpeg/"},
+ {"/plugins/imageformats/qmngd4.dll", "/src/plugins/imageformats/mng/"},
+ {"/plugins/imageformats/qsvgd4.dll", "/src/plugins/imageformats/svg/"},
+ {"/plugins/imageformats/qtiffd4.dll", "/src/plugins/imageformats/tiff/"},
+ {"/plugins/sqldrivers/qsqlited4.dll", "/src/plugins/sqldrivers/sqlite/"},
+// {"/plugins/sqldrivers/qsqlodbcd4.dll", "/src/plugins/sqldrivers/odbc/"}
+ };
+
+ for (int i = 0; i < sizeof(libraries)/sizeof(libraries[0]); i++) {
+ char fileName[FILENAME_MAX] = "";
+ strncpy(fileName, baseQtPath, sizeof(fileName));
+ fileName[sizeof(fileName)-1] = '\0';
+ strncat(fileName, libraries[i].fileName, sizeof(fileName) - strlen(fileName) - 1);
+ fileName[sizeof(fileName)-1] = '\0';
+
+ char oldSourcePath[FILENAME_MAX] =
+ "C:/depot/qt-workbench/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Trolltech";
+ strncat(oldSourcePath, libraries[i].sourceLocation, sizeof(oldSourcePath) - strlen(oldSourcePath) - 1);
+ oldSourcePath[sizeof(oldSourcePath)-1] = '\0';
+
+ char newSourcePath[FILENAME_MAX] = "";
+ strncpy(newSourcePath, baseQtPath, sizeof(newSourcePath));
+ newSourcePath[sizeof(newSourcePath)-1] = '\0';
+ strncat(newSourcePath, libraries[i].sourceLocation, sizeof(newSourcePath) - strlen(newSourcePath) - 1);
+ newSourcePath[sizeof(newSourcePath)-1] = '\0';
+
+ BinPatch binFile(fileName);
+ if (!binFile.patch(oldSourcePath, newSourcePath)) {
+ result = false;
+ break;
+ }
+ }
+
+ return result;
+}
+
+int main(int argc, char *args[])
+{
+ if (argc != 2) {
+ printf("Please provide a QTDIR value as parameter.\n"
+ "This is also the location where the binaries are expected\n"
+ "in the \"/bin\" and \"/plugins\" subdirectories.\n");
+ return 1;
+ }
+
+ char baseQtPath[FILENAME_MAX] = "";
+ strncpy(baseQtPath, args[1], sizeof(baseQtPath));
+ baseQtPath[sizeof(baseQtPath)-1] = '\0';
+
+ // Convert backslash to slash
+ for (char *p = baseQtPath; *p != '\0'; p++)
+ if (*p == '\\')
+ *p = '/';
+
+ // Remove trailing slash(es)
+ for (char *p = baseQtPath + strlen(baseQtPath) - 1; p != baseQtPath; p--)
+ if (*p == '/')
+ *p = '\0';
+ else
+ break;
+
+ return patchBinariesWithQtPathes(baseQtPath) && patchDebugLibrariesWithQtPath(baseQtPath)?0:1;
+}
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.cpp b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.cpp
new file mode 100644
index 0000000..c9deb73
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.cpp
@@ -0,0 +1,495 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the utils of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <windows.h>
+#include "exdll.h"
+#include "keydec.h"
+#include "licensefinder.h"
+#include "binpatch.h"
+#include "mingw.h"
+#include <stdio.h>
+#include <time.h>
+
+HINSTANCE g_hInstance;
+HWND g_hwndParent;
+
+#define EXPORT_NSIS_FUNCTION(funcName) \
+extern "C" void __declspec(dllexport) funcName(HWND hwndParent, int string_size, \
+ char *variables, stack_t **stacktop)
+
+BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+ g_hInstance=static_cast<HINSTANCE>(hInst);
+ return TRUE;
+}
+
+EXPORT_NSIS_FUNCTION(IsValidLicense)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char isValid[2];
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid() && (
+ kdec.getPlatforms() & KeyDecoder::Windows
+ || kdec.getPlatforms() & KeyDecoder::Embedded
+ || kdec.getPlatforms() & KeyDecoder::WinCE))
+ strcpy(isValid, "1");
+ else
+ strcpy(isValid, "0");
+
+ LocalFree(key);
+ pushstring(isValid);
+}
+
+EXPORT_NSIS_FUNCTION(IsValidWinCELicense)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char isValid[2];
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid() && (kdec.getPlatforms() & KeyDecoder::WinCE))
+ strcpy(isValid, "1");
+ else
+ strcpy(isValid, "0");
+
+ LocalFree(key);
+ pushstring(isValid);
+}
+
+EXPORT_NSIS_FUNCTION(HasLicenseProduct)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char retVal[2];
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *product = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ uint qtproduct = 0;
+
+ popstring(key);
+ popstring(product);
+
+ for (int i=0; i<KeyDecoder::NumberOfProducts; ++i) {
+ if (KeyDecoder::Products[i] != 0 && stricmp(product, KeyDecoder::Products[i]) == 0) {
+ qtproduct = (1 << i);
+ break;
+ }
+ }
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid()
+ && (qtproduct != 0)
+ && (kdec.getProducts() & qtproduct)) {
+ strcpy(retVal, "1");
+ } else {
+ strcpy(retVal, "0");
+ }
+
+ LocalFree(product);
+ LocalFree(key);
+ pushstring(retVal);
+}
+
+EXPORT_NSIS_FUNCTION(GetLicenseID)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ char lcnsid[512];
+ lcnsid[0] = '\0';
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid()) {
+ uint qtlcnsid = kdec.getLicenseID();
+ sprintf(lcnsid, "%d", qtlcnsid);
+ }
+
+ LocalFree(key);
+ pushstring(lcnsid);
+}
+
+EXPORT_NSIS_FUNCTION(GetLicenseProduct)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ char lcnsprod[512];
+ lcnsprod[0] = '\0';
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid()) {
+ uint qtschema = kdec.getLicenseSchema();
+ if(qtschema & KeyDecoder::SupportedEvaluation)
+ strcpy(lcnsprod, "SupportedEvaluation");
+ else if(qtschema & KeyDecoder::UnsupportedEvaluation)
+ strcpy(lcnsprod, "UnsupportedEvaluation");
+ else if(qtschema & KeyDecoder::FullSourceEvaluation)
+ strcpy(lcnsprod, "FullSourceEvaluation");
+ else if(qtschema & KeyDecoder::Academic)
+ strcpy(lcnsprod, "Academic");
+ else if(qtschema & KeyDecoder::Educational)
+ strcpy(lcnsprod, "Educational");
+ else if(qtschema & KeyDecoder::FullCommercial)
+ {
+ uint qtproduct = kdec.getProducts();
+ if (qtproduct & KeyDecoder::QtUniversal)
+ strcpy(lcnsprod, "Universal");
+ else if(qtproduct & KeyDecoder::QtDesktop)
+ strcpy(lcnsprod, "Desktop");
+ else if(qtproduct & KeyDecoder::QtDesktopLight)
+ strcpy(lcnsprod, "DesktopLight");
+ else if(qtproduct & KeyDecoder::QtConsole)
+ strcpy(lcnsprod, "Console");
+ }
+ }
+
+ LocalFree(key);
+ pushstring(lcnsprod);
+}
+
+EXPORT_NSIS_FUNCTION(GetLicensePlatform)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ char lcnsplat[512];
+ lcnsplat[0] = '\0';
+
+ KeyDecoder kdec(key);
+ if (kdec.getPlatforms() == KeyDecoder::AllOS)
+ strcpy(lcnsplat, "AllOS");
+ else if (kdec.getPlatforms() & KeyDecoder::Embedded)
+ strcpy(lcnsplat, "Embedded");
+ else if (kdec.getPlatforms() & KeyDecoder::WinCE)
+ strcpy(lcnsplat, "Embedded");
+ else if (kdec.getPlatforms() & KeyDecoder::Windows)
+ strcpy(lcnsplat, "Windows");
+
+ LocalFree(key);
+ pushstring(lcnsplat);
+}
+
+EXPORT_NSIS_FUNCTION(UsesUSLicense)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char isUSCustomer[2];
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid()
+ && (kdec.getLicenseFeatures() & KeyDecoder::USCustomer))
+ strcpy(isUSCustomer, "1");
+ else
+ strcpy(isUSCustomer, "0");
+
+ LocalFree(key);
+ pushstring(isUSCustomer);
+}
+
+EXPORT_NSIS_FUNCTION(IsValidDate)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ int year = 0;
+ int month = 0;
+ int day = 0;
+ char isValid[2];
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *pkgDate = (char *)LocalAlloc(LPTR, g_stringsize+1);
+
+ popstring(key);
+ popstring(pkgDate);
+
+ if (strlen(pkgDate) > 0)
+ {
+ sscanf(pkgDate, "%d-%d-%d", &year, &month, &day);
+ } else {
+ //use current date
+ char curDate[9];
+ _strdate(curDate);
+ sscanf(curDate, "%d/%d/%d", &month, &day, &year);
+ year += 2000;
+ }
+
+ KeyDecoder kdec(key);
+ CDate expiryDate = kdec.getExpiryDate();
+ if (year == expiryDate.year()) {
+ if (month == expiryDate.month()) {
+ if (day <= expiryDate.day()) {
+ strcpy(isValid, "1");
+ } else {
+ strcpy(isValid, "0");
+ }
+ } else if (month < expiryDate.month()) {
+ strcpy(isValid, "1");
+ } else {
+ strcpy(isValid, "0");
+ }
+ } else if (year < expiryDate.year()) {
+ strcpy(isValid, "1");
+ } else {
+ strcpy(isValid, "0");
+ }
+
+ LocalFree(pkgDate);
+ LocalFree(key);
+ pushstring(isValid);
+}
+
+EXPORT_NSIS_FUNCTION(IsFloatingLicense)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *key = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(key);
+ char isFloatingLicense[2];
+
+ KeyDecoder kdec(key);
+ if (kdec.IsValid() &&
+ kdec.getLicenseFeatures() & KeyDecoder::FloatingLicense)
+ strcpy(isFloatingLicense, "1");
+ else
+ strcpy(isFloatingLicense, "0");
+
+ LocalFree(key);
+ pushstring(isFloatingLicense);
+}
+
+EXPORT_NSIS_FUNCTION(GetLicenseInfo)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ LicenseFinder f;
+ pushstring(f.getLicenseKey());
+ pushstring(f.getOldLicenseKey());
+ pushstring(f.getLicensee());
+ pushstring(f.getCustomerID());
+ pushstring(f.getProducts());
+ pushstring(f.getExpiryDate());
+}
+
+EXPORT_NSIS_FUNCTION(PatchVC6Binary)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *fileName = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *oldStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *newStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+
+ popstring(fileName);
+ popstring(oldStr);
+ popstring(newStr);
+
+ // remove last separator...
+ int oldLen = (int)strlen(oldStr);
+ int newLen = (int)strlen(newStr);
+ if (oldStr[oldLen-1] == '\\')
+ oldStr[oldLen-1] = '\0';
+ if (newStr[newLen-1] == '\\')
+ newStr[newLen-1] = '\0';
+
+ BinPatch binFile(fileName);
+ binFile.enableInsertReplace(true);
+ binFile.enableUseLength(true);
+ binFile.setEndTokens(".cpp;.h;.moc;.pdb");
+ binFile.patch(oldStr, newStr);
+
+ //patch also with path sep. the other way since
+ //vc60 in some cases uses different path separators :|
+ char *reverse = (char *)malloc(sizeof(char)*(oldLen+1));
+ for (int i=0; i<oldLen; ++i) {
+ if (oldStr[i] == '\\')
+ reverse[i] = '/';
+ else
+ reverse[i] = oldStr[i];
+ }
+ reverse[oldLen] = '\0';
+ binFile.patch(reverse, newStr);
+
+ LocalFree(newStr);
+ LocalFree(oldStr);
+ LocalFree(fileName);
+}
+
+EXPORT_NSIS_FUNCTION(PatchVC7Binary)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *fileName = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *oldStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *newStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+
+ popstring(fileName);
+ popstring(oldStr);
+ popstring(newStr);
+
+ BinPatch binFile(fileName);
+ binFile.enableInsertReplace(true);
+ binFile.setEndTokens(".cpp;.h;.moc;.pdb");
+ binFile.patch(oldStr, newStr);
+
+ LocalFree(newStr);
+ LocalFree(oldStr);
+ LocalFree(fileName);
+}
+
+EXPORT_NSIS_FUNCTION(PatchBinary)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *fileName = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *oldStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *newStr = (char *)LocalAlloc(LPTR, g_stringsize+1);
+
+ popstring(fileName);
+ popstring(oldStr);
+ popstring(newStr);
+
+ BinPatch binFile(fileName);
+ binFile.patch(oldStr, newStr);
+
+ LocalFree(newStr);
+ LocalFree(oldStr);
+ LocalFree(fileName);
+}
+
+EXPORT_NSIS_FUNCTION(ShowLicenseFile)
+{
+ char licenseBuffer[60000];
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ void *hCtrl = 0;
+ char *strCtrl = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ char *strLicenseFile = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(strCtrl);
+ popstring(strLicenseFile);
+
+ if (sscanf(strCtrl, "%d", &hCtrl) == 1) {
+ FILE *fIn = fopen(strLicenseFile, "rb");
+ if (fIn) {
+ size_t r = fread(licenseBuffer, sizeof(char), 59999, fIn);
+ licenseBuffer[r] = '\0';
+ fclose(fIn);
+ SendMessage((HWND)hCtrl, (UINT)WM_SETTEXT, 0, (LPARAM)licenseBuffer);
+ }
+ }
+
+ LocalFree(strLicenseFile);
+ LocalFree(strCtrl);
+}
+
+EXPORT_NSIS_FUNCTION(HasValidWin32Library)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char isValid[2];
+ char *path = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(path);
+
+ if (hasValidIncludeFiles(path))
+ strcpy(isValid, "1");
+ else
+ strcpy(isValid, "0");
+
+ LocalFree(path);
+ pushstring(isValid);
+}
+
+EXPORT_NSIS_FUNCTION(GetMinGWVersion)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+
+ char *path = (char *)LocalAlloc(LPTR, g_stringsize+1);
+ popstring(path);
+
+ int major = 0, minor = 0, patch = 0;
+ char versionstr[MINGW_BUFFER_SIZE];
+
+ getMinGWVersion(path, &major, &minor, &patch);
+ sprintf(versionstr, "%d.%d.%d", major, minor, patch);
+
+ LocalFree(path);
+ pushstring(versionstr);
+}
+
+EXPORT_NSIS_FUNCTION(ShInPath)
+{
+ g_hwndParent = hwndParent;
+ EXDLL_INIT();
+ char res[2];
+
+ if (shInEnvironment())
+ res[0] = '1';
+ else
+ res[0] = '0';
+
+ res[1] = '\0';
+
+ pushstring(res);
+}
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.dll b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.dll
new file mode 100644
index 0000000..a75d896
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.dll
Binary files differ
diff --git a/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.vcproj b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.vcproj
new file mode 100644
index 0000000..3600136
--- /dev/null
+++ b/util/scripts/win-binary/nsis/qtnsisext/qtnsisext.vcproj
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="qtnsisext"
+ ProjectGUID="{DC56C66A-5D15-46C8-91E6-AB36FC26F8DA}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="."
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;QTNSISEXT_EXPORTS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/qtnsisext.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/qtnsisext.pdb"
+ SubSystem="1"
+ ImportLibrary="$(OutDir)/qtnsisext.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="."
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..\..\..\..\qt\util\scripts\mac-binary\package\InstallerPane"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTNSISEXT_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ CompileAs="2"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/qtnsisext.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="FALSE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/qtnsisext.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\binpatch.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\..\qt\util\scripts\mac-binary\package\InstallerPane\keydec.cpp">
+ </File>
+ <File
+ RelativePath=".\licensefinder.cpp">
+ </File>
+ <File
+ RelativePath=".\mingw.cpp">
+ </File>
+ <File
+ RelativePath=".\qtnsisext.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\binpatch.h">
+ </File>
+ <File
+ RelativePath=".\exdll.h">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\..\qt\util\scripts\mac-binary\package\InstallerPane\keydec.h">
+ </File>
+ <File
+ RelativePath=".\licensefinder.h">
+ </File>
+ <File
+ RelativePath=".\mingw.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>