source: trunk/synergy/dist/nullsoft/synergy.nsi@ 3721

Last change on this file since 3721 was 2749, checked in by bird, 19 years ago

synergy v1.3.1 sources (zip).

File size: 5.5 KB
Line 
1; Synergy.nsi
2;
3; This script is based on example1.nsi, but it remember the directory,
4; has uninstall support and (optionally) installs start menu shortcuts.
5;
6; It will install makensisw.exe into a directory that the user selects,
7
8;--------------------------------
9
10; Path to root of tree
11!define DEPTH "..\.."
12
13; The name of the installer
14Name "Synergy"
15
16; The file to write
17OutFile "${DEPTH}\build\SynergyInstaller.exe"
18
19; The default installation directory
20InstallDir $PROGRAMFILES\Synergy
21
22; Registry key to check for directory (so if you install again, it will
23; overwrite the old one automatically)
24InstallDirRegKey HKLM "Software\Synergy" "Install_Dir"
25
26;--------------------------------
27
28; Pages
29
30Page components
31Page license
32Page directory
33Page instfiles
34
35UninstPage uninstConfirm
36UninstPage instfiles
37
38;--------------------------------
39
40; Text
41ComponentText "This will install Synergy on your computer. Select the optional components you want to install."
42DirText "Choose a directory to install Synergy to:"
43UninstallText "This will uninstall Synergy from your computer."
44LicenseText "Synergy is distributed under the GNU GPL:"
45LicenseData "COPYING.txt"
46
47;--------------------------------
48
49; The stuff to install
50Section "Synergy (required)"
51
52 SectionIn RO
53
54 ; Set output path to the installation directory.
55 SetOutPath $INSTDIR
56
57 ; Put files there
58 File "${DEPTH}\build\synergy.exe"
59 File "${DEPTH}\build\synergyc.exe"
60 File "${DEPTH}\build\synergys.exe"
61 File "${DEPTH}\build\*.dll"
62 File COPYING.txt
63 File ChangeLog.txt
64 File ${DEPTH}\doc\PORTING
65 File ${DEPTH}\doc\about.html
66 File ${DEPTH}\doc\authors.html
67 File ${DEPTH}\doc\autostart.html
68 File ${DEPTH}\doc\banner.html
69 File ${DEPTH}\doc\compiling.html
70 File ${DEPTH}\doc\configuration.html
71 File ${DEPTH}\doc\contact.html
72 File ${DEPTH}\doc\developer.html
73 File ${DEPTH}\doc\faq.html
74 File ${DEPTH}\doc\history.html
75 File ${DEPTH}\doc\home.html
76 File ${DEPTH}\doc\index.html
77 File ${DEPTH}\doc\license.html
78 File ${DEPTH}\doc\news.html
79 File ${DEPTH}\doc\roadmap.html
80 File ${DEPTH}\doc\running.html
81 File ${DEPTH}\doc\security.html
82 File ${DEPTH}\doc\synergy.css
83 File ${DEPTH}\doc\tips.html
84 File ${DEPTH}\doc\toc.html
85 File ${DEPTH}\doc\trouble.html
86
87 SetOutPath $INSTDIR\images
88 File ${DEPTH}\doc\images\logo.gif
89 File ${DEPTH}\doc\images\warp.gif
90
91 ; Write the installation path into the registry
92 WriteRegStr HKLM SOFTWARE\Synergy "Install_Dir" "$INSTDIR"
93
94 ; Write the uninstall keys for Windows
95 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "DisplayName" "Synergy"
96 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "UninstallString" '"$INSTDIR\uninstall.exe"'
97 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "NoModify" 1
98 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "NoRepair" 1
99 WriteUninstaller "uninstall.exe"
100
101SectionEnd
102
103; Optional section (can be disabled by the user)
104Section "Start Menu Shortcuts"
105
106 CreateDirectory "$SMPROGRAMS\Synergy"
107 CreateShortCut "$SMPROGRAMS\Synergy\Synergy.lnk" "$INSTDIR\synergy.exe" "" "$INSTDIR\synergy.exe" 0
108 CreateShortCut "$SMPROGRAMS\Synergy\README.lnk" "$INSTDIR\index.html"
109 CreateShortCut "$SMPROGRAMS\Synergy\Synergy Folder.lnk" "$INSTDIR"
110 CreateShortCut "$SMPROGRAMS\Synergy\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
111
112SectionEnd
113
114; Optional section (can be disabled by the user)
115Section "Desktop Icon"
116
117 CreateShortCut "$DESKTOP\Synergy.lnk" "$INSTDIR\synergy.exe" "" "$INSTDIR\synergy.exe" 0
118
119SectionEnd
120
121;--------------------------------
122
123; Uninstaller
124
125Section "Uninstall"
126 ; Stop and uninstall the daemons
127 ExecWait '"$INSTDIR\synergy.exe" /uninstall'
128
129 ; Remove autorun registry keys for synergy
130 DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\Synergy Server"
131 DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\Synergy Client"
132 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\RunServices" "Synergy Server"
133 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\RunServices" "Synergy Client"
134 DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Synergy Server"
135 DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Synergy Client"
136
137 ; not all keys will have existed, so errors WILL have happened
138 ClearErrors
139
140 ; Remove registry keys
141 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy"
142 DeleteRegKey HKLM SOFTWARE\Synergy
143
144 ClearErrors
145
146 ; First try to remove files that might be locked (if synergy is running)
147 Delete /REBOOTOK $INSTDIR\synergy.exe
148 Delete /REBOOTOK $INSTDIR\synergyc.exe
149 Delete /REBOOTOK $INSTDIR\synergys.exe
150 Delete /REBOOTOK $INSTDIR\synrgyhk.dll
151
152 ; Remove files and directory
153 Delete $INSTDIR\*.*
154 RMDir $INSTDIR
155
156 ; Remove shortcuts, if any
157 Delete "$SMPROGRAMS\Synergy\*.*"
158 Delete "$DESKTOP\Synergy.lnk"
159
160 ; Remove directories used
161 RMDir "$SMPROGRAMS\Synergy"
162 RMDir "$INSTDIR"
163
164 IfRebootFlag 0 EndOfAll
165 MessageBox MB_OKCANCEL "Uninstaller needs to reboot to finish cleaning up. reboot now?" IDCANCEL NoReboot
166 ClearErrors
167 Reboot
168 IfErrors 0 EndOfAll
169 MessageBox MB_OK "Uninstaller could not reboot. Please reboot manually. Thank you."
170 Abort "Uninstaller could not reboot. Please reboot manually. Thank you."
171 NoReboot:
172 DetailPrint ""
173 DetailPrint "Uninstaller could not reboot. Please reboot manually. Thank you."
174 DetailPrint ""
175 SetDetailsView show
176 EndOfAll:
177
178SectionEnd
Note: See TracBrowser for help on using the repository browser.