Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2850 dpurdie 1
;-------------------------------------------------------------------------------
2
;
3
;   Example of a NSIS basis Windows Installer suitable for use within the
4
;   Vix-ERG environment
5
;
6
;   This is an example of how things can be done
7
;   It includes a lot of excess documentation that can be removed
8
;
9
;--------------------------------
10
;   Include Modern UI
11
;   Provides an Installer that is similar to many other Windows-XP installers
12
!include "MUI2.nsh"
13
 
14
;--------------------------------
15
;   General
16
;   Specify basic settings
17
;
18
;   Name            - Already set based on package name and version
19
;   BrandingText    - Already set
20
;   Caption         - Already set
21
 
22
;   FileDescription
23
;       Will be available when the user selects the properties
24
;       of the installer. All other properties have been set based the
25
;       package name and version.    
26
;                       
27
VIAddVersionKey "FileDescription" "Texas Instruments MSP430 Compiler"
28
 
29
;   Default installation folder
30
;       Existing ERG Apps are installed into c:\AFC\${GBE_PACKAGE}
31
;       $DESKTOP\${GBE_PACKAGE} - can be useful
32
;       $PROGRAMFILES\Vix-ERG\${GBE_PACKAGE} - could be good too
33
;   
34
InstallDir "c:\Texas Instruments"
35
 
36
;   Get installation folder from registry if available
37
!define InstallDirReg "Software\Vix\${GBE_PACKAGE}"
38
InstallDirRegKey HKCU ${InstallDirReg} ""
39
 
40
;   Request application privileges for Windows Vista
41
RequestExecutionLevel user
42
 
43
;--------------------------------
44
;   Modern Interface Settings
45
 
46
#!define MUI_ABORTWARNING
47
 !define MUI_ICON                       "${GBE_NSISDATA}\VixIcon.ico"
48
 !define MUI_UNICON                     "${GBE_NSISDATA}\VixIcon.ico"
49
 !define MUI_HEADERIMAGE
50
 !define MUI_HEADERIMAGE_BITMAP         "${GBE_NSISDATA}\VixHeader.bmp"
51
 !define MUI_WELCOMEFINISHPAGE_BITMAP   "${GBE_NSISDATA}\VixPanel.bmp"
52
 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${GBE_NSISDATA}\VixPanel.bmp"
53
 !define MUI_FINISHPAGE_NOAUTOCLOSE
54
 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
55
 !define MUI_WELCOMEPAGE_TITLE_3LINES
56
 !define MUI_FINISHPAGE_TITLE_3LINES
57
 
58
;--------------------------------
59
;   Pages
60
;   List of Pages for the Modern UI to show
61
 
62
 !insertmacro MUI_PAGE_WELCOME
63
#!insertmacro MUI_PAGE_LICENSE "${GBE_NSISDATA}\license.txt"
64
#!insertmacro MUI_PAGE_COMPONENTS
65
#!insertmacro MUI_PAGE_DIRECTORY
66
 !insertmacro MUI_PAGE_INSTFILES
67
#!insertmacro MUI_PAGE_FINISH
68
 
69
#!insertmacro MUI_UNPAGE_WELCOME
70
 !insertmacro MUI_UNPAGE_CONFIRM
71
#!insertmacro MUI_UNPAGE_COMPONENTS
72
 !insertmacro MUI_UNPAGE_INSTFILES
73
#!insertmacro MUI_UNPAGE_FINISH
74
 
75
;--------------------------------
76
;   Languages
77
;   System will select default language
78
 
79
  !insertmacro MUI_LANGUAGE "English"
80
  !insertmacro MUI_LANGUAGE "French"
81
#  !insertmacro MUI_LANGUAGE "Swedish"
82
 
83
;--------------------------------
84
;   Allow user to select the language
85
#Function .onInit 
86
#    !insertmacro MUI_LANGDLL_DISPLAY 
87
#FunctionEnd
88
 
89
#Function un.onInit 
90
#    !insertmacro MUI_LANGDLL_DISPLAY 
91
#FunctionEnd
92
 
93
;--------------------------------
94
;   Installer Sections
95
;   Each section will show up as a 'component', if that page is shown
96
;
97
Section "Application" SecDummy
98
 
99
    SetOutPath "$INSTDIR"
100
    File /r ccsv4
101
 
102
SectionEnd
103
 
104
;--------------------------------
105
;Uninstaller Sections
106
 
107
;   Un Installer for files installed by the user
108
;
109
Section "un.Application"
110
  ;
111
  RMDir /r "$INSTDIR\ccsv4"
112
  RMDir    "$INSTDIR"
113
 
114
SectionEnd
115
 
116
;--------------------------------
117
;   Section to create the Core of the Uninstaller
118
;   This will be hidden
119
Section "-Core"
120
 
121
    ;Store installation folder
122
    WriteRegStr HKCU ${InstallDirReg} "" $INSTDIR
123
 
124
    ;Create uninstaller and copy it into the install directory
125
    SetOutPath "$INSTDIR"
126
    WriteUninstaller "$INSTDIR\Uninstall.exe"
127
 
128
    ; Write the uninstall keys for Windows so that the package is seen in the
129
    ; Add/Remove Program section of the Control Panel.
130
    ;     Create a 'unique' key in the windows registry
131
    ;     Base it on the package name
132
    ;         Could use a GUID but it MUST NOT be copied if this file is copied
133
    ;
134
    !define UnInstallKeyBase "Software\Microsoft\Windows\CurrentVersion\Uninstall"
135
    !define UnInstallKey "${UnInstallKeyBase}\${GBE_PACKAGE}"
136
 
137
    WriteRegStr HKLM ${UnInstallKey} "DisplayName" ${GBE_PACKAGE}
138
    WriteRegStr HKLM ${UnInstallKey} "UninstallString" '"$INSTDIR\uninstall.exe"'
139
    WriteRegDWORD HKLM ${UnInstallKey} "NoModify" 1
140
    WriteRegDWORD HKLM ${UnInstallKey} "NoRepair" 1
141
 
142
SectionEnd
143
 
144
;--------------------------------
145
;   Uninistaller section to uninstall keys
146
;   That have been installed as a part of the core installer
147
;
148
Section "-un.Core"
149
 
150
  ; Delete the uninstaller and then the containing directory
151
  ; The directory will only be removed if its empty  
152
  Delete "$INSTDIR\Uninstall.exe"
153
  RMDir "$INSTDIR"
154
 
155
  ; Remove the programs registry key
156
  ; Keep around for next time
157
  ; DeleteRegKey /ifempty HKCU ${InstallDirReg}
158
 
159
  ; Remove Uninstaller registry keys
160
  DeleteRegKey HKLM ${UnInstallKey}
161
 
162
SectionEnd
163