Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Karasiq committed Apr 23, 2015
1 parent 5eff2be commit beb35d2
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "proxychain"

organization := "com.karasiq"

version := "1.2"
version := "1.3"

scalaVersion := "2.11.6"

Expand Down
Binary file added setup/icon.ico
Binary file not shown.
83 changes: 83 additions & 0 deletions setup/setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#define OutputName "proxychain"
#define MyAppName "Proxychain"
#define MyAppVersion "1.3"
#define MyAppPublisher "Karasiq, Inc."
#define MyAppURL "http://www.github.com/Karasiq"
#define MyAppExeName "bin\proxychain.bat"
#define ProjectFolder "..\"

[Setup]
AppId={{21ce352a-e9cc-11e4-b02c-1681e6b88ec1}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir={#ProjectFolder}\target\iss
OutputBaseFilename={#OutputName}-{#MyAppVersion}
SetupIconFile={#ProjectFolder}\setup\icon.ico
Compression=lzma
SolidCompression=true
PrivilegesRequired=admin

[Languages]
Name: english; MessagesFile: compiler:Default.isl
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Languages:

[Files]
Source: {#ProjectFolder}\target\universal\stage\*; DestDir: {app}; Flags: ignoreversion recursesubdirs
Source: {#ProjectFolder}\setup\icon.ico; DestDir: {app}

[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\icon.ico; WorkingDir: {app}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; IconFilename: {app}\icon.ico; WorkingDir: {app}

[Run]
Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}; Flags: shellexec postinstall skipifsilent; WorkingDir: {app}; Check: IsJREInstalled

[Code]
#define MinJRE "1.8"
#define WebJRE "https://www.java.com/ru/download/manual.jsp"
function IsJREInstalled: Boolean;
var
JREVersion: string;
begin
// read JRE version
Result := RegQueryStringValue(HKLM32, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
// if the previous reading failed and we're on 64-bit Windows, try to read
// the JRE version from WOW node
if not Result and IsWin64 then
Result := RegQueryStringValue(HKLM64, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', JREVersion);
// if the JRE version was read, check if it's at least the minimum one
if Result then
Result := CompareStr(JREVersion, '{#MinJRE}') >= 0;
end;
function InitializeSetup: Boolean;
var
ErrorCode: Integer;
begin
Result := True;
// check if JRE is installed; if not, then...
if not IsJREInstalled then
begin
// show a message box and let user to choose if they want to download JRE;
// if so, go to its download site and exit setup; continue otherwise
if MsgBox('Java is required. Do you want to download it now ?',
mbConfirmation, MB_YESNO) = IDYES then
begin
Result := False;
ShellExec('', '{#WebJRE}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;
end;

0 comments on commit beb35d2

Please sign in to comment.