PageRenderTime 53ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/package-files/windows/win32installer.iss

#
Unknown | 291 lines | 271 code | 20 blank | 0 comment | 0 complexity | c8a7698b67dbb63ae4d56aac75b970c0 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. ; Inno Setup installer script for jEdit
  2. ; Björn "Vampire" Kautler <Vampire@jEdit.org>
  3. ;
  4. [Setup]
  5. AppName=jEdit
  6. AppVerName=jEdit @jedit.version@
  7. AppPublisher=Slava Pestov and others
  8. AppPublisherURL=http://www.jEdit.org
  9. AppSupportURL=http://www.jEdit.org
  10. AppUpdatesURL=http://www.jEdit.org
  11. DefaultDirName={pf}\jEdit
  12. DefaultGroupName=jEdit
  13. AllowNoIcons=true
  14. LicenseFile=@dist.dir@\doc\COPYING.txt
  15. OutputDir=@dist.dir@
  16. OutputBaseFilename=@win.filename@
  17. SetupIconFile=@base.dir@\icons\jedit.ico
  18. Compression=lzma
  19. SolidCompression=true
  20. SourceDir=@dist.dir@
  21. VersionInfoVersion=@jedit.build.number@
  22. VersionInfoCompany=Slava Pestov and others
  23. VersionInfoDescription=Programmer's Text Editor
  24. VersionInfoTextVersion=@jedit.version@
  25. VersionInfoCopyright=Copyright Š 1998-@current.year@ Slava Pestov
  26. ShowLanguageDialog=yes
  27. AppCopyright=Copyright Š 1998-@current.year@ Slava Pestov
  28. ChangesAssociations=true
  29. TimeStampsInUTC=true
  30. FlatComponentsList=false
  31. ShowTasksTreeLines=true
  32. WindowShowCaption=false
  33. WindowResizable=false
  34. WindowVisible=true
  35. AppVersion=@jedit.version@
  36. AppID={{10B7DCF9-FD90-4063-82B7-91C174D47338}
  37. UninstallDisplayName=jEdit @jedit.version@
  38. AppContact=devel@jEdit.org
  39. AppReadmeFile={app}\doc\README.txt
  40. UninstallDisplayIcon={app}\jedit.ico
  41. ChangesEnvironment=true
  42. PrivilegesRequired=admin
  43. WizardImageFile=@base.dir@\icons\WindowsInstallerImage.bmp
  44. WizardSmallImageFile=@base.dir@\icons\WindowsInstallerSmallImage.bmp
  45. [Languages]
  46. Name: english; MessagesFile: compiler:Default.isl
  47. Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
  48. Name: catalan; MessagesFile: compiler:Languages\Catalan.isl
  49. Name: czech; MessagesFile: compiler:Languages\Czech.isl
  50. Name: danish; MessagesFile: compiler:Languages\Danish.isl
  51. Name: dutch; MessagesFile: compiler:Languages\Dutch.isl
  52. Name: finnish; MessagesFile: compiler:Languages\Finnish.isl
  53. Name: french; MessagesFile: compiler:Languages\French.isl
  54. Name: german; MessagesFile: compiler:Languages\German.isl
  55. Name: hungarian; MessagesFile: compiler:Languages\Hungarian.isl
  56. Name: italian; MessagesFile: compiler:Languages\Italian.isl
  57. Name: norwegian; MessagesFile: compiler:Languages\Norwegian.isl
  58. Name: polish; MessagesFile: compiler:Languages\Polish.isl
  59. Name: portuguese; MessagesFile: compiler:Languages\Portuguese.isl
  60. Name: russian; MessagesFile: compiler:Languages\Russian.isl
  61. Name: slovak; MessagesFile: compiler:Languages\Slovak.isl
  62. Name: slovenian; MessagesFile: compiler:Languages\Slovenian.isl
  63. [Tasks]
  64. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
  65. Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}
  66. Name: autostartserver; Description: Start jEdit Server automatically on system startup; GroupDescription: Autostart:; Languages: slovenian slovak russian portuguese polish norwegian italian hungarian french finnish dutch danish czech catalan brazilianportuguese english
  67. Name: autostartserver; Description: jEdit Server automatisch beim Hochfahren starten; GroupDescription: Autostart:; Languages: german
  68. [Files]
  69. Source: @jar.filename@; DestDir: {app}; Flags: ignoreversion sortfilesbyextension; Components: main
  70. Source: doc\*; DestDir: {app}\doc; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Excludes: api\*,README.txt; Components: main
  71. Source: doc\api\*; DestDir: {app}\doc\api; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: apidoc
  72. Source: jars\LatestVersion.jar; DestDir: {app}\jars; Flags: ignoreversion sortfilesbyextension; Components: main
  73. Source: jars\QuickNotepad.jar; DestDir: {app}\jars; Flags: ignoreversion sortfilesbyextension; Components: main
  74. Source: macros\*; DestDir: {app}\macros; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: macros
  75. Source: modes\*; DestDir: {app}\modes; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: main
  76. Source: properties\*; DestDir: {app}\properties; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: main
  77. Source: startup\*; DestDir: {app}\startup; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension; Components: main
  78. Source: @base.dir@\icons\jedit.ico; DestDir: {app}; Flags: ignoreversion sortfilesbyextension; Components: main
  79. Source: doc\README.txt; DestDir: {app}\doc; Flags: isreadme ignoreversion sortfilesbyextension; Components: main
  80. Source: classes\package-files\windows\jedit.bat; DestDir: {app}; Flags: ignoreversion sortfilesbyextension; AfterInstall: UpdateBatchfile; Components: batchfile
  81. Source: classes\package-files\windows\launchstub.exe; DestDir: {app}; Flags: ignoreversion sortfilesbyextension; Components: batchfile
  82. [INI]
  83. Filename: {app}\jEdit.url; Section: InternetShortcut; Key: URL; String: http://www.jEdit.org
  84. [Icons]
  85. Name: {group}\jEdit; Filename: {code:javaPath}; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: jEdit - Programmer's Text Editor; HotKey: ctrl+alt+j; IconIndex: 0; Parameters: "-jar ""{app}\@jar.filename@"" -reuseview"
  86. Name: {group}\{cm:ProgramOnTheWeb,jEdit}; Filename: {app}\jEdit.url; Comment: jEdit Website
  87. Name: {group}\Start jEdit Server; Filename: {code:javaPath}; Parameters: "-jar ""{app}\@jar.filename@"" -background -nogui"; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: Start jEdit Server; IconIndex: 0; Languages: slovenian slovak russian portuguese polish norwegian italian hungarian french finnish dutch danish czech catalan brazilianportuguese english
  88. Name: {group}\Quit jEdit Server; Filename: {code:javaPath}; Parameters: "-jar ""{app}\@jar.filename@"" -quit"; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: Quit jEdit Server; IconIndex: 0; Languages: slovenian slovak russian portuguese polish norwegian italian hungarian french finnish dutch danish czech catalan brazilianportuguese english
  89. Name: {group}\jEdit Server Starten; Filename: {code:javaPath}; Parameters: "-jar ""{app}\@jar.filename@"" -background -nogui"; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: jEdit Server Starten; IconIndex: 0; Languages: german
  90. Name: {group}\jEdit Server Beenden; Filename: {code:javaPath}; Parameters: "-jar ""{app}\@jar.filename@"" -quit"; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: jEdit Server Beenden; IconIndex: 0; Languages: german
  91. Name: {group}\{cm:UninstallProgram,jEdit}; Filename: {uninstallexe}; Comment: {cm:UninstallProgram,jEdit}
  92. Name: {userdesktop}\jEdit; Filename: {code:javaPath}; Tasks: desktopicon; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: jEdit - Programmer's Text Editor; IconIndex: 0; Parameters: "-jar ""{app}\@jar.filename@"""
  93. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\jEdit; Filename: {code:javaPath}; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\jedit.ico; Comment: jEdit - Programmer's Text Editor; IconIndex: 0; Parameters: "-jar ""{app}\@jar.filename@"""
  94. [Run]
  95. Filename: {code:javaPath}; Description: {cm:LaunchProgram,jEdit}; Flags: postinstall skipifsilent nowait; WorkingDir: {app}; Parameters: "-jar ""{app}\@jar.filename@"""
  96. [Components]
  97. Name: main; Description: jEdit - Programmer's Text Editor; Flags: fixed; Types: custom compact full
  98. Name: apidoc; Description: API Documentation (for macro and plugin development); Types: custom full
  99. Name: macros; Description: Default set of macros (highly recommended); Types: custom compact full
  100. Name: batchfile; Description: Batch file (for command-line usage); Types: custom compact full
  101. [Registry]
  102. Root: HKCR; Subkey: *\Shell; Flags: uninsdeletekeyifempty
  103. Root: HKCR; Subkey: *\Shell\Open with jEdit; Flags: uninsdeletekey; Languages: slovenian slovak russian portuguese polish norwegian italian hungarian french finnish dutch danish czech catalan brazilianportuguese english
  104. Root: HKCR; Subkey: *\Shell\Open with jEdit\Command; ValueType: string; ValueData: """{code:javaPath}"" -jar ""{app}\@jar.filename@"" -reuseview ""%1"""; Flags: uninsdeletekey; Languages: slovenian slovak russian portuguese polish norwegian italian hungarian french finnish dutch danish czech catalan brazilianportuguese english
  105. Root: HKCR; Subkey: *\Shell\Mit jEdit Öffnen; Flags: uninsdeletekey; Languages: german
  106. Root: HKCR; Subkey: *\Shell\Mit jEdit Öffnen\Command; ValueType: string; ValueData: """{code:javaPath}"" -jar ""{app}\@jar.filename@"" -reuseview ""%1"""; Flags: uninsdeletekey; Languages: german
  107. Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueData: """{code:javaPath}"" -jar ""{app}\@jar.filename@"" -background -nogui"; Tasks: autostartserver; ValueName: jEdit Server; Flags: uninsdeletevalue
  108. [UninstallDelete]
  109. Type: files; Name: {app}\jEdit.url
  110. [Code]
  111. var
  112. javawExePath: String;
  113. // looks for current JRE version, in Registry
  114. function getJREVersion: String;
  115. var
  116. jreVersion : String;
  117. begin
  118. jreVersion := '';
  119. RegQueryStringValue(HKLM,'SOFTWARE\JavaSoft\Java Runtime Environment','CurrentVersion',jreVersion);
  120. Result := jreVersion;
  121. end;
  122. // looks for current JDK version, in Registry
  123. function getJDKVersion: String;
  124. var
  125. jdkVersion : String;
  126. begin
  127. jdkVersion := '';
  128. RegQueryStringValue(HKLM,'SOFTWARE\JavaSoft\Java Development Kit', 'CurrentVersion', jdkVersion);
  129. Result := jdkVersion;
  130. end;
  131. // Finds path to "javaw.exe" by looking up JDK or JRE locations
  132. // in the registry. Ensures the file actually exists. If none
  133. // is found, an empty string is returned.
  134. function javaPath(Param: String): String;
  135. var
  136. javaVersion : String;
  137. javaHome : String;
  138. path : String;
  139. begin
  140. if Length(javawExePath) > 0 then begin
  141. Result := javawExePath;
  142. exit;
  143. end;
  144. // try to find JRE "javaw.exe"
  145. javaVersion := getJREVersion;
  146. if (Length(javaVersion) > 0) and (javaVersion >= '1.4') then begin
  147. RegQueryStringValue(HKLM,'SOFTWARE\JavaSoft\Java Runtime Environment\' + javaVersion,'JavaHome',javaHome);
  148. path := javaHome + '\bin\javaw.exe';
  149. if FileExists(path) then begin
  150. Log('(JRE) found javaw.exe: ' + path);
  151. javawExePath := path;
  152. Result := javawExePath;
  153. exit;
  154. end;
  155. end;
  156. // if we didn't find a JRE "javaw.exe", try for a JDK one
  157. Log('(JDK) JRE not found or too old, looking for JDK');
  158. javaVersion := getJDKVersion;
  159. if (Length(javaVersion) > 0) and (javaVersion >= '1.4') then begin
  160. RegQueryStringValue(HKLM,'SOFTWARE\JavaSoft\Java Development Kit\' + javaVersion,'JavaHome',javaHome);
  161. path := javaHome + '\bin\javaw.exe';
  162. if FileExists(path) then begin
  163. Log('(JDK) found javaw.exe: ' + path);
  164. javawExePath := path;
  165. Result := javawExePath;
  166. exit;
  167. end;
  168. end;
  169. // we didn't find a suitable "javaw.exe"
  170. Result := '';
  171. end;
  172. // updates the batch file for commandline usage
  173. // and includes its path in %PATH
  174. procedure UpdateBatchFile;
  175. var
  176. tmpS : String;
  177. tmpSA : Array Of String;
  178. i, pathLine : Integer;
  179. begin
  180. LoadStringFromFile(ExpandConstant('{app}\jedit.bat'),tmpS);
  181. StringChange(tmpS,'{jedit.jar}','{app}\@jar.filename@');
  182. SaveStringToFile(ExpandConstant('{app}\jedit.bat'),ExpandConstantEx(tmpS,'javaw.exe',javaPath('')),false);
  183. if UsingWinNT then begin
  184. tmpS := '';
  185. RegQueryStringValue(HKLM,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','Path',tmpS);
  186. if Pos(Uppercase(ExpandConstant('{app}')),Uppercase(tmpS)) = 0 then begin
  187. if not (Copy(tmpS,Length(tmpS),1) = ';') then begin
  188. tmpS := tmpS + ';';
  189. end;
  190. tmpS := tmpS + ExpandConstant('{app}');
  191. end;
  192. RegWriteStringValue(HKLM,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','Path',tmpS);
  193. end else begin
  194. LoadStringsFromFile(ExpandConstant('{sd}\AUTOEXEC.BAT'),tmpSA);
  195. pathLine := -1;
  196. for i := 0 to GetArrayLength(tmpSA) - 1 do begin
  197. tmpS := Trim(tmpSA[i]);
  198. if Uppercase(Copy(tmpS,1,5)) = 'PATH=' then begin
  199. pathLine := i;
  200. if not (Pos(Uppercase(ExpandConstant('{app}')),Uppercase(tmpS)) = 0) then begin
  201. exit;
  202. end;
  203. end;
  204. end;
  205. if pathLine = -1 then begin
  206. SetArrayLength(tmpSA,GetArrayLength(tmpSA) + 1);
  207. tmpSA[GetArrayLength(tmpSA) - 1] := 'PATH=' + ExpandConstant('{app}');
  208. end else begin
  209. tmpS := Trim(tmpSA[pathLine]);
  210. if not (Copy(tmpS,Length(tmpS),1) = ';') then begin
  211. tmpS := tmpS + ';';
  212. end;
  213. tmpSA[pathLine] := tmpS + ExpandConstant('{app}');
  214. end;
  215. SaveStringsToFile(ExpandConstant('{sd}\AUTOEXEC.BAT'),tmpSA,false);
  216. end;
  217. end;
  218. // Called on setup startup
  219. function InitializeSetup: Boolean;
  220. begin
  221. // check if java >= 1.4 is installed
  222. if Length(javaPath('')) > 0 then begin
  223. Result := true;
  224. end else begin
  225. MsgBox('Setup was unable to find an installed Java Runtime Environment or Java Development Kit of version 1.4, or higher.' + #13 +
  226. 'You must have installed at least JDK or JRE 1.4 to continue setup.' + #13 +
  227. 'Please install one from http://java.sun.com and restart setup.', mbInformation, MB_OK);
  228. Result := false;
  229. end;
  230. end;
  231. // Called on entering a new step while uninstalling
  232. procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  233. var
  234. tmpS : String;
  235. tmpSA : Array Of String;
  236. i, position : Integer;
  237. begin
  238. if CurUninstallStep = usPostUninstall then begin
  239. if UsingWinNT then begin
  240. tmpS := '';
  241. RegQueryStringValue(HKLM,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','Path',tmpS);
  242. position := Pos(Uppercase(ExpandConstant('{app}')),Uppercase(tmpS));
  243. if not (position = 0) then begin
  244. Delete(tmpS,position,Length(ExpandConstant('{app}')));
  245. if Copy(tmpS,position,1) = ';' then begin
  246. Delete(tmpS,position,1);
  247. end;
  248. end;
  249. RegWriteStringValue(HKLM,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','Path',tmpS);
  250. end else begin
  251. LoadStringsFromFile(ExpandConstant('{sd}\AUTOEXEC.BAT'),tmpSA);
  252. for i := 0 to GetArrayLength(tmpSA) - 1 do begin
  253. tmpS := Trim(tmpSA[i]);
  254. if Uppercase(Copy(tmpS,1,5)) = 'PATH=' then begin
  255. position := Pos(Uppercase(ExpandConstant('{app}')),Uppercase(tmpS));
  256. if not (position = 0) then begin
  257. Delete(tmpS,position,Length(ExpandConstant('{app}')));
  258. if Copy(tmpS,position,1) = ';' then begin
  259. Delete(tmpS,position,1);
  260. end;
  261. end;
  262. tmpSA[i] := tmpS;
  263. end;
  264. end;
  265. SaveStringsToFile(ExpandConstant('{sd}\AUTOEXEC.BAT'),tmpSA,false);
  266. end;
  267. end else if CurUninstallStep = usUninstall then begin
  268. // Delete Plugins that were downloaded to application directory
  269. DelTree(ExpandConstant('{app}\jars'),true,true,true);
  270. end;
  271. end;