summaryrefslogtreecommitdiffstats
path: root/util/scripts/win-binary/nsis/modules/qtjambi.nsh
blob: 948945b6a96a1a9bc3345cc99ccaa120c104e138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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