xref: /glogg/glogg.nsi (revision 9a361c77fce85c9bbe1326d984941ec8feb5541d) !
1*9a361c77SNicolas Bonnefon# NSIS script creating the Windows installer for glogg
2*9a361c77SNicolas Bonnefon
3*9a361c77SNicolas Bonnefon# Is passed to the script using -DVERSION=$(git describe) on the command line
4*9a361c77SNicolas Bonnefon!ifndef VERSION
5*9a361c77SNicolas Bonnefon    !define VERSION 'anonymous-build'
6*9a361c77SNicolas Bonnefon!endif
7*9a361c77SNicolas Bonnefon
8*9a361c77SNicolas Bonnefon# Headers
9*9a361c77SNicolas Bonnefon!include "MUI2.nsh"
10*9a361c77SNicolas Bonnefon
11*9a361c77SNicolas Bonnefon# General
12*9a361c77SNicolas BonnefonOutFile "glogg-${VERSION}-setup.exe"
13*9a361c77SNicolas Bonnefon
14*9a361c77SNicolas BonnefonXpStyle on
15*9a361c77SNicolas Bonnefon
16*9a361c77SNicolas BonnefonSetCompressor /SOLID lzma
17*9a361c77SNicolas Bonnefon
18*9a361c77SNicolas Bonnefon; Registry key to keep track of the directory we are installed in
19*9a361c77SNicolas BonnefonInstallDir "$PROGRAMFILES\glogg"
20*9a361c77SNicolas BonnefonInstallDirRegKey HKLM Software\glogg ""
21*9a361c77SNicolas Bonnefon
22*9a361c77SNicolas Bonnefon; glogg icon
23*9a361c77SNicolas Bonnefon; !define MUI_ICON glogg.ico
24*9a361c77SNicolas Bonnefon
25*9a361c77SNicolas BonnefonRequestExecutionLevel user
26*9a361c77SNicolas Bonnefon
27*9a361c77SNicolas BonnefonName "glogg"
28*9a361c77SNicolas BonnefonCaption "glogg ${VERSION} Setup"
29*9a361c77SNicolas Bonnefon
30*9a361c77SNicolas Bonnefon# Pages
31*9a361c77SNicolas Bonnefon!define MUI_WELCOMEPAGE_TITLE "Welcome to the glogg ${VERSION} Setup Wizard"
32*9a361c77SNicolas Bonnefon!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of logcrawer, a log browser.\
33*9a361c77SNicolas Bonnefon$\r$\n$\r$\nglogg is blah.$\r$\n$\r$\n\
34*9a361c77SNicolas Bonnefonglogg is released under the GPL, see http://www.fsf.org/licensing/licenses/gpl.html$\r$\n\
35*9a361c77SNicolas BonnefonQt libraries are released under the GPL, see http://qt.nokia.com/products/licensing$\r$\n$\r$\n$_CLICK"
36*9a361c77SNicolas Bonnefon; MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
37*9a361c77SNicolas Bonnefon
38*9a361c77SNicolas Bonnefon!insertmacro MUI_PAGE_WELCOME
39*9a361c77SNicolas Bonnefon;!insertmacro MUI_PAGE_LICENSE "COPYING"
40*9a361c77SNicolas Bonnefon# !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD...
41*9a361c77SNicolas Bonnefon!insertmacro MUI_PAGE_COMPONENTS
42*9a361c77SNicolas Bonnefon!insertmacro MUI_PAGE_DIRECTORY
43*9a361c77SNicolas Bonnefon!insertmacro MUI_PAGE_INSTFILES
44*9a361c77SNicolas Bonnefon!insertmacro MUI_PAGE_FINISH
45*9a361c77SNicolas Bonnefon
46*9a361c77SNicolas Bonnefon!insertmacro MUI_UNPAGE_WELCOME
47*9a361c77SNicolas Bonnefon!insertmacro MUI_UNPAGE_CONFIRM
48*9a361c77SNicolas Bonnefon!insertmacro MUI_UNPAGE_INSTFILES
49*9a361c77SNicolas Bonnefon!insertmacro MUI_UNPAGE_FINISH
50*9a361c77SNicolas Bonnefon
51*9a361c77SNicolas Bonnefon# Languages
52*9a361c77SNicolas Bonnefon!insertmacro MUI_LANGUAGE "English"
53*9a361c77SNicolas Bonnefon
54*9a361c77SNicolas Bonnefon# Installer sections
55*9a361c77SNicolas BonnefonSection "glogg" glogg
56*9a361c77SNicolas Bonnefon    ; Prevent this section from being unselected
57*9a361c77SNicolas Bonnefon    SectionIn RO
58*9a361c77SNicolas Bonnefon
59*9a361c77SNicolas Bonnefon    SetOutPath $INSTDIR
60*9a361c77SNicolas Bonnefon    File release\glogg.exe
61*9a361c77SNicolas Bonnefon    File release\mingwm10.dll
62*9a361c77SNicolas Bonnefon    File COPYING
63*9a361c77SNicolas Bonnefon    File README.textile
64*9a361c77SNicolas Bonnefon
65*9a361c77SNicolas Bonnefon    ; Register uninstaller
66*9a361c77SNicolas Bonnefon    WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg"\
67*9a361c77SNicolas Bonnefon"UninstallString" '"$INSTDIR\Uninstall.exe"'
68*9a361c77SNicolas Bonnefon    WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg"\
69*9a361c77SNicolas Bonnefon"InstallLocation" "$INSTDIR"
70*9a361c77SNicolas Bonnefon    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg" "DisplayName" "glogg"
71*9a361c77SNicolas Bonnefon    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg" "DisplayVersion" "${VERSION}"
72*9a361c77SNicolas Bonnefon    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg" "NoModify" "1"
73*9a361c77SNicolas Bonnefon    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg" "NoRepair" "1"
74*9a361c77SNicolas Bonnefon
75*9a361c77SNicolas Bonnefon    ; Create uninstaller
76*9a361c77SNicolas Bonnefon    WriteUninstaller "$INSTDIR\Uninstall.exe"
77*9a361c77SNicolas BonnefonSectionEnd
78*9a361c77SNicolas Bonnefon
79*9a361c77SNicolas BonnefonSection "Qt4 Runtime libraries" qtlibs
80*9a361c77SNicolas Bonnefon    SetOutPath $INSTDIR
81*9a361c77SNicolas Bonnefon    File release\QtCore4.dll
82*9a361c77SNicolas Bonnefon    File release\QtGui4.dll
83*9a361c77SNicolas BonnefonSectionEnd
84*9a361c77SNicolas Bonnefon
85*9a361c77SNicolas Bonnefon# Descriptions
86*9a361c77SNicolas Bonnefon!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
87*9a361c77SNicolas Bonnefon    !insertmacro MUI_DESCRIPTION_TEXT ${glogg} "The core files required to use glogg."
88*9a361c77SNicolas Bonnefon    !insertmacro MUI_DESCRIPTION_TEXT ${qtlibs} "Needed by glogg, you have to install these unless \
89*9a361c77SNicolas Bonnefonyou already have the Qt4 development kit installed."
90*9a361c77SNicolas Bonnefon!insertmacro MUI_FUNCTION_DESCRIPTION_END
91*9a361c77SNicolas Bonnefon
92*9a361c77SNicolas Bonnefon# Uninstaller
93*9a361c77SNicolas BonnefonSection "Uninstall"
94*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\Uninstall.exe"
95*9a361c77SNicolas Bonnefon
96*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\glogg.exe"
97*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\README.textile"
98*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\COPYING"
99*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\mingwm10.dll"
100*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\QtCore4.dll"
101*9a361c77SNicolas Bonnefon    Delete "$INSTDIR\QtGui4.dll"
102*9a361c77SNicolas Bonnefon    RMDir "$INSTDIR"
103*9a361c77SNicolas Bonnefon
104*9a361c77SNicolas Bonnefon    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\glogg"
105*9a361c77SNicolas Bonnefon    DeleteRegKey /ifempty HKCU "Software\glogg"
106*9a361c77SNicolas Bonnefon
107*9a361c77SNicolas Bonnefon    ; Remove the shortcut, if any
108*9a361c77SNicolas Bonnefon    SetShellVarContext all
109*9a361c77SNicolas Bonnefon    Delete "$SMPROGRAMS\glogg.lnk"
110*9a361c77SNicolas BonnefonSectionEnd
111