summaryrefslogtreecommitdiff
path: root/data/virt-viewer.nsis.in
blob: ed692e12acd55c8ad85302163076065824a89700 (plain)
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
#!Nsis Installer Command Script
# @configure_input@
# To build an installer from the script you would normally do:
#
#   makensis virt-viewer.nsis
#
# which will generate the output file 'virt-viewer-@VERSION@.exe' which is a Windows
# installer containing your program.

Name "VirtViewer @VERSION@"
OutFile "virt-viewer-@VERSION@.exe"
InstallDir "$LOCALAPPDATA\virt-viewer"
InstallDirRegKey HKCU "Software\virt-viewer" ""

RequestExecutionLevel user
SetCompressor bzip2
ShowInstDetails hide
ShowUninstDetails hide
XPStyle on

Page directory
Page instfiles

!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\virt-viewer"

Function RegisterApplication
    ;Register uninstaller into Add/Remove panel (for local user only)
    WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayName" "VirtViewer @VERSION@"
    WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\bin\virt-viewer.exe$\""
    WriteRegStr HKCU "${REG_UNINSTALL}" "Publisher" "virt-manager.org"
    WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayVersion" "@VERSION@"
    WriteRegDWord HKCU "${REG_UNINSTALL}" "EstimatedSize" 32000 ;KB
    WriteRegStr HKCU "${REG_UNINSTALL}" "HelpLink" "http://www.virt-manager.org"
    WriteRegStr HKCU "${REG_UNINSTALL}" "URLInfoAbout" "http://www.virt-manager.org"
    WriteRegStr HKCU "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\""
    WriteRegStr HKCU "${REG_UNINSTALL}" "InstallSource" "$\"$EXEDIR$\""
    WriteRegDWord HKCU "${REG_UNINSTALL}" "NoModify" 1
    WriteRegDWord HKCU "${REG_UNINSTALL}" "NoRepair" 1
    WriteRegStr HKCU "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
    WriteRegStr HKCU "${REG_UNINSTALL}" "Comments" "Uninstalls VirtViewer."
FunctionEnd

