diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 14:06:06 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 14:06:06 (GMT) |
commit | f15b8a83e2e51955776a3f07cb85ebfc342dd8ef (patch) | |
tree | c5dc684986051654898db11ce73e03b9fec8db99 /util/scripts/win-binary/nsis/modules | |
download | Qt-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/modules')
17 files changed, 5582 insertions, 0 deletions
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 |