~bronger/+junk/campustalk

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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
;       $Id$    
; ======================================================================
;     campustalk.nsi - Part of the CampusTalk Program
;     Copyright 2006 Torsten Bronger
;                    <bronger@users.sourceforge.net>
; 
;   This program is free software; you can redistribute it and/or
;   modify it under the terms of the Artistic License 2.0 as published
;   by Larry Wall.  You should have received a copy of the Artistic
;   License 2.0 along with this program in the file COPYING; if not,
;   you can get it at
;     http://dev.perl.org/rfc/346.html
;   or contact the current maintainer of CampusTalk.
;
;   This program is distributed in the hope that it will be useful, but
;   WITHOUT ANY WARRANTY; without even the implied warranty of
;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;   Artistic License 2.0 for more details.
;
;   This file may only be distributed together with a copy of the
;   CampusTalk program.
;
;   The CampusTalk program consists of all files listed in manifest.txt.
; ======================================================================

; NOTE: this .NSI script is designed for NSIS v2

########################################################################
#
# Header information
#
########################################################################

;--------------------------------
;Include Modern UI

  !include "MUI.nsh"

;--------------------------------
;General

  Name "CampusTalk"
  OutFile "CampusTalk-1.0.exe"

  BrandingText "CampusTalk -- http://jabber.rwth-aachen.de"

  InstallDir "$PROGRAMFILES\CampusTalk"
  InstallDirRegKey HKCU "Software\CampusTalk" ""

;  SetCompressor /SOLID lzma

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING
  !define MUI_UNABORTWARNING
  !define MUI_ICON "ct_branding\ct-install.ico"
  !define MUI_UNICON "ct_branding\ct-uninstall.ico"
  !define MUI_HEADERIMAGE
  !define MUI_HEADERIMAGE_BITMAP "ct_branding\campustalk.bmp"
  !define MUI_WELCOMEFINISHPAGE_BITMAP "ct_branding\ct-welcome.bmp"
  
;--------------------------------
;Language Selection Dialog Settings

  ;Remember the installer language
  !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" 
  !define MUI_LANGDLL_REGISTRY_KEY "Software\CampusTalk" 
  !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

;--------------------------------
;Finish Page Settings

  !define MUI_FINISHPAGE_RUN "$INSTDIR\CampusTalk.exe"
;   !define MUI_FINISHPAGE_LINK "Jetzt beim RWTH-Jabber-Server registrieren"
;   !define MUI_FINISHPAGE_LINK_LOCATION "https://jabber.rwth-aachen.de/index.php?Funktion=Anmeldung"
  !define MUI_FINISHPAGE_NOREBOOTSUPPORT


!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "Licence.rtf"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

!include "translations.nsi"

;--------------------------------
;Reserve Files
  
  ;These files should be inserted before other files in the data block
  ;Keep these lines before any File command
  ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
  
  !insertmacro MUI_RESERVEFILE_LANGDLL


Section "CampusTalk"
  SetOutPath "$INSTDIR"
  File /r "Pandion\*"
  WriteRegStr HKCU "Software\CampusTalk" "" "$INSTDIR"
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

  ;Create shortcuts
  CreateDirectory "$SMPROGRAMS\CampusTalk"
  CreateShortCut "$SMPROGRAMS\CampusTalk\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  CreateShortCut "$SMPROGRAMS\CampusTalk\CampusTalk.lnk" "$INSTDIR\CampusTalk.exe"
  CreateShortCut "$SMSTARTUP\CampusTalk.lnk" "$INSTDIR\CampusTalk.exe"
SectionEnd

;--------------------------------
;Installer Functions

Function .onInit
  !define MUI_LANGDLL_WINDOWTITLE "Sprachauswahl für den Installer"
  !define MUI_LANGDLL_INFO "Bitte wählen Sie eine Sprache aus:"
  !insertmacro MUI_LANGDLL_DISPLAY
  !undef MUI_LANGDLL_WINDOWTITLE
  !undef MUI_LANGDLL_INFO
FunctionEnd


Section "Uninstall"
  Delete "$INSTDIR\Uninstall.exe"
  RMDir /r "$INSTDIR"

  Delete "$SMPROGRAMS\CampusTalk\Uninstall.lnk"
  Delete "$SMPROGRAMS\CampusTalk\CampusTalk.lnk"
  RMDir "$SMPROGRAMS\CampusTalk"

  Delete "$SMSTARTUP\CampusTalk\CampusTalk.lnk"

  DeleteRegKey /ifempty HKCU "Software\CampusTalk"

  MessageBox MB_YESNO|MB_ICONQUESTION "$un.TEXT_RemoveProfiles" IDNO weiter

weiter:
    
SectionEnd


;--------------------------------
;Uninstaller Functions

Function un.onInit
  !insertmacro MUI_UNGETLANGUAGE
FunctionEnd