Section "VirtViewer"
  SectionIn RO
  WriteRegStr HKCU "Software\virt-viewer" "" $INSTDIR

  SetOutPath "$INSTDIR\bin"
  File "@prefix@/bin/gst-discoverer-0.10.exe"
  File "@prefix@/bin/gst-feedback.exe"
  File "@prefix@/bin/gst-inspect-0.10.exe"
  File "@prefix@/bin/gst-inspect.exe"
  File "@prefix@/bin/gst-launch-0.10.exe"
  File "@prefix@/bin/gst-launch.exe"
  File "@prefix@/bin/gst-typefind-0.10.exe"
  File "@prefix@/bin/gst-typefind.exe"
  File "@prefix@/bin/gst-xmlinspect-0.10.exe"
  File "@prefix@/bin/gst-xmlinspect.exe"
  File "@prefix@/bin/gst-xmllaunch-0.10.exe"
  File "@prefix@/bin/gst-xmllaunch.exe"
  File "@prefix@/bin/libatk-1.0-0.dll"
  File "@prefix@/bin/libcairo-2.dll"
  File "@prefix@/bin/libcelt051-0.dll"
  File "@prefix@/bin/libcrypto-10.dll"
  File "@prefix@/bin/libffi-6.dll"
  File "@prefix@/bin/libfontconfig-1.dll"
  File "@prefix@/bin/libfreetype-6.dll"
  File "@prefix@/bin/libgdk-win32-2.0-0.dll"
  File "@prefix@/bin/libgdk-win32-2.0-0.dll"
  File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll"
  File "@prefix@/bin/libgdk_pixbuf-2.0-0.dll"
  File "@prefix@/bin/libgio-2.0-0.dll"
  File "@prefix@/bin/libglib-2.0-0.dll"
  File "@prefix@/bin/libgmodule-2.0-0.dll"
  File "@prefix@/bin/libgobject-2.0-0.dll"
  File "@prefix@/bin/libgstapp-0.10-0.dll"
  File "@prefix@/bin/libgstaudio-0.10-0.dll"
  File "@prefix@/bin/libgstbase-0.10-0.dll"
  File "@prefix@/bin/libgstcontroller-0.10-0.dll"
  File "@prefix@/bin/libgstfft-0.10-0.dll"
  File "@prefix@/bin/libgstinterfaces-0.10-0.dll"
  File "@prefix@/bin/libgstpbutils-0.10-0.dll"
  File "@prefix@/bin/libgstreamer-0.10-0.dll"
  File "@prefix@/bin/libgstvideo-0.10-0.dll"
  File "@prefix@/bin/libgthread-2.0-0.dll"
  File "@prefix@/bin/libgtk-win32-2.0-0.dll"
  File "@prefix@/bin/iconv.dll"
  File "@prefix@/bin/libintl-8.dll"
  File "@prefix@/bin/libjpeg-62.dll"
  File "@prefix@/bin/liborc-0.4-0.dll"
  File "@prefix@/bin/liborc-test-0.4-0.dll"
  File "@prefix@/bin/libpango-1.0-0.dll"
  File "@prefix@/bin/libpangocairo-1.0-0.dll"
  File "@prefix@/bin/libpangoft2-1.0-0.dll"
  File "@prefix@/bin/libpangowin32-1.0-0.dll"
  File "@prefix@/bin/libpixman-1-0.dll"
  File "@prefix@/bin/libpng15-15.dll"
  File "@prefix@/bin/libspice-client-glib-2.0-1.dll"
  File "@prefix@/bin/libspice-client-gtk-2.0-1.dll"
  File "@prefix@/bin/libspice-controller-0.dll"
  File "@prefix@/bin/libssl-10.dll"
  File "@prefix@/bin/libxml2-2.dll"
  File "@prefix@/bin/libp11-kit-0.dll"
  File "@prefix@/bin/libssh2-1.dll"
  File "@prefix@/bin/libcurl-4.dll"
  File "@prefix@/bin/libportablexdr-0.dll"
  File "@prefix@/bin/libidn-11.dll"
  File "@prefix@/bin/libssp-0.dll"
  File "@prefix@/bin/libvirt-0.dll"
  File "@prefix@/bin/libvirt-qemu-0.dll"
  File "@prefix@/bin/virsh.exe"
  File "@prefix@/bin/virt-pki-validate"
  File "@prefix@/bin/virt-xml-validate"

  #gtkvnc
  File "@prefix@/bin/libgnutls-26.dll"
  File "@prefix@/bin/libgpg-error-0.dll"
  File "@prefix@/bin/libgcrypt-11.dll"
  File "@prefix@/bin/libgvnc-1.0-0.dll"
  File "@prefix@/bin/libgtk-vnc-1.0-0.dll"

  File "@prefix@/bin/pango-querymodules.exe"
  File /oname=remote-viewer.com "${DESTDIR}@prefix@/bin/windows-cmdline-wrapper.exe"
  File "${DESTDIR}@prefix@/bin/remote-viewer.exe"
  File "${DESTDIR}@prefix@/bin/virt-viewer.exe"
  File "@prefix@/bin/zlib1.dll"

  SetOutPath "$INSTDIR\etc"
  File /r "@prefix@/etc/fonts"
  File /r "@prefix@/etc/gtk-2.0"
  File /r "@prefix@/etc/libvirt"
  CreateDirectory "$INSTDIR\etc\pango"

  CreateDirectory "$INSTDIR\etc\gtk-2.0"

  SetOutPath "$INSTDIR\lib"
  File /r "@prefix@/lib/gdk-pixbuf-2.0"
  File /r "@prefix@/lib/gtk-2.0"
  File /r "@prefix@/lib/pango"

  SetOutPath "$INSTDIR\lib\gstreamer-0.10"
  File "@prefix@/lib/gstreamer-0.10/libgstapp.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstaudioconvert.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstaudiofx.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstaudiorate.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstaudioresample.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstaudiotestsrc.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstautodetect.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstcoreelements.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsink.dll"
  File "@prefix@/lib/gstreamer-0.10/libgstdirectsoundsrc.dll"

  SetOutPath "$INSTDIR\share"
  File /r "@prefix@/share/libvirt"

  # fixme for all languages
  SetOutPath "$INSTDIR\share\locale\fr"
  File "@prefix@/share/locale/fr/LC_MESSAGES/libvirt.*"
  File "${DESTDIR}@prefix@/share/locale/fr/LC_MESSAGES/virt-viewer.*"

  SetOutPath "$INSTDIR\share\virt-viewer\ui"
  File "${DESTDIR}@prefix@/share/virt-viewer/ui/*.xml"

  SetOutPath "$INSTDIR\share\themes\MS-Windows\gtk-2.0"
  File "@prefix@/share/themes/MS-Windows/gtk-2.0/gtkrc"

  ReadEnvStr $0 COMSPEC
  SetOutPath "$INSTDIR"
  nsExec::ExecToLog '$0 /C bin\pango-querymodules.exe > etc\pango\pango.modules'
  nsExec::ExecToLog 'echo gtk-theme-name = "MS-Windows" > etc\gtk-2.0\gtkrc'

  # make virt-viewer the default spice-x client
  WriteRegStr HKCU "Software\spice-space.org\spicex" "client" "$INSTDIR\bin\remote-viewer.exe --spice-controller"

SectionEnd

Section "Start Menu Shortcuts"
  CreateDirectory "$SMPROGRAMS\VirtViewer"
  CreateShortCut "$SMPROGRAMS\VirtViewer\Remote Viewer.lnk" "$INSTDIR\bin\remote-viewer.exe" "" "$INSTDIR\bin\remote-viewer.exe" 0
  CreateShortCut "$SMPROGRAMS\VirtViewer\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
SectionEnd

