Setup.iss
上传用户:lswyart
上传日期:2008-06-12
资源大小:3441k
文件大小:39k
源码类别:

杀毒

开发平台:

Visual C++

  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3. [Setup]
  4. AppName=ClamWin Free Antivirus
  5. AppVerName=ClamWin Free Antivirus 0.88.1
  6. AppPublisher=alch
  7. AppPublisherURL=http://clamwin.sourceforge.net/
  8. AppSupportURL=http://clamwin.sourceforge.net/
  9. AppUpdatesURL=http://clamwin.sourceforge.net/
  10. DefaultDirName={code:BaseDir}ClamWin
  11. DefaultGroupName=ClamWin Antivirus
  12. LicenseFile=SetupFilesLicense.rtf
  13. AllowNoIcons=true
  14. MinVersion=4.1.1998,5.0.2195
  15. ShowLanguageDialog=no
  16. LanguageDetectionMethod=none
  17. OutputDir=Output
  18. Compression=lzma/ultra
  19. InternalCompressLevel=max
  20. SolidCompression=true
  21. WizardImageFile=SetupfilesWizModernImage.bmp
  22. WizardSmallImageFile=SetupfilesWizModernSmallImage.bmp
  23. [Files]
  24. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  25. ;Source: cygwincygwin1.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion
  26. ;Source: cygwincygbz2-1.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion
  27. ;Source: cygwincyggmp-3.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion
  28. ;Source: cygwincygminires.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion
  29. ;Source: cygwincygz.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion
  30. ;Source: cygwincygcrypto-0.9.7.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion replacesameversion
  31. ;Source: cygwincygssl-0.9.7.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion replacesameversion
  32. ;Source: cygwincygcurl-2.dll; DestDir: {app}bin; Components: Cygwin; Flags: restartreplace uninsrestartdelete replacesameversion replacesameversion
  33. Source: py2exedistbinpython23.dll; DestDir: {app}bin; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  34. Source: py2exedistbinClamTray.exe; DestDir: {app}bin; Components: ClamWin; Flags: restartreplace uninsrestartdelete replacesameversion
  35. Source: py2exedistbinClamWin.exe; DestDir: {app}bin; Components: ClamWin; Flags: restartreplace uninsrestartdelete replacesameversion
  36. Source: ..docHTMLclam.chm; DestDir: {app}bin; Components: ClamWin; Flags: ignoreversion; DestName: manual.chm
  37. Source: ..docl10nRussianManual.chm; DestDir: {app}bin; Components: InternationalHelpRussian; Flags: ignoreversion
  38. ;Source: ..docl10nItalianManual.chm; DestDir: {app}bin; Components: InternationalHelpItalian; Flags: replacesameversion
  39. Source: ..docmanual.pdf; DestDir: {app}bin; Components: ClamWin; Flags: ignoreversion
  40. Source: ..docl10nFrenchManual.pdf; DestDir: {app}bin; Components: InternationalHelpFrench; Flags: ignoreversion
  41. Source: py2exedistbinimgClam.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  42. Source: py2exedistbinimgClamAV.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  43. Source: py2exedistbinimgControl.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  44. Source: py2exedistbinimgScan.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  45. Source: py2exedistbinimgFrameIcon.ico; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  46. Source: py2exedistbinimgTrayIcon.ico; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  47. Source: py2exedistbinimgTitle.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  48. Source: py2exedistbinimgFD-logo.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  49. Source: py2exedistbinimgPythonPowered.gif; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  50. Source: py2exedistbinimgWorld.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  51. Source: py2exedistbinimgSupport.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  52. Source: py2exedistbinimgListScan.png; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  53. Source: py2exedistbinimgSplash.bmp; DestDir: {app}binimg; Components: ClamWin; Flags: ignoreversion
  54. Source: ..clamav-releasecontribmsvcReleaseclamscan.exe; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete replacesameversion
  55. Source: ..clamav-releasecontribmsvcReleasefreshclam.exe; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete replacesameversion
  56. Source: ..clamav-releasecontribmsvcReleasesigtool.exe; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete replacesameversion
  57. Source: ..clamav-releasecontribmsvcReleaselibclamav.dll; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete replacesameversion
  58. ; on xp and greater VC80 CRT needs to be installed in Microsoft.VC80.CRT
  59. Source: Microsoft.VC80.CRTMicrosoft.VC80.CRT.manifest; DestDir: {app}binMicrosoft.VC80.CRT; Components: ClamAV; Check: IsXPOrLater
  60. Source: Microsoft.VC80.CRTmsvcm80.dll; DestDir: {app}binMicrosoft.VC80.CRT; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: IsXPOrLater
  61. Source: Microsoft.VC80.CRTmsvcr80.dll; DestDir: {app}binMicrosoft.VC80.CRT; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: IsXPOrLater
  62. Source: Microsoft.VC80.CRTmsvcp80.dll; DestDir: {app}binMicrosoft.VC80.CRT; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: IsXPOrLater
  63. ; on 2000 and 98 VC80 CRT needs to be installed in the same dir; no manifest
  64. Source: Microsoft.VC80.CRTmsvcm80.dll; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: NotIsXPOrLater
  65. Source: Microsoft.VC80.CRTmsvcr80.dll; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: NotIsXPOrLater
  66. Source: Microsoft.VC80.CRTmsvcp80.dll; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete; Check: NotIsXPOrLater
  67. ;Source: ..clamav-stablesigtoolsigtool.exe; DestDir: {app}bin; Components: ClamAV; Flags: restartreplace uninsrestartdelete replacesameversion
  68. ; Copy Unicode build in NT and ANSI in 9x
  69. Source: ..cppReleaseExpShell.dll; DestDir: {app}bin; Components: ExplorerShell; Flags: restartreplace uninsrestartdelete; Check: IsWin9x
  70. Source: ..cppRelease_UnicodeExpShell.dll; DestDir: {app}bin; Components: ExplorerShell; Flags: restartreplace uninsrestartdelete; Check: UsingWinNT
  71. Source: py2exedistbinWClose.exe; DestDir: {app}bin; Components: ClamWin; Flags: restartreplace uninsrestartdelete replacesameversion
  72. Source: py2exedistlibw9xpopen.exe; DestDir: {app}bin; Components: ClamWin; Flags: restartreplace uninsrestartdelete replacesameversion
  73. Source: py2exedistbinOlAddin.exe; DestDir: {app}bin; Components: OutlookAddin; Flags: restartreplace uninsrestartdelete replacesameversion
  74. Source: {%TEMP|{localappdata}}clamwin-src.zip; DestDir: {app}src; Components: Sources; Flags: external ignoreversion
  75. Source: {%TEMP|{localappdata}}clamav-src.tar.gz; DestDir: {app}src; Components: Sources; Flags: external ignoreversion
  76. ;Source: {%TEMP|{localappdata}}cygwin-src.tar.bz2; DestDir: {app}src; Components: Sources; Flags: external replacesameversion
  77. Source: py2exedistlib_socket.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  78. Source: py2exedistlib_sre.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  79. Source: py2exedistlib_ssl.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  80. Source: py2exedistlib_bsddb.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  81. Source: py2exedistlib_winreg.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  82. Source: py2exedistlibclamwin.zip; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  83. Source: py2exedistlibdatetime.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  84. Source: py2exedistlibmxDateTime.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  85. Source: py2exedistlibexchange.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  86. Source: py2exedistlibexchdapi.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  87. Source: py2exedistlibshell.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  88. Source: py2exedistlibhtmlc.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  89. Source: py2exedistlibgizmosc.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  90. Source: py2exedistlibmapi.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  91. Source: py2exedistlibpythoncom23.dll; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  92. Source: py2exedistlibpywintypes23.dll; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  93. Source: py2exedistlibunicodedata.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  94. Source: py2exedistlibw9xpopen.exe; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  95. Source: py2exedistlibwin32api.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  96. Source: py2exedistlibwin32clipboard.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  97. Source: py2exedistlibwin32event.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  98. Source: py2exedistlibwin32file.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  99. Source: py2exedistlibwin32gui.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  100. Source: py2exedistlibwin32pipe.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  101. Source: py2exedistlibwin32process.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  102. Source: py2exedistlibwin32trace.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  103. Source: py2exedistlibwin32security.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  104. Source: py2exedistlibwxc.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  105. Source: py2exedistlibwxmsw24h.dll; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  106. Source: py2exedistlibzlib.pyd; DestDir: {app}lib; Components: ClamWin; Flags: restartreplace uninsrestartdelete
  107. Source: py2exedistlibBalloonTip.pyd; DestDir: {app}lib; Components: ClamWin; Check: IsWin9x; Flags: restartreplace uninsrestartdelete
  108. [Icons]
  109. Name: {group}Virus Scanner; Filename: {app}binClamWin.exe; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: ClamWin
  110. Name: {code:DesktopDir}ClamWin Antivirus; Filename: {app}binClamWin.exe; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: ClamWin; Tasks: desktopicon
  111. Name: {group}HelpPrintable Manual; Filename: {app}binmanual.pdf; Components: ; WorkingDir: {app}bin
  112. Name: {group}HelpOnline Help; Filename: {app}binmanual.chm; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: ClamWin
  113. Name: {group}HelpInternationalRussian Help; Filename: {app}binRussianManual.chm; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: InternationalHelpRussian
  114. Name: {group}HelpInternationalFrench Help; Filename: {app}binFrenchManual.pdf; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: InternationalHelpFrench
  115. ;Name: {group}HelpInternationalItalian Help; Filename: {app}binItalianManual.chm; WorkingDir: {app}bin; Comment: ClamWin Antivirus; Components: InternationalHelpItalian
  116. [Run]
  117. ; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required.
  118. Filename: {app}binClamWin.exe; Parameters: --mode=update --close; WorkingDir: {app}bin; StatusMsg: Downloading Virus Database Files.; Components: ClamWin; Tasks: DownloadDB
  119. Filename: {app}binClamTray.exe; WorkingDir: {app}bin; Flags: nowait; Components: ClamWin
  120. [Dirs]
  121. ; create clamwin folders in common profiles dir if all users is selected and set permissions so that other users can modify
  122. Name: {code:CommonProfileDir}.clamwindb; Components: ClamAV; Permissions: authusers-full; Check: IsAllUsers
  123. Name: {code:CommonProfileDir}.clamwinlog; Components: ClamAV; Permissions: authusers-full; Check: IsAllUsers
  124. Name: {code:CommonProfileDir}.clamwinquarantine; Components: ClamAV; Permissions: authusers-full; Check: IsAllUsers
  125. ;for non-admin user create tese folders in user's profile dir, don't modify security
  126. Name: {code:CommonProfileDir}.clamwindb; Components: ClamAV; Check: NotIsAllUsers
  127. Name: {code:CommonProfileDir}.clamwinlog; Components: ClamAV; Check: NotIsAllUsers
  128. Name: {code:CommonProfileDir}.clamwinquarantine; Components: ClamAV; Check: NotIsAllUsers
  129. Name: {app}bin; Components: ExplorerShell ClamWin
  130. Name: {app}lib; Components: ClamWin
  131. Name: {app}binimg; Components: ClamWin
  132. Name: {app}src; Components: Sources
  133. [_ISTool]
  134. OutputExeFilename=L:ProjectsClamWinSetupOutputsetup.exe
  135. [Components]
  136. ;Name: Cygwin; Description: Cygwin Files; Flags: fixed; Types: full custom typical
  137. Name: ClamAV; Description: ClamAV Files; Flags: fixed; Types: full custom typical
  138. Name: ClamWin; Description: ClamWin Files; Flags: fixed; Types: full custom typical
  139. Name: ExplorerShell; Description: Integration with Windows Explorer; Types: full custom typical
  140. Name: OutlookAddin; Description: Integration with Microsoft Outlook; Types: full custom typical; Check: IsOutlookInstalled
  141. Name: InternationalHelp; Description: International Help Files; Types: full
  142. Name: InternationalHelpRussian; Description: Russian Help Files; Types: full
  143. Name: InternationalHelpFrench; Description: French Help Files; Types: full
  144. ;Name: InternationalHelpItalian; Description: Italian Help Files; Types: full
  145. Name: Sources; Description: Download Source Code; ExtraDiskSpaceRequired: 9437184; Types: full
  146. [INI]
  147. Filename: {app}binClamWin.conf; Section: ClamAV; Key: clamscan; String: {app}binclamscan.exe; Check: IsIniValueEmpty(ExpandConstant('ClamAV*clamscan*{app}binClamWin.conf'))
  148. Filename: {app}binClamWin.conf; Section: ClamAV; Key: freshclam; String: {app}binfreshclam.exe; Check: IsIniValueEmpty(ExpandConstant('ClamAV*freshclam*{app}binClamWin.conf'))
  149. Filename: {app}binClamWin.conf; Section: ClamAV; Key: database; String: {code:CommonProfileDir}.clamwindb; Check: IsIniValueEmpty(ExpandConstant('ClamAV*database*{app}binClamWin.conf'))
  150. Filename: {app}binClamWin.conf; Section: ClamAV; Key: quarantinedir; String: {code:CommonProfileDir}.clamwinquarantine; Check: IsIniValueEmpty(ExpandConstant('ClamAV*quarantinedir*{app}binClamWin.conf'))
  151. Filename: {app}binClamWin.conf; Section: ClamAV; Key: logfile; String: {code:CommonProfileDir}.clamwinlogClamScanLog.txt; Check: IsIniValueEmpty(ExpandConstant('ClamAV*logfile*{app}binClamWin.conf'))
  152. Filename: {app}binClamWin.conf; Section: Updates; Key: dbupdatelogfile; String: {code:CommonProfileDir}.clamwinlogClamUpdateLog.txt; Check: IsIniValueEmpty(ExpandConstant('Updates*dbupdatelogfile*{app}binClamWin.conf'))
  153. Filename: {app}binClamWin.conf; Section: Updates; Key: time; String: {code:CurTime}; Check: IsIniValueEmpty(ExpandConstant('Updates*time*{app}binClamWin.conf'))
  154. [_ISToolDownload]
  155. Name: Sources_ClamWin; Description: ClamWin Source Code; GroupDescription: Source Code; Flags: unchecked; Source: http://osdn.dl.sourceforge.net/sourceforge/clamwin/clamwin-0.88.1-src.zip; DestDir: {%TEMP|{localappdata}}; DestName: clamwin-src.zip; Components: Sources
  156. Name: Sources_ClamAV; Description: ClamAV Source Code; GroupDescription: Source Code; Flags: unchecked; Source: http://osdn.dl.sourceforge.net/sourceforge/clamav/clamav-0.88.1.tar.gz; DestDir: {%TEMP|{localappdata}}; DestName: clamav-src.tar.gz; Components: Sources
  157. ;Name: Sources_Cygwin; Description: Cygwin Source Code; GroupDescription: Source Codes; Flags: unchecked; Source: http://mirrors.kernel.org/sources.redhat.com/cygwin/release/cygwin/cygwin-1.5.18-1-src.tar.bz2; DestDir: {%TEMP|{localappdata}}; DestName: cygwin-src.tar.bz2; Components: Sources
  158. [Types]
  159. Name: typical; Description: Typical Installation
  160. Name: custom; Description: Custom Installation; Flags: iscustom
  161. Name: full; Description: Full Installation
  162. [UninstallDelete]
  163. Name: {tmp}ClamWin_Scheduler_Info; Type: files; Components: ClamWin
  164. Name: {tmp}ClamWin_Upadte_Time; Type: files; Components: ClamWin
  165. Name: {app}binClamWin.conf; Type: files
  166. Name: {userappdata}.clamwin; Type: filesandordirs
  167. Name: {code:CommonProfileDir}.clamwin; Type: filesandordirs
  168. [Registry]
  169. ; write to HKLM and HKCR when user is admin
  170. ; and to HKCU when not
  171. ; ClamWin entries
  172. Root: HKLM; Subkey: SoftwareMicrosoftWindowsCurrentVersionRun; ValueType: string; ValueName: ClamWin; ValueData: """{app}binClamTray.exe"" --logon"; Flags: uninsdeletevalue; Components: ClamWin; Check: IsAllUsers
  173. Root: HKLM; Subkey: SoftwareClamWin; ValueType: string; ValueName: Path; ValueData: {app}bin; Flags: uninsdeletekey deletevalue; Components: ClamWin; Check: IsAllUsers
  174. Root: HKLM; Subkey: SoftwareClamWin; ValueType: dword; ValueName: Version; ValueData: 881; Flags: uninsdeletekey deletevalue; Components: ClamWin; Check: IsAllUsers
  175. Root: HKCU; Subkey: SoftwareMicrosoftWindowsCurrentVersionRun; ValueType: string; ValueName: ClamWin; ValueData: """{app}binClamTray.exe"" --logon"; Flags: uninsdeletevalue; Components: ClamWin; Check: NotIsAllUsers
  176. Root: HKCU; Subkey: SoftwareClamWin; ValueType: string; ValueName: Path; ValueData: {app}bin; Flags: uninsdeletekey deletevalue; Components: ClamWin; Check: NotIsAllUsers
  177. Root: HKCU; Subkey: SoftwareClamWin; ValueType: dword; ValueName: Version; ValueData: 374; Flags: uninsdeletekey deletevalue; Components: ClamWin; Check: NotIsAllUsers
  178. ; ExplorerShell entries
  179. Root: HKCR; Subkey: CLSID{{65713842-C410-4f44-8383-BFE01A398C90}InProcServer32; ValueType: string; ValueData: {app}binExpShell.dll; Flags: uninsdeletekey; Components: ExplorerShell; Check: IsAllUsers
  180. Root: HKCR; Subkey: CLSID{{65713842-C410-4f44-8383-BFE01A398C90}InProcServer32; ValueType: string; ValueData: Apartment; Flags: uninsdeletekey; ValueName: ThreadingModel; Components: ExplorerShell; Check: IsAllUsers
  181. Root: HKCR; Subkey: *shellexContextMenuHandlersClamWin; ValueType: string; ValueData: {{65713842-C410-4f44-8383-BFE01A398C90}; Flags: uninsdeletekey; Components: ExplorerShell; Check: IsAllUsers
  182. Root: HKCR; Subkey: FoldershellexContextMenuHandlersClamWin; ValueType: string; ValueData: {{65713842-C410-4f44-8383-BFE01A398C90}; Flags: uninsdeletekey; Components: ExplorerShell; Check: IsAllUsers
  183. Root: HKCU; Subkey: SoftwareClassesCLSID{{65713842-C410-4f44-8383-BFE01A398C90}InProcServer32; ValueType: string; ValueData: {app}binExpShell.dll; Flags: uninsdeletekey; Components: ExplorerShell; Check: NotIsAllUsers
  184. Root: HKCU; Subkey: SoftwareClassesCLSID{{65713842-C410-4f44-8383-BFE01A398C90}InProcServer32; ValueType: string; ValueData: Apartment; Flags: uninsdeletekey; ValueName: ThreadingModel; Components: ExplorerShell; Check: NotIsAllUsers
  185. Root: HKCU; Subkey: SoftwareClasses*shellexContextMenuHandlersClamWin; ValueType: string; ValueData: {{65713842-C410-4f44-8383-BFE01A398C90}; Flags: uninsdeletekey; Components: ExplorerShell; Check: NotIsAllUsers
  186. Root: HKCU; Subkey: SoftwareClassesFoldershellexContextMenuHandlersClamWin; ValueType: string; ValueData: {{65713842-C410-4f44-8383-BFE01A398C90}; Flags: uninsdeletekey; Components: ExplorerShell; Check: NotIsAllUsers
  187. ; Cygwin entries
  188. ;Root: HKLM; Subkey: SoftwareCygnus Solutions; Flags: uninsdeletekeyifempty; Check: NoCygWinAllUsers
  189. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwin; Flags: uninsdeletekeyifempty; Check: NoCygWinAllUsers
  190. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwinProgram Options; Flags: uninsdeletekeyifempty; Check: NoCygWinAllUsers
  191. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwinmounts v2; Flags: uninsdeletekeyifempty; Check: NoCygWinAllUsers
  192. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwinmounts v2/tmp; ValueType: string; ValueName: native; ValueData: {code:TempDir}; Flags: uninsdeletekeyifempty uninsdeletevalue; Check: NoCygWinAllUsers
  193. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwinmounts v2/tmp; ValueType: dword; ValueName: flags; ValueData: 10; Flags: uninsdeletekeyifempty uninsdeletevalue; Check: NoCygWinAllUsers
  194. ;Root: HKCU; Subkey: SoftwareCygnus Solutions; Flags: uninsdeletekeyifempty; Check: NoCygWinNotAllUsers
  195. ;Root: HKCU; Subkey: SoftwareCygnus SolutionsCygwin; Flags: uninsdeletekeyifempty; Check: NoCygWinNotAllUsers
  196. ;Root: HKCU; Subkey: SoftwareCygnus SolutionsCygwinProgram Options; Flags: uninsdeletekeyifempty; Check: NoCygWinNotAllUsers
  197. ;Root: HKCU; Subkey: SoftwareCygnus SolutionsCygwinmounts v2; Flags: uninsdeletekeyifempty; Check: NoCygWinNotAllUsers
  198. ;Root: HKCU; Subkey: SoftwareCygnus SolutionsCygwinmounts v2/tmp; ValueType: string; ValueName: native; ValueData: {code:TempDir}; Flags: uninsdeletekeyifempty uninsdeletevalue; Check: NoCygWinNotAllUsers
  199. ;Root: HKCU; Subkey: SoftwareCygnus SolutionsCygwinmounts v2/tmp; ValueType: dword; ValueName: flags; ValueData: 10; Flags: uninsdeletekeyifempty uninsdeletevalue; Check: NoCygWinNotAllUsers
  200. ;Root: HKLM; Subkey: SoftwareCygnus SolutionsCygwinProgram Options; Flags: uninsdeletekeyifempty; Check: NoCygWinAllUsers
  201. ; OutlookAddin entries for all users
  202. ;delete COM InprocServer32 key if present (we moved to EXE COM server)
  203. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}InprocServer32; Components: OutlookAddin; Check: IsAllUsers; Flags: deletekey noerror dontcreatekey
  204. ;install new EXE COM server
  205. Root: HKCR; Subkey: AppID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  206. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  207. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}LocalServer32; ValueType: string; ValueData: {app}binOlAddin.exe /Automate; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  208. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOM; ValueType: string; ValueData: OlAddin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  209. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOMPolicy; ValueType: string; ValueData: win32com.server.policy.EventHandlerPolicy; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  210. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOMPath; ValueType: string; ValueData: {app}bin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  211. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}Implemented Categories{{B3EF80D0-68E2-11D0-A689-00C04FD658FF}; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  212. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}Debugging; ValueType: string; ValueData: 0; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  213. Root: HKCR; Subkey: CLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}ProgID; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  214. Root: HKCR; Subkey: ClamWin.OutlookAddin; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  215. Root: HKCR; Subkey: ClamWin.OutlookAddinCLSID; ValueType: string; ValueData: {{E77FA584-1433-4af3-800D-AEC49BCCCB11}; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  216. Root: HKLM; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: dword; ValueName: CommandLineSafe; ValueData: 0; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  217. Root: HKLM; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: dword; ValueName: LoadBehavior; ValueData: 3; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  218. Root: HKLM; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: string; ValueName: Description; ValueData: ClamWin Antivirus; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  219. Root: HKLM; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: string; ValueName: FriendlyName; ValueData: ClamWin Antivirus; Flags: uninsdeletekey; Components: OutlookAddin; Check: IsAllUsers
  220. ; OutlookAddin entries for current user
  221. ;delete COM InprocServer32 key if present (we moved to EXE COM server)
  222. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}InprocServer32; Components: OutlookAddin; Check: NotIsAllUsers; Flags: deletekey dontcreatekey noerror
  223. ;install new COM EXE server
  224. Root: HKCU; Subkey: SoftwareClassesAppID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  225. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  226. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}LocalServer32; ValueType: string; ValueData: {app}binOlAddin.exe /Automate; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  227. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOM; ValueType: string; ValueData: OlAddin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  228. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOMPolicy; ValueType: string; ValueData: win32com.server.policy.EventHandlerPolicy; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  229. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}PythonCOMPath; ValueType: string; ValueData: {app}bin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  230. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}Implemented Categories{{B3EF80D0-68E2-11D0-A689-00C04FD658FF}; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  231. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}Debugging; ValueType: string; ValueData: 0; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  232. Root: HKCU; Subkey: SoftwareClassesCLSID{{E77FA584-1433-4af3-800D-AEC49BCCCB11}ProgID; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  233. Root: HKCU; Subkey: SoftwareClassesClamWin.OutlookAddin; ValueType: string; ValueData: ClamWin.OutlookAddin; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  234. Root: HKCU; Subkey: SoftwareClassesClamWin.OutlookAddinCLSID; ValueType: string; ValueData: {{E77FA584-1433-4af3-800D-AEC49BCCCB11}; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  235. Root: HKCU; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: dword; ValueName: CommandLineSafe; ValueData: 0; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  236. Root: HKCU; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: dword; ValueName: LoadBehavior; ValueData: 3; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  237. Root: HKCU; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: string; ValueName: Description; ValueData: ClamWin Antivirus; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  238. Root: HKCU; Subkey: SoftwareMicrosoftOfficeOutlookAddinsClamWin.OutlookAddin; ValueType: string; ValueName: FriendlyName; ValueData: ClamWin Antivirus; Flags: uninsdeletekey; Components: OutlookAddin; Check: NotIsAllUsers
  239. [Tasks]
  240. Name: DownloadDB; Description: Download Virus Database Files. (Do Not Select if you connect via a Proxy Server); GroupDescription: Download; Components: ClamAV
  241. ; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required.
  242. Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Flags: unchecked
  243. [UninstallRun]
  244. Filename: {app}binWClose.exe; WorkingDir: {app}bin
  245. [Code]
  246. var
  247.   //CygwinChecked, CygwinFound: Boolean;
  248.   AllUsers: Boolean;
  249.   SetupCompleted: Boolean;
  250.   Time: String;
  251.   PreviousVersion, ThisVersion: Integer;
  252.   AllUsersPage: TInputOptionWizardPage;
  253. procedure InitializeWizard;
  254. begin
  255.   // Create the pages
  256.   AllUsersPage := CreateInputOptionPage(wpLicense,
  257.     'Select Installation Options', 'Who should this application be installed for?',
  258.     'Please select whether you wish to make this software available to all users or just yourself.',
  259.     True, False);
  260.   AllUsersPage.Add('&Anyone who uses this computer (all users)');
  261.   AllUsersPage.Add('Only for &me (' + GetUserNameString() + ')');
  262.   // Set default values, using settings that were stored last time if possible
  263.   case GetPreviousData('AllUsersMode', '') of
  264.     'anyone': AllUsers := True;
  265.     'onlyme': AllUsers := False;
  266.   end;
  267.   if (AllUsers) then
  268.     AllUsersPage.SelectedValueIndex := 0
  269.   else
  270.     AllUsersPage.SelectedValueIndex := 1;
  271. end;
  272. procedure RegisterPreviousData(PreviousDataKey: Integer);
  273. var
  274.   AllUsersModeStr: String;
  275. begin
  276.   // Store the settings so we can restore them next time
  277.   case AllUsersPage.SelectedValueIndex of
  278.     0: AllUsersModeStr := 'anyone';
  279.     1: AllUsersModeStr := 'onlyme';
  280.   end;
  281.   SetPreviousData(PreviousDataKey, 'AllUsersMode', AllUsersModeStr);
  282. end;
  283. function RemoveSetup(keyname: String): Boolean;
  284. var
  285. uninstall: String;
  286. resultcode: Integer;
  287. begin
  288. if not RegKeyExists(HKEY_LOCAL_MACHINE, keyname) then begin
  289. Result := True;
  290. exit;
  291. end;
  292. if not RegQueryStringValue(HKEY_LOCAL_MACHINE, keyname, 'UninstallString',  uninstall) then begin
  293. Result := True;
  294. exit;
  295. end;
  296. if SuppressibleMsgBox('The Setup detected previous version of the software is already installed on this computer. Cick Yes to uninstall it now.',
  297.               mbConfirmation, MB_YESNO, IDYES) = idYes then begin
  298. Result := Exec(RemoveQuotes(uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
  299. end else begin
  300. Result := False;
  301. end;
  302. end;
  303. function ShouldSkipPage(PageID: Integer): Boolean;
  304. begin
  305.   // Skip pages that shouldn't be shown
  306.   // in win 98/me we don't ask for all users nor we do if an admin is not logged on
  307.   if (PageID = AllUsersPage.ID) then begin
  308.     if (not UsingWinNT()) then
  309.   Result := True
  310. else if (not IsAdminLoggedOn()) then begin
  311.   Result := True;
  312. end;
  313.   end else
  314.     Result := False;
  315. end;
  316. function NextButtonClick(CurPage: Integer): Boolean;
  317. begin
  318. Result := istool_download(CurPage);
  319. if CurPage = wpFinished then
  320. SetupCompleted := True
  321. else if CurPage = AllUsersPage.ID then begin
  322. case AllUsersPage.SelectedValueIndex of
  323. 0: AllUsers := True;
  324. 1: AllUsers := False;
  325. end;
  326. if ((not IsAdminLoggedOn()) and (not AllUsers)) then
  327. RemoveSetup('SOFTWAREMicrosoftWindowsCurrentVersionUninstallClamWin Antivirus_is1');
  328. end;
  329. end;
  330. function IsOutlookInstalled() : Boolean;
  331. begin
  332.     Result := RegKeyExists( HKCU, 'SoftwareMicrosoftOfficeOutlook') or
  333. RegKeyExists( HKLM, 'SoftwareMicrosoftOfficeOutlook') or
  334. RegKeyExists( HKLM, 'SoftwareMicrosoftOffice9.0Outlook') or
  335. RegKeyExists( HKLM, 'SoftwareMicrosoftOffice10.0Outlook') or
  336. RegKeyExists( HKLM, 'SoftwareMicrosoftOffice11.0Outlook');
  337. end;
  338. function CheckNoAppMutex( mutexName: String; closeMsg: String) : Boolean;
  339. begin
  340.     Result := true;
  341.     if Pos('/SUPPRESSMSGBOXES', Uppercase(GetCmdTail())) = 0 then begin
  342. while Result do begin
  343. if not CheckForMutexes(mutexName) then
  344. break;
  345. Result := MsgBox(closeMsg, mbConfirmation, MB_RETRYCANCEL) = idRetry;
  346. end;
  347. end;
  348. end;
  349. function NoOutlookRunning(): Boolean;
  350. var
  351.   closeit: String;
  352. begin
  353.     // Check if Outlook is running.
  354.     closeit:= 'You must close Outlook before ClamWin can be installed.' + #13 + #13 +
  355.               'Please close all Outlook Windows (using "File->Exit and Log off"' + #13 +
  356.               'if available) and click Retry, or click Cancel to exit the installation.'+ #13 + #13 +
  357.               'If this message persists after closing all Outlook windows, you may' + #13 +
  358.               'need to log off from Windows, and try again.'
  359.     Result := CheckNoAppMutex('_outlook_mutex_', closeit);
  360.     // Check if MAPISP32.EXE is running - if it is, it implies something is screwey
  361.     // with Outlook.
  362.     if Result then begin
  363.       closeit := 'The Outlook mail delivery agent is still running.' + #13 + #13 +
  364.                  'If you only recently closed Outlook, wait a few seconds and click Retry.' + #13 + #13 +
  365.                  'If this message persists, you may need to log off from Windows, and try again.'
  366.       Result := CheckNoAppMutex('InternetMailTransport', closeit);
  367.     end;
  368. end;
  369. function IsWin9x(): Boolean;
  370. begin
  371. Result := not UsingWinNT();
  372. end;
  373. function IsXPOrLater(): Boolean;
  374. begin
  375. Result:= (GetWindowsVersion() >= $05010000);
  376. end;
  377. function NotIsXPOrLater(): Boolean;
  378. begin
  379. Result := not IsXPOrLater();
  380. end;
  381. function IsAllUsers(): Boolean;
  382. begin
  383. if not UsingWinNT() then
  384. Result := True
  385. else
  386. Result := AllUsers;
  387. end;
  388. function NotIsAllUsers(): Boolean;
  389. begin
  390. Result := not IsAllUsers();
  391. end;
  392. procedure CloseClamWin();
  393. var
  394. path, keyname: String;
  395. resultcode: Integer;
  396. begin
  397. keyname := 'SOFTWAREClamWin';
  398. path := ''
  399. if not RegQueryStringValue(HKEY_CURRENT_USER, keyname, 'path',  path) then begin
  400. RegQueryStringValue(HKEY_LOCAL_MACHINE, keyname, 'path',  path)
  401. end;
  402. if path = '' then begin
  403. exit;
  404. end;
  405. if not CheckForMutexes('ClamWinTrayMutex01') then
  406.         exit;
  407. if SuppressibleMsgBox('The Setup detected previous version of the software is installed.' + #13 +
  408.  'Would you like to close the program now? (Recommended)',
  409.               mbConfirmation, MB_YESNO, IDYES) = idYes then begin
  410.     path := RemoveQuotes(path)+'WClose.exe';
  411. Exec(path, '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, resultcode);
  412. end;
  413. end;
  414. function InitializeSetup(): Boolean;
  415. var
  416. value: Cardinal;
  417. begin
  418. if (not UsingWinNT()) then
  419. AllUsers := True
  420. else
  421. AllUsers := IsAdminLoggedOn();
  422. ThisVersion := 881;
  423. value := 0;
  424. if not RegQueryDWordValue(HKEY_CURRENT_USER, 'SOFTWAREClamwin', 'Version',  value) then begin
  425. value := 0;
  426. RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWAREClamwin', 'Version',  value)
  427. end;
  428. PreviousVersion := value;
  429. if PreviousVersion > ThisVersion then begin
  430. SuppressibleMsgBox('Setup detected that newer version of the software is already installed.' + #13 +
  431.  'Setup will terminate now.', mbError, MB_OK, IDOK);
  432. Result := False;
  433. exit;
  434. end;
  435. SetupCompleted := False;
  436. Time := GetDateTimeString('hh:nn', #0, ':') + ':00';
  437. Result := NoOutlookRunning();
  438. if Result then CloseClamWin();
  439. end;
  440. procedure DeInitializeSetup();
  441. var
  442. filename: String;
  443. begin
  444. DeleteFile(ExpandConstant('{%TEMP|{localappdata}}clamwin-src.zip'));
  445. DeleteFile(ExpandConstant('{%TEMP|{localappdata}}clamav-src.tar.gz'));
  446. //DeleteFile(ExpandConstant('{%TEMP|{localappdata}}cygwin-src.tar.bz2'));
  447. if (SetupCompleted) and (PreviousVersion < 35) then begin
  448. filename := ExpandConstant('{app}binTray.exe');
  449. if (FileExists(filename)) then begin
  450. DeleteFile(filename);
  451. end;
  452. filename := ExpandConstant('{app}binOutlookAddin.exe');
  453. if (FileExists(filename)) then begin
  454. DeleteFile(filename);
  455. end;
  456. filename := ExpandConstant('{app}binExplorerShell.dll');
  457. if (FileExists(filename)) then begin
  458. RestartReplace(filename, '');
  459. SuppressibleMsgBox('Please restart your computer in order to complete the installation of ClamWin Antivirus.',
  460. mbInformation, MB_OK, IDOK);
  461. end;
  462. end;
  463. end;
  464. //function NoCygwin(): Boolean;
  465. //begin
  466. // if not CygWinChecked then begin
  467. // CygwinFound := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARECygnus SolutionsCygwinmounts v2/');
  468. // CygwinChecked := True;
  469. // Result := not CygwinFound;
  470. // end
  471. // else begin
  472. // Result := not CygwinFound;
  473. // end
  474. //end;
  475. //function NoCygwinAllUsers(): Boolean;
  476. //begin
  477. // Result := NoCygWin() and IsAllUsers();
  478. //end;
  479. //function NoCygwinNotAllUsers(): Boolean;
  480. //begin
  481. // Result := NoCygWin() and not IsAllUsers();
  482. //end;
  483. function
  484. BaseDir(Default: String): String;
  485. begin
  486. if IsAllUsers() then begin
  487. Result := ExpandConstant('{pf}');
  488. end else begin
  489. Result := ExpandConstant('{userappdata}');
  490. end;
  491. end;
  492. function CurTime(Default: String): String;
  493. begin
  494. Result := Time;
  495. end;
  496. function TempDir(Default: String): String;
  497. begin
  498. Result := GetTempDir();
  499. end;
  500. function CommonProfileDir(Default: String): String;
  501. var
  502. AppData, Tmp: String;
  503. i, position: Integer;
  504. begin
  505. if IsAllUsers() then begin
  506. AppData := RemoveBackslash(ExpandConstant('{commonappdata}'));
  507. end else begin
  508. AppData := ExpandConstant('{userappdata}');
  509. end;
  510. // remove last directory from the path (Ususally Application Data)
  511. Tmp := AppData;
  512. While True do begin
  513. i := Pos('', Tmp);
  514. if i <> 0 then begin
  515. Tmp := Copy(Tmp, i + 1, Length(Tmp) - i);
  516. end else begin
  517. Break;
  518. end;
  519. end;
  520. position := Length(AppData) - Length(Tmp);
  521. if position > 0 then begin
  522. Result := RemoveBackslash(Copy(AppData, 0, position));
  523. end else begin
  524. Result := AppData;
  525. end;
  526. end;
  527. function DesktopDir(Default: String): String;
  528. begin
  529. if IsAllUsers() then begin
  530. Result := ExpandConstant('{commondesktop}');
  531. end else begin
  532. Result := ExpandConstant('{userdesktop}');
  533. end;
  534. end;
  535. function IsIniValueEmpty(Param : String): Boolean;
  536. var
  537. Section, Key, Filename, Val, TempStr, Default : String;
  538. EndPos: Integer;
  539. begin
  540. Default := '';
  541. TempStr := Param;
  542. EndPos := Pos('*', TempStr);
  543. Section := Copy(TempStr, 0, EndPos - 1);
  544. TempStr := Copy(TempStr, EndPos + 1, Length(TempStr) - EndPos)
  545. EndPos := Pos('*', TempStr);
  546. Key := Copy(TempStr, 0, EndPos - 1);
  547. TempStr := Copy(TempStr, EndPos + 1, Length(TempStr) - EndPos)
  548. Filename := TempStr;
  549. Val:= Trim(GetIniString(Section, Key, Default, Filename));
  550. Result := (Val = '')
  551. end;
  552. function IsTemplateConfig(Filename: String): Boolean;
  553. begin
  554. Result := (not IsWin9x()) and (not FileExists(Filename));
  555. end;