1
; Installer script for win32 Gcompris
2
; Copyed from GAIM By Herman Bloggs <hermanator12002@yahoo.com>
3
; Bruno Coudoin for GCompris
5
; NOTE: this .NSI script is intended for NSIS 2.0 (finale release).
8
;--------------------------------
15
;--------------------------------
18
;The name var is set in .onInit
21
!define GCOMPRIS_VERSION "9.0"
23
OutFile "gcompris-${GCOMPRIS_VERSION}.exe"
25
UninstallIcon ".\gcompris-uninstal.ico"
29
ShowUninstDetails hide
32
; $name and $INSTDIR are set in .onInit function..
35
!include "Sections.nsh"
37
;--------------------------------
40
!define GCOMPRIS_NSIS_INCLUDE_PATH ".\nsis"
41
!define GCOMPRIS_INSTALLER_DEPS "..\win32-dev\gcompris-inst-deps"
43
!define GCOMPRIS_REG_KEY "SOFTWARE\gcompris"
44
!define GCOMPRIS_UNINSTALL_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Gcompris"
45
!define HKLM_APP_PATHS_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\gcompris.exe"
46
!define GCOMPRIS_STARTUP_RUN_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
47
!define GCOMPRIS_UNINST_EXE "gcompris-uninst.exe"
48
!define GCOMPRIS_REG_LANG "Installer Language"
50
;--------------------------------
51
;Modern UI Configuration
53
!define MUI_ICON ".\gcompris.ico"
54
!define MUI_UNICON ".\gcompris-uninstal.ico"
55
!define MUI_WELCOMEFINISHPAGE_BITMAP ".\nsis\gcompris-intro.bmp"
56
!define MUI_HEADERIMAGE
57
!define MUI_HEADERIMAGE_BITMAP ".\nsis\gcompris-header.bmp"
59
; Alter License section
60
!define MUI_LICENSEPAGE_BUTTON $(GCOMPRIS_LICENSE_BUTTON)
61
!define MUI_LICENSEPAGE_TEXT_BOTTOM $(GCOMPRIS_LICENSE_BOTTOM_TEXT)
63
!define MUI_COMPONENTSPAGE_SMALLDESC
64
!define MUI_ABORTWARNING
67
!define MUI_FINISHPAGE_RUN "$INSTDIR\gcompris.exe"
68
!define MUI_FINISHPAGE_RUN_NOTCHECKED
69
!define MUI_FINISHPAGE_LINK $(GCOMPRIS_FINISH_VISIT_WEB_SITE)
70
!define MUI_FINISHPAGE_LINK_LOCATION "http://gcompris.net/"
72
;--------------------------------
75
!insertmacro MUI_PAGE_WELCOME
76
!insertmacro MUI_PAGE_LICENSE "./COPYING"
77
!insertmacro MUI_PAGE_COMPONENTS
79
; Gcompris install dir page
80
!insertmacro MUI_PAGE_DIRECTORY
82
!insertmacro MUI_PAGE_INSTFILES
83
!insertmacro MUI_PAGE_FINISH
85
!insertmacro MUI_UNPAGE_WELCOME
86
!insertmacro MUI_UNPAGE_CONFIRM
87
!insertmacro MUI_UNPAGE_INSTFILES
88
!insertmacro MUI_UNPAGE_FINISH
90
;--------------------------------
93
;; English goes first because its the default. The rest are
94
;; in alphabetical order (at least the strings actually displayed
97
!insertmacro MUI_LANGUAGE "English"
99
!insertmacro MUI_LANGUAGE "Albanian"
100
!insertmacro MUI_LANGUAGE "Bulgarian"
101
!insertmacro MUI_LANGUAGE "Catalan"
102
!insertmacro MUI_LANGUAGE "Czech"
103
!insertmacro MUI_LANGUAGE "Danish"
104
!insertmacro MUI_LANGUAGE "SimpChinese"
105
!insertmacro MUI_LANGUAGE "TradChinese"
106
!insertmacro MUI_LANGUAGE "German"
107
!insertmacro MUI_LANGUAGE "Spanish"
108
!insertmacro MUI_LANGUAGE "French"
109
!insertmacro MUI_LANGUAGE "Hebrew"
110
!insertmacro MUI_LANGUAGE "Italian"
111
!insertmacro MUI_LANGUAGE "Japanese"
112
!insertmacro MUI_LANGUAGE "Korean"
113
!insertmacro MUI_LANGUAGE "Hungarian"
114
!insertmacro MUI_LANGUAGE "Dutch"
115
!insertmacro MUI_LANGUAGE "Norwegian"
116
!insertmacro MUI_LANGUAGE "Polish"
117
!insertmacro MUI_LANGUAGE "PortugueseBR"
118
!insertmacro MUI_LANGUAGE "Portuguese"
119
!insertmacro MUI_LANGUAGE "Romanian"
120
!insertmacro MUI_LANGUAGE "Russian"
121
!insertmacro MUI_LANGUAGE "Serbian"
122
!insertmacro MUI_LANGUAGE "Slovak"
123
!insertmacro MUI_LANGUAGE "Slovenian"
124
!insertmacro MUI_LANGUAGE "Finnish"
125
!insertmacro MUI_LANGUAGE "Swedish"
127
;--------------------------------
130
!define GCOMPRIS_DEFAULT_LANGFILE "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\english.nsh"
132
!include "${GCOMPRIS_NSIS_INCLUDE_PATH}\langmacros.nsh"
134
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "ALBANIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\albanian.nsh"
135
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "BULGARIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\bulgarian.nsh"
136
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "CATALAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\catalan.nsh"
137
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "CZECH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\czech.nsh"
138
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "DANISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\danish.nsh"
139
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "DUTCH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\dutch.nsh"
140
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "ENGLISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\english.nsh"
141
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "FINNISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\finnish.nsh"
142
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "FRENCH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\french.nsh"
143
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "GERMAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\german.nsh"
144
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "HEBREW" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\hebrew.nsh"
145
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "HUNGARIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\hungarian.nsh"
146
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "ITALIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\italian.nsh"
147
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "JAPANESE" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\japanese.nsh"
148
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "KOREAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\korean.nsh"
149
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "NORWEGIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\norwegian.nsh"
150
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "POLISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\polish.nsh"
151
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "PORTUGUESE" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\portuguese.nsh"
152
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "PORTUGUESEBR" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\portuguese-br.nsh"
153
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "ROMANIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\romanian.nsh"
154
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "RUSSIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\russian.nsh"
155
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SERBIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\serbian-latin.nsh"
156
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SIMPCHINESE" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\simp-chinese.nsh"
157
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SLOVAK" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\slovak.nsh"
158
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SLOVENIAN" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\slovenian.nsh"
159
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SPANISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\spanish.nsh"
160
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "SWEDISH" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\swedish.nsh"
161
!insertmacro GCOMPRIS_MACRO_INCLUDE_LANGFILE "TRADCHINESE" "${GCOMPRIS_NSIS_INCLUDE_PATH}\translations\trad-chinese.nsh"
163
;--------------------------------
165
; Only need this if using bzip2 compression
167
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
168
!insertmacro MUI_RESERVEFILE_LANGDLL
169
ReserveFile "${NSISDIR}\Plugins\UserInfo.dll"
172
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
173
;; Start Install Sections ;;
174
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
176
;--------------------------------
177
;Uninstall any old version of Gcompris
179
Section -SecUninstallOldGcompris
180
; Check install rights..
181
Call CheckUserInstallRights
184
;If gcompris is currently set to run on startup,
185
; save the section of the Registry where the setting is before uninstalling,
186
; so we can put it back after installing the new version
188
ReadRegStr $STARTUP_RUN_KEY HKCU "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris"
190
StrCpy $STARTUP_RUN_KEY "HKCU"
192
ReadRegStr $STARTUP_RUN_KEY HKLM "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris"
194
StrCpy $STARTUP_RUN_KEY "HKLM"
196
StrCmp $R0 "HKLM" gcompris_hklm
197
StrCmp $R0 "HKCU" gcompris_hkcu done
200
ReadRegStr $R1 HKCU ${GCOMPRIS_REG_KEY} ""
201
ReadRegStr $R2 HKCU ${GCOMPRIS_REG_KEY} "Version"
202
ReadRegStr $R3 HKCU "${GCOMPRIS_UNINSTALL_KEY}" "UninstallString"
206
ReadRegStr $R1 HKLM ${GCOMPRIS_REG_KEY} ""
207
ReadRegStr $R2 HKLM ${GCOMPRIS_REG_KEY} "Version"
208
ReadRegStr $R3 HKLM "${GCOMPRIS_UNINSTALL_KEY}" "UninstallString"
210
; If previous version exists .. remove
213
; Version key started with 0.60a3. Prior versions can't be
214
; automaticlly uninstalled.
215
StrCmp $R2 "" uninstall_problem
216
; Check if we have uninstall string..
217
IfFileExists $R3 0 uninstall_problem
218
; Have uninstall string.. go ahead and uninstall.
220
; In this case just wipe out previous Gcompris install dir..
221
; We get here because versions 0.60a1 and 0.60a2 don't have versions set in the registry
222
; and versions 0.60 and lower did not correctly set the uninstall reg string
223
; (the string was set in quotes)
224
MessageBox MB_YESNO $(GCOMPRIS_PROMPT_WIPEOUT) IDYES do_wipeout IDNO cancel_install
229
; Need to copy uninstaller outside of the install dir
231
CopyFiles /SILENT $R3 "$TEMP\${GCOMPRIS_UNINST_EXE}"
233
IfErrors uninstall_problem
234
; Ready to uninstall..
236
ExecWait '"$TEMP\${GCOMPRIS_UNINST_EXE}" /S _?=$R1'
238
Delete "$TEMP\${GCOMPRIS_UNINST_EXE}"
242
Delete "$TEMP\${GCOMPRIS_UNINST_EXE}"
243
Goto uninstall_problem
246
; In this case just wipe out previous Gcompris install dir..
247
; We get here because versions 0.60a1 and 0.60a2 don't have versions set in the registry
248
; and versions 0.60 and lower did not correctly set the uninstall reg string
249
; (the string was set in quotes)
251
MessageBox MB_YESNO "Uninstall previous version?" IDYES do_wipeout IDNO done
254
StrCmp $R0 "HKLM" gcompris_del_lm_reg gcompris_del_cu_reg
256
DeleteRegKey HKCU ${GCOMPRIS_REG_KEY}
257
Goto uninstall_prob_cont
259
DeleteRegKey HKLM ${GCOMPRIS_REG_KEY}
268
;--------------------------------
269
;Gcompris Install Section
271
Section $(GCOMPRIS_SECTION_TITLE) SecGcompris
274
; Check install rights..
275
Call CheckUserInstallRights
278
; Get GTK+ lib dir if we have it..
280
StrCmp $R0 "NONE" gcompris_none
281
StrCmp $R0 "HKLM" gcompris_hklm gcompris_hkcu
284
WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "" "$INSTDIR\gcompris.exe"
285
WriteRegStr HKLM "${HKLM_APP_PATHS_KEY}" "Path" "$R1\bin"
286
WriteRegStr HKLM ${GCOMPRIS_REG_KEY} "" "$INSTDIR"
287
WriteRegStr HKLM ${GCOMPRIS_REG_KEY} "Version" "${GCOMPRIS_VERSION}"
288
WriteRegStr HKLM "${GCOMPRIS_UNINSTALL_KEY}" "DisplayName" $(GCOMPRIS_UNINSTALL_DESC)
289
WriteRegStr HKLM "${GCOMPRIS_UNINSTALL_KEY}" "UninstallString" "$INSTDIR\${GCOMPRIS_UNINST_EXE}"
290
; Sets scope of the desktop and Start Menu entries for all users.
291
SetShellVarContext "all"
292
Goto gcompris_install_files
295
WriteRegStr HKCU ${GCOMPRIS_REG_KEY} "" "$INSTDIR"
296
WriteRegStr HKCU ${GCOMPRIS_REG_KEY} "Version" "${GCOMPRIS_VERSION}"
297
WriteRegStr HKCU "${GCOMPRIS_UNINSTALL_KEY}" "DisplayName" $(GCOMPRIS_UNINSTALL_DESC)
298
WriteRegStr HKCU "${GCOMPRIS_UNINSTALL_KEY}" "UninstallString" "$INSTDIR\${GCOMPRIS_UNINST_EXE}"
299
Goto gcompris_install_files
303
gcompris_install_files:
304
SetOutPath "$INSTDIR"
307
File /r .\win32-install-dir\*.*
309
; If this is under NT4, delete the SILC support stuff
310
; there is a bug that will prevent any account from connecting
311
; See https://lists.silcnet.org/pipermail/silc-devel/2005-January/001588.html
312
Call GetWindowsVersion
314
StrCmp $R2 "NT 4.0" 0 nt4_done
315
Delete "$INSTDIR\plugins\libsilc.dll"
316
Delete "$INSTDIR\silcclient.dll"
317
Delete "$INSTDIR\silc.dll"
321
CreateDirectory "$SMPROGRAMS\Gcompris"
322
CreateShortCut "$SMPROGRAMS\Gcompris\Gcompris.lnk" "$INSTDIR\gcompris.exe"
323
CreateShortCut "$DESKTOP\Gcompris.lnk" "$INSTDIR\gcompris.exe"
324
CreateShortCut "$SMPROGRAMS\Gcompris\Gcompris Admin.lnk" "$INSTDIR\gcompris.exe" `-a` "$INSTDIR\gcompris.exe" 1
325
CreateShortCut "$DESKTOP\Gcompris Admin.lnk" "$INSTDIR\gcompris.exe" `-a` "$INSTDIR\gcompris.exe" 1
326
SetOutPath "$INSTDIR"
328
; If we don't have install rights.. we're done
329
StrCmp $R0 "NONE" done
330
CreateShortCut "$SMPROGRAMS\Gcompris\Uninstall.lnk" "$INSTDIR\${GCOMPRIS_UNINST_EXE}"
333
; Write out installer language
334
WriteRegStr HKCU "${GCOMPRIS_REG_KEY}" "${GCOMPRIS_REG_LANG}" "$LANGUAGE"
336
; write out uninstaller
338
WriteUninstaller "$INSTDIR\${GCOMPRIS_UNINST_EXE}"
341
; If we previously had gcompris setup to run on startup, make it do so again
342
StrCmp $STARTUP_RUN_KEY "HKCU" +1 +2
343
WriteRegStr HKCU "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris" "$INSTDIR\gcompris.exe"
344
StrCmp $STARTUP_RUN_KEY "HKLM" +1 +2
345
WriteRegStr HKLM "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris" "$INSTDIR\gcompris.exe"
348
SectionEnd ; end of default Gcompris section
350
;--------------------------------
355
Call un.CheckUserInstallRights
357
StrCmp $R0 "NONE" no_rights
358
StrCmp $R0 "HKCU" try_hkcu try_hklm
361
ReadRegStr $R0 HKCU ${GCOMPRIS_REG_KEY} ""
362
StrCmp $R0 $INSTDIR 0 cant_uninstall
363
; HKCU install path matches our INSTDIR.. so uninstall
364
DeleteRegKey HKCU ${GCOMPRIS_REG_KEY}
365
DeleteRegKey HKCU "${GCOMPRIS_UNINSTALL_KEY}"
369
ReadRegStr $R0 HKLM ${GCOMPRIS_REG_KEY} ""
370
StrCmp $R0 $INSTDIR 0 try_hkcu
371
; HKLM install path matches our INSTDIR.. so uninstall
372
DeleteRegKey HKLM ${GCOMPRIS_REG_KEY}
373
DeleteRegKey HKLM "${GCOMPRIS_UNINSTALL_KEY}"
374
DeleteRegKey HKLM "${HKLM_APP_PATHS_KEY}"
375
; Sets start menu and desktop scope to all users..
376
SetShellVarContext "all"
379
; The WinPrefs plugin may have left this behind..
380
DeleteRegValue HKCU "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris"
381
DeleteRegValue HKLM "${GCOMPRIS_STARTUP_RUN_KEY}" "Gcompris"
382
; Remove Language preference info
383
DeleteRegKey HKCU ${GCOMPRIS_REG_KEY} ;${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
385
RMDir /r "$INSTDIR\etc"
386
RMDir /r "$INSTDIR\GTK"
387
RMDir /r "$INSTDIR\lib"
388
RMDir /r "$INSTDIR\share"
389
Delete "$INSTDIR\gcompris.exe"
390
Delete "$INSTDIR\${GCOMPRIS_UNINST_EXE}"
391
Delete "$INSTDIR\COPYING"
392
Delete "$INSTDIR\Changelog"
393
Delete "$INSTDIR\README"
394
Delete "$INSTDIR\SDL.dll"
395
Delete "$INSTDIR\SDL_mixer.dll"
396
Delete "$INSTDIR\_cairo.pyd"
397
Delete "$INSTDIR\_gtk.pyd"
398
Delete "$INSTDIR\_socket.pyd"
399
Delete "$INSTDIR\_ssl.pyd"
400
Delete "$INSTDIR\_sqlite.pyd"
401
Delete "$INSTDIR\_tkinter.pyd"
402
Delete "$INSTDIR\atk.pyd"
403
Delete "$INSTDIR\bz2.pyd"
404
Delete "$INSTDIR\freetype6.dll"
405
Delete "$INSTDIR\gnucap.exe"
406
Delete "$INSTDIR\gnuchess.exe"
407
Delete "$INSTDIR\gobject.pyd"
408
Delete "$INSTDIR\gspawn-win32-helper.exe"
409
Delete "$INSTDIR\iconv.dll"
410
Delete "$INSTDIR\intl.dll"
411
Delete "$INSTDIR\jpeg62.dll"
412
Delete "$INSTDIR\libart_lgpl_2-2.dll"
413
Delete "$INSTDIR\libatk-1.0-0.dll"
414
Delete "$INSTDIR\libcairo-2.dll"
415
Delete "$INSTDIR\libfontconfig-1.dll"
416
Delete "$INSTDIR\libgdk-win32-2.0-0.dll"
417
Delete "$INSTDIR\libgdk_pixbuf-2.0-0.dll"
418
Delete "$INSTDIR\libglib-2.0-0.dll"
419
Delete "$INSTDIR\libgmodule-2.0-0.dll"
420
Delete "$INSTDIR\libgnomecanvas-2-0.dll"
421
Delete "$INSTDIR\libgobject-2.0-0.dll"
422
Delete "$INSTDIR\libgthread-2.0-0.dll"
423
Delete "$INSTDIR\libgtk-win32-2.0-0.dll"
424
Delete "$INSTDIR\libiconv-2.dll"
425
Delete "$INSTDIR\libintl-2.dll"
426
Delete "$INSTDIR\libpango-1.0-0.dll"
427
Delete "$INSTDIR\libpangocairo-1.0-0.dll"
428
Delete "$INSTDIR\libpangoft2-1.0-0.dll"
429
Delete "$INSTDIR\libpangowin32-1.0-0.dll"
430
Delete "$INSTDIR\libpng13.dll"
431
Delete "$INSTDIR\libreadline.dll"
432
Delete "$INSTDIR\libxml2.dll"
433
Delete "$INSTDIR\msvcr71.dll"
434
Delete "$INSTDIR\pango.pyd"
435
Delete "$INSTDIR\pangocairo.pyd"
436
Delete "$INSTDIR\pthreadGC.dll"
437
Delete "$INSTDIR\python24.dll"
438
Delete "$INSTDIR\python24.zip"
439
Delete "$INSTDIR\select.pyd"
440
Delete "$INSTDIR\setup.py"
441
Delete "$INSTDIR\sqlite3.dll"
442
Delete "$INSTDIR\unicodedata.pyd"
443
Delete "$INSTDIR\xmlparse.dll"
444
Delete "$INSTDIR\xmltok.dll"
445
Delete "$INSTDIR\zlib.pyd"
446
Delete "$INSTDIR\zlib1.dll"
447
Delete "$INSTDIR\README.mingw"
449
;Try to remove Gcompris install dir .. if empty
453
RMDir /r "$SMPROGRAMS\Gcompris"
454
Delete "$DESKTOP\Gcompris.lnk"
455
Delete "$DESKTOP\Gcompris Admin.lnk"
461
MessageBox MB_OK $(un.GCOMPRIS_UNINSTALL_ERROR_1) IDOK
467
MessageBox MB_OK $(un.GCOMPRIS_UNINSTALL_ERROR_2) IDOK
472
SectionEnd ; end of uninstall section
474
;--------------------------------
476
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
477
!insertmacro MUI_DESCRIPTION_TEXT ${SecGcompris} \
478
$(GCOMPRIS_SECTION_DESCRIPTION)
479
!insertmacro MUI_FUNCTION_DESCRIPTION_END
481
;--------------------------------
484
Function CheckUserInstallRights
489
UserInfo::GetAccountType
492
StrCmp $1 "Admin" 0 +3
495
StrCmp $1 "Power" 0 +3
498
StrCmp $1 "User" 0 +3
501
StrCmp $1 "Guest" 0 +3
515
Function un.CheckUserInstallRights
520
UserInfo::GetAccountType
523
StrCmp $1 "Admin" 0 +3
526
StrCmp $1 "Power" 0 +3
529
StrCmp $1 "User" 0 +3
532
StrCmp $1 "Guest" 0 +3
548
; Push $0 ; Path string
550
; Pop $0 ; 0 - Bad path 1 - Good path
555
IfFileExists $0 dir_exists
556
StrCpy $1 $0 ; save last
561
; IfFileExists "C:" on xp returns true and on win2k returns false
562
; So we're done in such a case..
563
IntCmp $2 2 loop_done
564
; GetParent of "C:" returns ""
565
IntCmp $2 0 loop_done
569
StrCpy $1 "$0\GcomprisFooB"
570
; Check if we can create dir on this drive..
573
IfErrors DirBad DirGood
577
FileOpen $1 "$0\gcomprisfoo.bar" w
578
IfErrors PathBad PathGood
590
Delete "$0\gcomprisfoo.bar"
598
Delete "$0\gcomprisfoo.bar"
604
Function .onVerifyInstDir
608
StrCmp $0 "0" 0 dir_good
614
; input, top of stack (e.g. C:\Program Files\Poop)
615
; output, top of stack (replaces, with e.g. C:\Program Files)
616
; modifies no other variables.
619
; Push "C:\Program Files\Directory\Whatever"
622
; ; at this point $R0 will equal "C:\Program Files\Directory"
624
Exch $0 ; old $0 is on top of stack
638
Exch $0 ; put $0 on top of stack, restore $0 to original value
643
System::Call 'kernel32::OpenMutex(i 2031617, b 0, t "gcompris_is_running") i .R0'
645
MessageBox MB_OK|MB_ICONEXCLAMATION $(GCOMPRIS_IS_RUNNING) IDOK
651
System::Call 'kernel32::OpenMutex(i 2031617, b 0, t "gcompris_is_running") i .R0'
653
MessageBox MB_OK|MB_ICONEXCLAMATION $(GCOMPRIS_IS_RUNNING) IDOK
659
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "gcompris_installer_running") i .r1 ?e'
662
MessageBox MB_OK|MB_ICONEXCLAMATION $(INSTALLER_IS_RUNNING)
665
StrCpy $name "Gcompris ${GCOMPRIS_VERSION}"
666
StrCpy $ISSILENT "/NOUI"
668
; GTK installer has two silent states.. one with Message boxes, one without
669
; If gcompris installer was run silently, we want to supress gtk installer msg boxes.
670
IfSilent 0 set_gtk_normal
671
StrCpy $ISSILENT "/S"
677
IntCmp $LANG_IS_SET 1 skip_lang
678
; Display Language selection dialog
679
!insertmacro MUI_LANGDLL_DISPLAY
682
; If install path was set on the command, use it.
683
StrCmp $INSTDIR "" 0 instdir_done
685
; If gcompris is currently intalled, we should default to where it is currently installed
687
ReadRegStr $INSTDIR HKCU "${GCOMPRIS_REG_KEY}" ""
689
StrCmp $INSTDIR "" 0 instdir_done
690
ReadRegStr $INSTDIR HKLM "${GCOMPRIS_REG_KEY}" ""
692
StrCmp $INSTDIR "" 0 instdir_done
694
Call CheckUserInstallRights
697
StrCmp $0 "HKLM" 0 user_dir
698
StrCpy $INSTDIR "$PROGRAMFILES\Gcompris"
701
StrCpy $2 "$SMPROGRAMS"
706
StrCpy $INSTDIR "$2\Gcompris"
714
StrCpy $name "Gcompris ${GCOMPRIS_VERSION}"
716
; Get stored language prefrence
717
ReadRegStr $LANGUAGE HKCU ${GCOMPRIS_REG_KEY} "${GCOMPRIS_REG_LANG}"
724
; output, top of stack (replaces, with e.g. whatever)
725
; modifies no other variables.
727
Function GetParameters
737
;Check for quote or space
738
StrCpy $R0 $CMDLINE $R2
746
StrCpy $R0 $CMDLINE 1 $R2
753
StrCpy $R0 $CMDLINE 1 $R2
755
StrCpy $R0 $CMDLINE "" $R2
765
; input, top of stack = string to search for
766
; top of stack-1 = string to search in
767
; output, top of stack (replaces with the portion of the string remaining)
768
; modifies no other variables.
771
; Push "this is a long ass string"
775
; ($R0 at this point is "ass string")
778
Exch $R1 ; st=haystack,old$R1, $R1=needle
779
Exch ; st=old$R1,haystack
780
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
792
StrCpy $R5 $R2 $R3 $R4
798
StrCpy $R1 $R2 "" $R4
807
; Parse the Command line
809
; Unattended install command line parameters
810
; /L=Language e.g.: /L=1033
812
Function ParseParameters
813
IntOp $LANG_IS_SET 0 + 0
821
StrCpy $R1 $R1 4 2 ; Strip first 2 chars of string
823
IntOp $LANG_IS_SET 0 + 1
829
; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
830
; Updated by Joost Verburg
832
; Returns on top of stack
834
; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
836
; '' (Unknown Windows Version)
839
; Call GetWindowsVersion
842
; at this point $R0 is "NT 4.0" or whatnot
843
Function GetWindowsVersion
848
ReadRegStr $R0 HKLM \
849
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
854
ReadRegStr $R0 HKLM \
855
"SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
858
StrCmp $R1 '4' 0 lbl_error
862
StrCmp $R1 '4.0' lbl_win32_95
863
StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
880
StrCmp $R1 '3' lbl_winnt_x
881
StrCmp $R1 '4' lbl_winnt_x
885
StrCmp $R1 '5.0' lbl_winnt_2000
886
StrCmp $R1 '5.1' lbl_winnt_XP
887
StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
890
StrCpy $R0 "NT $R0" 6