| 1 |
Name "FBReader for Windows" |
| 2 |
|
| 3 |
OutFile "FBReaderSetup-@[email protected]" |
| 4 |
|
| 5 |
InstallDir $PROGRAMFILES\FBReader |
| 6 |
InstallDirRegKey HKCU "Software\FBReader" "" |
| 7 |
|
| 8 |
Page directory |
| 9 |
Page components |
| 10 |
Page instfiles |
| 11 |
|
| 12 |
UninstPage uninstConfirm |
| 13 |
UninstPage instfiles |
| 14 |
|
| 15 |
Section "FBReader" |
| 16 |
SectionIn RO |
| 17 |
|
| 18 |
SetOutPath "$INSTDIR" |
| 19 |
|
| 20 |
WriteRegStr HKCU "Software\FBReader" "" $INSTDIR |
| 21 |
|
| 22 |
File /oname=FBReader.exe bin/FBReader |
| 23 |
File ../../libs/win32/*.* |
| 24 |
File /r share |
| 25 |
Delete "$INSTDIR\libiconv-2.dll" |
| 26 |
Delete "$INSTDIR\share\FBReader\help\MiniHelp.fb2" |
| 27 |
Delete "$INSTDIR\share\FBReader\hyphenationPatterns.zip" |
| 28 |
|
| 29 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FBReader for Windows" "DisplayName" "FBReader for Windows" |
| 30 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FBReader for Windows" "UninstallString" '"$INSTDIR\uninstall.exe"' |
| 31 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FBReader for Windows" "NoModify" 1 |
| 32 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FBReader for Windows" "NoRepair" 1 |
| 33 |
WriteUninstaller "uninstall.exe" |
| 34 |
|
| 35 |
CreateDirectory "$SMPROGRAMS\FBReader for Windows" |
| 36 |
CreateShortCut "$SMPROGRAMS\FBReader for Windows\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
| 37 |
CreateShortCut "$SMPROGRAMS\FBReader for Windows\FBReader.lnk" "$INSTDIR\FBReader.exe" "" "$INSTDIR\FBReader.exe" 0 |
| 38 |
|
| 39 |
ReadRegStr $0 HKCU "Software\FBReader\options\Options" "Base:fontFamily" |
| 40 |
StrCmp $0 "" 0 +2 |
| 41 |
WriteRegStr HKCU "Software\FBReader\options\Style" "Base:fontFamily" "Georgia" |
| 42 |
ReadRegStr $0 HKCU "Software\FBReader\options\Options" "Base:fontSize" |
| 43 |
StrCmp $0 "" 0 +2 |
| 44 |
WriteRegStr HKCU "Software\FBReader\options\Style" "Base:fontSize" "20" |
| 45 |
ReadRegStr $0 HKCU "Software\FBReader\options\Options" "BookPath" |
| 46 |
StrCmp $0 "" 0 +2 |
| 47 |
WriteRegStr HKCU "Software\FBReader\options\Options" "BookPath" "C:\Books;$PROFILE\Books" |
| 48 |
ReadRegStr $0 HKCU "Software\FBReader\options\Options" "DownloadDirectory" |
| 49 |
StrCmp $0 "" 0 +2 |
| 50 |
WriteRegStr HKCU "Software\FBReader\options\Options" "DownloadDirectory" "$PROFILE\Books" |
| 51 |
WriteRegStr HKCU "Software\FBReader\options\PlatformOptions" "TouchScreenPresented" "true" |
| 52 |
WriteRegStr HKCU "Software\FBReader\options\PlatformOptions" "MousePresented" "true" |
| 53 |
WriteRegStr HKCU "Software\FBReader\options\PlatformOptions" "KeyboardPresented" "true" |
| 54 |
WriteRegStr HKCU "Software\FBReader\options\Options" "LeftMargin" "50" |
| 55 |
WriteRegStr HKCU "Software\FBReader\options\Options" "RightMargin" "50" |
| 56 |
WriteRegStr HKCU "Software\FBReader\options\Options" "KeyDelay" "0" |
| 57 |
WriteRegStr HKCU "Software\FBReader\options\Scrollings" "Delay" "0" |
| 58 |
WriteRegStr HKCU "Software\FBReader\options\TapScrolling" "Enabled" "true" |
| 59 |
SectionEnd |
| 60 |
|
| 61 |
Section "Create Shortcut on Desktop" |
| 62 |
CreateShortCut "$DESKTOP\FBReader.lnk" "$INSTDIR\FBReader.exe" "" "$INSTDIR\FBReader.exe" 0 |
| 63 |
SectionEnd |
| 64 |
|
| 65 |
Section "Uninstall" |
| 66 |
ClearErrors |
| 67 |
Delete "$INSTDIR\FBReader.exe" |
| 68 |
IfErrors 0 ContinueUninstallation |
| 69 |
MessageBox MB_OK "Cannot uninstall FBReader while the program is running.$\nPlease quit FBReader and try again." |
| 70 |
Quit |
| 71 |
ContinueUninstallation: |
| 72 |
RMDir /r "$INSTDIR\share" |
| 73 |
Delete "$INSTDIR\*.dll" |
| 74 |
Delete "$INSTDIR\*.license" |
| 75 |
Delete "$INSTDIR\uninstall.exe" |
| 76 |
RMDir "$INSTDIR" |
| 77 |
|
| 78 |
RMDir /r "$SMPROGRAMS\FBReader for Windows" |
| 79 |
Delete "$DESKTOP\FBReader.lnk" |
| 80 |
|
| 81 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FBReader for Windows" |
| 82 |
DeleteRegKey /ifempty HKCU "Software\FBReader" |
| 83 |
|
| 84 |
MessageBox MB_YESNO "Remove FBReader configuration from registry?" IDNO SkipConfigDeletion |
| 85 |
DeleteRegKey HKCU "Software\FBReader" |
| 86 |
SkipConfigDeletion: |
| 87 |
|
| 88 |
MessageBox MB_YESNO "Remove FBReader library information?" IDNO SkipLibraryDeletion |
| 89 |
RMDir /r "$PROFILE\.FBReader" |
| 90 |
SkipLibraryDeletion: |
| 91 |
SectionEnd |