~ubuntu-branches/ubuntu/wily/flrig/wily

« back to all changes in this revision

Viewing changes to data/win32/fl_app.nsi

  • Committer: Package Import Robot
  • Author(s): Kamal Mostafa
  • Date: 2014-06-07 11:28:52 UTC
  • Revision ID: package-import@ubuntu.com-20140607112852-v4d5tb1m3h3vi0dl
Tags: upstream-1.3.15
ImportĀ upstreamĀ versionĀ 1.3.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- conf -*-
 
2
 
 
3
# NSIS installer script based on example2.nsi from the nsis-2.44 distribution.
 
4
# Copyright (c) 2009 Stelios Bounanos, M0GLD.
 
5
# Copyright (c) 2009 Dave Freese, W1HKJ
 
6
 
 
7
# substitute your application name for instances of FLRIG
 
8
 
 
9
# Variables
 
10
!define FLRIG_DESCRIPTION "${FLRIG_NAME} ${FLRIG_VERSION}"
 
11
!define FLRIG_STRING "${FLRIG_NAME}-${FLRIG_VERSION}"
 
12
 
 
13
!define PRODUCT_BINARY "${FLRIG_BINARY}"
 
14
!define PRODUCT_NAME "${FLRIG_NAME}"
 
15
!define PRODUCT_VERSION "${FLRIG_VERSION}"
 
16
!define PRODUCT_STRING "${FLRIG_STRING}"
 
17
!define PRODUCT_DESCRIPTION "${FLRIG_DESCRIPTION}"
 
18
 
 
19
# Compression options
 
20
SetCompressor /SOLID lzma
 
21
 
 
22
# This function is called before displaying the first installer page.
 
23
# It aborts the installation if the Windows version is too old.
 
24
!include WinVer.nsh
 
25
Function .onInit
 
26
    ${IfNot} ${AtLeastWin2000}
 
27
        MessageBox MB_ICONSTOP "Sorry, your Windows version is too old.$\n${PRODUCT_NAME} requires Windows 2000 or later."
 
28
        Abort
 
29
    ${EndIf}
 
30
FunctionEnd
 
31
 
 
32
# The name of the installer
 
33
Name "${PRODUCT_DESCRIPTION}"
 
34
 
 
35
# The file to write
 
36
OutFile ${INSTALLER_FILE}
 
37
 
 
38
# The default installation directory
 
39
InstallDir $PROGRAMFILES\${PRODUCT_STRING}
 
40
 
 
41
# Registry key to check for directory (so if you install again, it will
 
42
# overwrite the old one automatically)
 
43
!define INSTALL_DIR_REG_KEY SOFTWARE\${PRODUCT_STRING}
 
44
InstallDirRegKey HKLM "${INSTALL_DIR_REG_KEY}" "Install_Dir"
 
45
 
 
46
# Request application privileges for Windows Vista
 
47
RequestExecutionLevel admin
 
48
 
 
49
# License
 
50
LicenseText "${PRODUCT_NAME} is distributed under the GNU GPL as detailed \
 
51
below. You must abide by the terms of this license if you modify or \
 
52
redistribute the program." "Continue"
 
53
LicenseData "${LICENSE_FILE}"
 
54
SubCaption 0 ": License Information"
 
55
 
 
56
# Other options
 
57
BrandingText " "
 
58
InstProgressFlags smooth
 
59
VIAddVersionKey ProductName "${PRODUCT_NAME}"
 
60
VIAddVersionKey ProductVersion "${PRODUCT_VERSION}"
 
61
VIAddVersionKey FileVersion "${PRODUCT_VERSION}"
 
62
VIAddVersionKey FileDescription "${FLRIG_DESCRIPTION} installer"
 
63
VIAddVersionKey LegalCopyright "${PRODUCT_NAME} developers"
 
64
VIAddVersionKey OriginalFilename "${INSTALLER_FILE}"
 
65
VIProductVersion "3.0.0.0"
 
66
WindowIcon off
 
67
XPStyle on
 
68
 
 
69
# Installer pages
 
70
Page license
 
71
Page components
 
72
Page directory
 
73
Page instfiles
 
74
UninstPage uninstConfirm
 
75
UninstPage instfiles
 
76
 
 
77
# Registry uninstall path
 
78
!define REG_UNINSTALL_PATH Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_STRING}
 
79
 
 
80
# This is a hidden section and is always selected.  It writes the uninstall
 
81
# registry keys and uninstaller binary.
 
82
Section -install
 
83
    # Set output path to the installation directory.
 
84
    SetOutPath $INSTDIR
 
85
    # Write the installation paths into the registry
 
86
    WriteRegStr HKLM "${INSTALL_DIR_REG_KEY}" "Install_Dir" "$INSTDIR"
 
87
    # Write the uninstall keys for Windows
 
