comparison gaim-installer.nsi @ 14984:8186cb621d2b

[gaim-migrate @ 17762] GTK+ Theme selection will now choose the system-wide theme if the installer is being run by the admin user. Also, the theme checkboxes can now be all unselected and we wont mess with the current theme selection. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 17 Nov 2006 01:11:18 +0000
parents 43f692951d49
children 6bdcfafc2259
comparison
equal deleted inserted replaced
14983:9ddfd5c846f9 14984:8186cb621d2b
47 47
48 !include "WordFunc.nsh" 48 !include "WordFunc.nsh"
49 !insertmacro VersionCompare 49 !insertmacro VersionCompare
50 50
51 !include "TextFunc.nsh" 51 !include "TextFunc.nsh"
52 !insertmacro ConfigRead
53 !insertmacro ConfigWriteS 52 !insertmacro ConfigWriteS
54 53
55 ;-------------------------------- 54 ;--------------------------------
56 ;Defines 55 ;Defines
57 56
485 SectionEnd ; end of default Gaim section 484 SectionEnd ; end of default Gaim section
486 485
487 ;-------------------------------- 486 ;--------------------------------
488 ;Shortcuts 487 ;Shortcuts
489 488
490 SubSection /e $(GAIM_SHORTCUTS_SECTION_TITLE) SecShortcuts 489 SectionGroup /e $(GAIM_SHORTCUTS_SECTION_TITLE) SecShortcuts
491 Section /o $(GAIM_DESKTOP_SHORTCUT_SECTION_TITLE) SecDesktopShortcut 490 Section /o $(GAIM_DESKTOP_SHORTCUT_SECTION_TITLE) SecDesktopShortcut
492 SetOverwrite on 491 SetOverwrite on
493 CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe" 492 CreateShortCut "$DESKTOP\Gaim.lnk" "$INSTDIR\gaim.exe"
494 SetOverwrite off 493 SetOverwrite off
495 SectionEnd 494 SectionEnd
497 SetOverwrite on 496 SetOverwrite on
498 CreateDirectory "$SMPROGRAMS\Gaim" 497 CreateDirectory "$SMPROGRAMS\Gaim"
499 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe" 498 CreateShortCut "$SMPROGRAMS\Gaim\Gaim.lnk" "$INSTDIR\gaim.exe"
500 SetOverwrite off 499 SetOverwrite off
501 SectionEnd 500 SectionEnd
502 SubSectionEnd 501 SectionGroupEnd
503 502
504 ;-------------------------------- 503 ;--------------------------------
505 ;GTK+ Themes 504 ;GTK+ Themes
506 505
507 SubSection /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes 506 SectionGroup /e $(GTK_THEMES_SECTION_TITLE) SecGtkThemes
508 Section /o $(GTK_NOTHEME_SECTION_TITLE) SecGtkNone 507 Section /o $(GTK_NOTHEME_SECTION_TITLE) SecGtkNone
509 Push "Raleigh" 508 Push "Raleigh"
510 Call WriteGtkThemeConfig 509 Call WriteGtkThemeConfig
511 SectionEnd 510 SectionEnd
512 511
522 521
523 Section /o $(GTK_LIGHTHOUSEBLUE_SECTION_TITLE) SecGtkLighthouseblue 522 Section /o $(GTK_LIGHTHOUSEBLUE_SECTION_TITLE) SecGtkLighthouseblue
524 Push "Lighthouseblue" 523 Push "Lighthouseblue"
525 Call WriteGtkThemeConfig 524 Call WriteGtkThemeConfig
526 SectionEnd 525 SectionEnd
527 SubSectionEnd 526 SectionGroupEnd
528 527
529 ;-------------------------------- 528 ;--------------------------------
530 ;Spell Checking 529 ;Spell Checking
531 530
532 SubSection /e $(GAIM_SPELLCHECK_SECTION_TITLE) SecSpellCheck 531 SectionGroup /e $(GAIM_SPELLCHECK_SECTION_TITLE) SecSpellCheck
533 Section /o $(GAIM_SPELLCHECK_BRETON) SecSpellCheckBreton 532 Section /o $(GAIM_SPELLCHECK_BRETON) SecSpellCheckBreton
534 Push ${SecSpellCheckBreton} 533 Push ${SecSpellCheckBreton}
535 Call InstallAspellAndDict 534 Call InstallAspellAndDict
536 SectionEnd 535 SectionEnd
537 Section /o $(GAIM_SPELLCHECK_CATALAN) SecSpellCheckCatalan 536 Section /o $(GAIM_SPELLCHECK_CATALAN) SecSpellCheckCatalan
616 SectionEnd 615 SectionEnd
617 Section /o $(GAIM_SPELLCHECK_UKRAINIAN) SecSpellCheckUkrainian 616 Section /o $(GAIM_SPELLCHECK_UKRAINIAN) SecSpellCheckUkrainian
618 Push ${SecSpellCheckUkrainian} 617 Push ${SecSpellCheckUkrainian}
619 Call InstallAspellAndDict 618 Call InstallAspellAndDict
620 SectionEnd 619 SectionEnd
621 SubSectionEnd 620 SectionGroupEnd
622 621
623 ;-------------------------------- 622 ;--------------------------------
624 ;Uninstaller Section 623 ;Uninstaller Section
625 624
626 625
820 819
821 ;-------------------------------- 820 ;--------------------------------
822 ;Functions 821 ;Functions
823 822
824 Function WriteGtkThemeConfig 823 Function WriteGtkThemeConfig
825 Exch $0 824 Exch $0
826 Push $1 825 Push $1
827 826 Push $2
828 ClearErrors 827 Push $3
829 ${ConfigRead} "$PROFILE\.gtkrc-2.0" "gtk-theme-name =" $1 828
830 IfErrors new_file 829 Call CheckUserInstallRights
831 ${ConfigWriteS} "$PROFILE\.gtkrc-2.0" "gtk-theme-name =" "$\"$0$\"" $1 830 Pop $2
832 Goto done 831 StrCmp $2 "HKLM" 0 user_theme
833 832
834 new_file: 833 ; Global Theme
835 ClearErrors 834 ReadRegStr $2 HKLM ${GTK_REG_KEY} "Path"
836 FileOpen $1 "$PROFILE\.gtkrc-2.0" w 835 StrCpy $3 "$2\etc\gtk-2.0\gtkrc"
837 FileWrite $1 "gtk-theme-name = $\"$0$\"" 836 Goto update_theme
838 FileClose $1 837 user_theme:
839 Goto done 838 StrCpy $3 "$PROFILE\.gtkrc-2.0"
840 839
841 done: 840 update_theme:
842 Pop $1 841 IfFileExists $3 0 new_file
843 Pop $0 842 ${ConfigWriteS} $3 "gtk-theme-name =" " $\"$0$\"" $1
843 Goto done
844
845 new_file:
846 FileOpen $1 $3 w
847 FileWrite $1 "gtk-theme-name = $\"$0$\""
848 FileClose $1
849
850 done:
851 Pop $3
852 Pop $2
853 Pop $1
854 Pop $0
844 FunctionEnd 855 FunctionEnd
845 856
846 !macro CheckUserInstallRightsMacro UN 857 !macro CheckUserInstallRightsMacro UN
847 Function ${UN}CheckUserInstallRights 858 Function ${UN}CheckUserInstallRights
848 Push $0 859 Push $0
1175 Function .onSelChange 1186 Function .onSelChange
1176 Push $0 1187 Push $0
1177 Push $1 1188 Push $1
1178 Push $2 1189 Push $2
1179 1190
1180 !insertmacro StartRadioButtons $GTK_THEME_SEL 1191 !insertmacro StartRadioButtonsUnselectable $GTK_THEME_SEL
1181 !insertmacro RadioButton ${SecGtkNone} 1192 !insertmacro RadioButton ${SecGtkNone}
1182 !insertmacro RadioButton ${SecGtkWimp} 1193 !insertmacro RadioButton ${SecGtkWimp}
1183 !insertmacro RadioButton ${SecGtkBluecurve} 1194 !insertmacro RadioButton ${SecGtkBluecurve}
1184 !insertmacro RadioButton ${SecGtkLighthouseblue} 1195 !insertmacro RadioButton ${SecGtkLighthouseblue}
1185 !insertmacro EndRadioButtons 1196 !insertmacro EndRadioButtons