Explorar o código

[add] windows installer

robert2206 %!s(int64=7) %!d(string=hai) anos
pai
achega
e1d43517b0

+ 16 - 0
windows-installer/printers-tray.bat

@@ -0,0 +1,16 @@
+@ECHO off
+SETLOCAL EnableDelayedExpansion
+
+IF EXIST "%TEMP%\printers_tray.tmp" (
+	EXIT /B 1
+)
+
+COPY NULL "%TEMP%\printers_tray.tmp"
+
+rem load all jar libs
+FOR /R %%i IN (*.jar) DO (
+	SET CP=!CP!;"%%i"
+)
+
+rem execute main jar
+START /B javaw -cp %CP% org.robert.printer.App

BIN=BIN
windows-installer/printers-tray.ico


+ 59 - 0
windows-installer/printers-tray.iss

@@ -0,0 +1,59 @@
+#define MyAppName "Printers Tray"
+#define MyAppVersion "0.0.1"
+#define MyAppPublisher "Eiru Software"
+#define MyAppURL "http://www.eiru.com.py/"
+#define MyAppExeName "printers-tray.bat"
+
+[Setup]
+AppId={{3E5917E1-53C8-4930-A5BD-ADA89B7841F9}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DefaultGroupName={#MyAppName}
+OutputDir=C:\Users\Robert\Documents\printers-tray
+OutputBaseFilename=printers-tray
+Compression=lzma
+SolidCompression=yes
+ArchitecturesInstallIn64BitMode=x64
+PrivilegesRequired=admin
+RestartApplications=yes
+AlwaysRestart=yes
+
+[Languages]
+Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
+
+[Files]
+Source: "C:\Users\Robert\Documents\printers-tray\printers-tray*.jar"; DestDir: "{app}"; Flags: ignoreversion
+Source: "C:\Users\Robert\Documents\printers-tray\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "C:\Users\Robert\Documents\printers-tray\printers-tray.bat"; DestDir: "{app}"; Flags: ignoreversion 
+Source: "C:\Users\Robert\Documents\printers-tray\printers-tray.ico"; DestDir: "{app}"; Flags: ignoreversion
+
+[Icons]
+Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\printers-tray.bat"; IconFilename: "{app}\printers-tray.ico"
+
+[Code]
+const
+	REQUIRED_JAVA_VERSION = '1.8';
+function InitializeSetup(): Boolean;
+var
+	JavaVersion: String;
+	ErrorCode: Integer;
+begin
+	if RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', JavaVersion) then
+	begin
+		Result := CompareStr(JavaVersion, REQUIRED_JAVA_VERSION) >= 0;
+	end;
+
+	if Result = False then
+	begin
+		if MsgBox('Este programa requiere Java 1.8 o superior. Desea descargarlo ahora?', mbConfirmation, MB_YESNO) = IDYES then
+		begin
+			ShellExec('open', 'https://java.com/download', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
+		end;
+	end;
+end;