Section "Uninstall"
  Delete /rebootok "$SMPROGRAMS\VirtViewer\Uninstall.lnk"
  Delete /rebootok "$SMPROGRAMS\VirtViewer\Remote Viewer.lnk"
  RMDir "$SMPROGRAMS\virt-viewer"

  DeleteRegKey HKCU "Software\spice-space.org\spicex\client"
  DeleteRegKey /ifempty HKCU "Software\spice-space.org\spicex"
  DeleteRegKey /ifempty HKCU "Software\spice-space.org"
  DeleteRegKey HKCU "Software\virt-viewer"
  DeleteRegKey HKCU "${REG_UNINSTALL}"

  RMDir /r "$INSTDIR\lib\pango"

  RMDir /r "$INSTDIR\lib\gtk-2.0"

  Delete /rebootok "$INSTDIR\share\virt-viewer\ui\*.xml"
  Delete /rebootok "$INSTDIR\share\themes\MS-Windows\gtk-2.0\gtkrc"

  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsrc.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstdirectsoundsink.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstcoreelements.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstautodetect.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiotestsrc.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioresample.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiorate.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudiofx.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstaudioconvert.dll"
  Delete /rebootok "$INSTDIR\lib\gstreamer-0.10\libgstapp.dll"
  RMDir "$INSTDIR\lib\gstreamer-0.10"

  RMDir /r "$INSTDIR\lib\gdk-pixbuf-2.0"

  RMDir /r "$INSTDIR\etc\pango"

  RMDir /r "$INSTDIR\etc\gtk-2.0"

  RMDir /r "$INSTDIR\etc\fonts"

  Delete /rebootok "$INSTDIR\bin\remote-viewer.com"
  Delete /rebootok "$INSTDIR\bin\remote-viewer.exe"
  Delete /rebootok "$INSTDIR\bin\pango-querymodules.exe"
  Delete /rebootok "$INSTDIR\bin\libpangoft2-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\gst-xmllaunch.exe"
  Delete /rebootok "$INSTDIR\bin\gst-xmllaunch-0.10.exe"
  Delete /rebootok "$INSTDIR\bin\gst-xmlinspect.exe"
  Delete /rebootok "$INSTDIR\bin\gst-xmlinspect-0.10.exe"
  Delete /rebootok "$INSTDIR\bin\gst-typefind.exe"
  Delete /rebootok "$INSTDIR\bin\gst-typefind-0.10.exe"
  Delete /rebootok "$INSTDIR\bin\gst-launch.exe"
  Delete /rebootok "$INSTDIR\bin\gst-launch-0.10.exe"
  Delete /rebootok "$INSTDIR\bin\gst-inspect.exe"
  Delete /rebootok "$INSTDIR\bin\gst-inspect-0.10.exe"
  Delete /rebootok "$INSTDIR\bin\gst-feedback.exe"
  Delete /rebootok "$INSTDIR\bin\gst-discoverer-0.10.exe"
  RMDir "$INSTDIR\bin"

  Delete /rebootok "$INSTDIR\bin\libffi-6.dll"
  Delete /rebootok "$INSTDIR\bin\zlib1.dll"
  Delete /rebootok "$INSTDIR\bin\libp11-kit-0.dll"
  Delete /rebootok "$INSTDIR\bin\libxml2-2.dll"
  Delete /rebootok "$INSTDIR\bin\libssl-10.dll"
  Delete /rebootok "$INSTDIR\bin\libspice-client-gtk-2.0-1.dll"
  Delete /rebootok "$INSTDIR\bin\libspice-client-glib-2.0-1.dll"
  Delete /rebootok "$INSTDIR\bin\libspice-controller-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpng15-15.dll"
  Delete /rebootok "$INSTDIR\bin\libpixman-1-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpangowin32-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpangocairo-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libpango-1.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\liborc-test-0.4-0.dll"
  Delete /rebootok "$INSTDIR\bin\liborc-0.4-0.dll"
  Delete /rebootok "$INSTDIR\bin\libjpeg-62.dll"
  Delete /rebootok "$INSTDIR\bin\libintl-8.dll"
  Delete /rebootok "$INSTDIR\bin\iconv.dll"
  Delete /rebootok "$INSTDIR\bin\libgtk-win32-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgthread-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstvideo-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstreamer-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstpbutils-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstinterfaces-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstfft-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstcontroller-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstbase-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstaudio-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgstapp-0.10-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgobject-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgmodule-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libglib-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgio-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libgdk-win32-2.0-0.dll"
  Delete /rebootok "$INSTDIR\bin\libfreetype-6.dll"
  Delete /rebootok "$INSTDIR\bin\libfontconfig-1.dll"
  Delete /rebootok "$INSTDIR\bin\libcrypto-10.dll"
  Delete /rebootok "$INSTDIR\bin\libcelt051-0.dll"
  Delete /rebootok "$INSTDIR\bin\libcairo-2.dll"
  Delete /rebootok "$INSTDIR\bin\libatk-1.0-0.dll"
  RMDir "$INSTDIR\bin"
  RMDir "$INSTDIR"
SectionEnd

Section -post
  WriteUninstaller "$INSTDIR\Uninstall.exe"
  Call RegisterApplication
SectionEnd