88
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayName" "${PRODUCT_DESCRIPTION}"
 
89
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayVersion" "${PRODUCT_VERSION}"
 
90
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "DisplayIcon" '"$INSTDIR\${PRODUCT_BINARY}"'
 
91
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "HelpLink" "${SUPPORT_URL}"
 
92
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "Publisher" "FLRIG developers"
 
93
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "URLUpdateInfo" "${UPDATES_URL}"
 
94
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\uninstall.exe"'
 
95
    WriteRegStr HKLM "${REG_UNINSTALL_PATH}" "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S'
 
96
    WriteRegDWORD HKLM "${REG_UNINSTALL_PATH}" "NoModify" 1
 
97
    WriteRegDWORD HKLM "${REG_UNINSTALL_PATH}" "NoRepair" 1
 
98
    WriteUninstaller "uninstall.exe"
 
99
SectionEnd
 
100
 
 
101
#Var WANT_FLRIG
 
102
 
 
103
Section "FLRIG"
 
104
        SectionIn RO
 
105
        SetOutPath $INSTDIR
 
106
        File "${FLRIG_BINARY}"
 
107
SectionEnd
 
108
 
 
109
# Start Menu path
 
110
!define SM_PATH_BASE $SMPROGRAMS\${PRODUCT_NAME}
 
111
!define SM_PATH ${SM_PATH_BASE}\${PRODUCT_STRING}
 
112
 
 
113
# The following sections are optional
 
114
Section "Start Menu Shortcuts"
 
115
    CreateDirectory "${SM_PATH}"
 
116
        CreateShortCut "${SM_PATH}\${FLRIG_NAME}.lnk" "$INSTDIR\${FLRIG_BINARY}" "" "$INSTDIR\${FLRIG_BINARY}" 0
 
117
#       CreateShortCut "${SM_PATH}\${FLRIG_NAME} Beginners' Guide.lnk" "${GUIDE_URL}"
 
118
#       CreateShortCut "${SM_PATH}\${FLRIG_NAME} Documentation.lnk" "${FLRIG_DOCS_URL}"
 
119
    CreateShortCut "${SM_PATH}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
 
120
SectionEnd
 
121
 
 
122
Section "Desktop Shortcuts"
 
123
        CreateShortCut "$DESKTOP\${FLRIG_DESCRIPTION}.lnk" "$INSTDIR\${FLRIG_BINARY}" "" \
 
124
                "$INSTDIR\${FLRIG_BINARY}" 0
 
125
SectionEnd
 
126
 
 
127
# This is unselected by default
 
128
Section /o "Quick Launch Shortcuts"
 
129
        CreateShortCut "$QUICKLAUNCH\${FLRIG_DESCRIPTION}}.lnk" "$INSTDIR\${FLRIG_BINARY}" "" \
 
130
                "$INSTDIR\${FLRIG_BINARY}" 0
 
131
SectionEnd
 
132
 
 
133
# Uninstaller
 
134
Section "Uninstall"
 
135
    # Remove registry keys
 
136
    DeleteRegKey HKLM "${REG_UNINSTALL_PATH}"
 
137
    DeleteRegKey HKLM "${INSTALL_DIR_REG_KEY}"
 
138
 
 
139
# Remove files and uninstaller
 
140
        Delete /REBOOTOK $INSTDIR\${FLRIG_BINARY}
 
141
    Delete /REBOOTOK $INSTDIR\uninstall.exe
 
142
 
 
143
# Remove shortcuts, if any
 
144
    Delete "${SM_PATH}\*.*"
 
145
        Delete "$DESKTOP\${FLRIG_DESCRIPTION}.lnk"
 
146
        Delete "$QUICKLAUNCH\${FLRIG_DESCRIPTION}.lnk"
 
147
 
 
148
# Remove directories used
 
149
    RMDir "${SM_PATH}"
 
150
    RMDir "${SM_PATH_BASE}"
 
151
    RMDir "$INSTDIR"
 
152
SectionEnd
 
153
 
 
154
# Offer to reboot the machine if the reboot flag is nonzero. This flag is set by
 
155
# commands that specify the /REBOOTOK switch if the BINARY_* files were in use
 
156
# during uninstallation. Stupid Windows.
 
157
Function un.onGUIEnd
 
158
    IfRebootFlag 0 noreboot
 
159
    MessageBox MB_YESNO|MB_ICONQUESTION \
 
160
               "A reboot is required to finish removing ${PRODUCT_NAME}. Do you wish to reboot now?" IDNO noreboot
 
161
    Reboot
 
162
    noreboot:
 
163
FunctionEnd
 
164
 
 
165
# Tell the user if we could not reboot for some reason.
 
166
Function un.onRebootFailed
 
167
    MessageBox MB_OK|MB_ICONSTOP "Reboot failed. Please reboot manually." /SD IDOK
 
168
FunctionEnd