Skip to content

Commit

Permalink
Merge branch 'master' into dao-fix-vote-reveal-tx-publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Jan 5, 2019
2 parents 2f9125a + f12ff5c commit 4d8a348
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 48 deletions.
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ configure(subprojects) {
joptVersion = '5.0.3'
langVersion = '3.4'
libdohjVersion = '7be803fa'
bitcoinjVersion = 'cd30ad5b'
logbackVersion = '1.1.10'
lombokVersion = '1.18.2'
mockitoVersion = '2.21.0'
Expand Down Expand Up @@ -133,6 +134,10 @@ configure(project(':assets')) {
dependencies {
compile("network.bisq.libdohj:libdohj-core:$libdohjVersion") {
exclude(module: 'protobuf-java')
exclude(module: 'bitcoinj-core')
}
compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") {
exclude(module: 'protobuf-java')
}
compile "commons-codec:commons-codec:$codecVersion"
compile "org.apache.commons:commons-lang3:$langVersion"
Expand Down Expand Up @@ -170,6 +175,11 @@ configure(project(':common')) {
exclude(module: 'guava')
}
compile("network.bisq.libdohj:libdohj-core:$libdohjVersion") {
exclude(module: 'slf4j-api')
exclude(module: 'protobuf-java')
exclude(module: 'bitcoinj-core')
}
compile("com.github.bisq-network.bitcoinj:bitcoinj-core:$bitcoinjVersion") {
exclude(module: 'jsr305')
exclude(module: 'slf4j-api')
exclude(module: 'guava')
Expand Down Expand Up @@ -354,7 +364,6 @@ configure(project(':pricenode')) {

dependencies {
compile project(":core")
compile project(":assets")
compile("org.knowm.xchange:xchange-bitcoinaverage:4.3.3")
compile("org.knowm.xchange:xchange-coinmarketcap:4.3.3")
compile("org.knowm.xchange:xchange-poloniex:4.3.3")
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/offer/Offer.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@
@Slf4j
public class Offer implements NetworkPayload, PersistablePayload {

// We allow max. 0.5 % difference between own offerPayload price calculation and takers calculation.
// We allow max. 1 % difference between own offerPayload price calculation and takers calculation.
// Market price might be different at maker's and takers side so we need a bit of tolerance.
// The tolerance will get smaller once we have multiple price feeds avoiding fast price fluctuations
// from one provider.
final static double PRICE_TOLERANCE = 0.005;
final static double PRICE_TOLERANCE = 0.01;

///////////////////////////////////////////////////////////////////////////////////////////
// Enums
Expand Down
Binary file added desktop/package/windows/Bisq-setup-image.bmp
Binary file not shown.
116 changes: 76 additions & 40 deletions desktop/package/windows/Bisq.iss
Original file line number Diff line number Diff line change
@@ -1,70 +1,73 @@
;This file will be executed next to the application bundle image
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bisq with application files
[Setup]
;Note: This file must use UTF-8 encoding with BOM

#define SourceDir GetEnv('package_dir') + '\windows'

[Setup]
AppId={{bisq}}
AppName=Bisq
AppVersion=0.9.1
AppVerName=Bisq
AppPublisher=Bisq
AppComments=Bisq
AppCopyright=Copyright (C) 2018
AppComments={cm:AppComments}
AppPublisherURL=https://bisq.network
AppSupportURL=https://bisq.network
;AppUpdatesURL=http://java.com/
DefaultDirName={localappdata}\Bisq
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableReadyPage=No
DisableFinishedPage=No
DisableWelcomePage=Yes
DefaultGroupName=Bisq
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Bisq
;Windows 7 with Service Pack 1 or above
MinVersion=0,6.1.7601
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=Bisq\Bisq.ico
UninstallDisplayIcon={app}\Bisq.ico
UninstallDisplayName=Bisq
WizardImageFile={#SourceDir}\Bisq-setup-image.bmp
WizardImageStretch=No
WizardSmallImageFile=Bisq-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=Yes
ShowLanguageDialog=No

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: en; MessagesFile: "compiler:Default.isl"
Name: de; MessagesFile: "compiler:Languages\German.isl"
Name: fr; MessagesFile: "compiler:Languages\French.isl"
Name: sp; MessagesFile: "compiler:Languages\Spanish.isl"

[CustomMessages]
en.AppComments=The decentralized exchange network
en.AppIsRunning=Bisq is running, please close it and run setup again.
de.AppComments=Das dezentrale Austauschnetzwerk
de.AppIsRunning=Bisq läuft, bitte schließen Sie es und führen Sie das Setup erneut aus.
fr.AppComments=Le réseau d'échange décentralisé
fr.AppIsRunning=Bisq est en cours d'exécution, fermez-le et exécutez à nouveau le programme d'installation.
sp.AppComments=La red de intercambio descentralizado
sp.AppIsRunning=Bisq se está ejecutando, ciérrelo y vuelva a ejecutar la configuración.
[Files]
Source: "Bisq\Bisq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bisq\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"; Check: returnTrue()
Name: "{commondesktop}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"; Check: returnFalse()
Name: "{group}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"
Name: "{userdesktop}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"
[Run]
Filename: "{app}\Bisq.exe"; Description: "{cm:LaunchProgram,Bisq}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Bisq.exe"; Parameters: "-install -svcName ""Bisq"" -svcDesc ""Bisq"" -mainExe ""Bisq.exe"" "; Check: returnFalse()

[UninstallRun]
Filename: "{app}\Bisq.exe "; Parameters: "-uninstall -svcName Bisq -stopOnUninstall"; Check: returnFalse()
Filename: "{app}\Bisq.exe"; Description: "{cm:LaunchProgram,Bisq}"; Flags: nowait postinstall skipifsilent
[Code]
function returnTrue(): Boolean;
begin
Result := True;
end;
function returnFalse(): Boolean;
begin
Result := False;
end;
procedure DirectoryCopy(SourcePath, DestPath: string);
var
FindRec: TFindRec;
Expand Down Expand Up @@ -122,7 +125,7 @@ begin
entry := ExpandConstant('{localappdata}') + '\Bisq\';
if DirExists(entry) then begin
DelTree(entry, true, true, true);
end
end;
end;
procedure DeleteTorFiles;
Expand All @@ -137,15 +140,15 @@ begin
hiddenServiceDir := mainnetDir + '\tor\hiddenservice';
hiddenServiceBackupDir := mainnetDir + '\hiddenservice_backup';
if DirExists(hiddenServiceDir) then begin
if DirExists(hiddenServiceBackupDir) then begin
DelTree(hiddenServiceBackupDir, true, true, true);
end
CreateDir(hiddenServiceBackupDir);
DirectoryCopy(hiddenServiceDir, hiddenServiceBackupDir);
DelTree(torDir, false, true, true);
CreateDir(hiddenServiceDir);
DirectoryCopy(hiddenServiceBackupDir, hiddenServiceDir);
end
if DirExists(hiddenServiceBackupDir) then begin
DelTree(hiddenServiceBackupDir, true, true, true);
end;
CreateDir(hiddenServiceBackupDir);
DirectoryCopy(hiddenServiceDir, hiddenServiceBackupDir);
DelTree(torDir, false, true, true);
CreateDir(hiddenServiceDir);
DirectoryCopy(hiddenServiceBackupDir, hiddenServiceDir);
end;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
Expand All @@ -155,11 +158,44 @@ begin
Result := '';
end;
function IsAppRunning(): Boolean;
var
FSWbemLocator : Variant;
FWMIService : Variant;
FWbemObjectSet : Variant;
ExecutablePath : String;
begin
Result := False;
ExecutablePath := Format('%s\Bisq\Bisq.exe', [ExpandConstant('{localappdata}')])
StringChangeEx(ExecutablePath, '\', '\\', True);
try
FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2', '', '');
FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where ExecutablePath="%s"', [ExecutablePath]));
Result := (FWbemObjectSet.Count > 0);
FWbemObjectSet := Unassigned;
FWMIService := Unassigned;
FSWbemLocator := Unassigned;
except
end;
end;
function InitializeSetup(): Boolean;
begin
// Possible future improvements:
// if version less or same => just launch app
// if upgrade => check if same app is running and wait for it to exit
// Add pack200/unpack200 support?
Result := True;
if IsAppRunning() then
begin
MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
Result := False;
end;
end;
function InitializeUninstall(): Boolean;
begin
Result := True;
if IsAppRunning() then
begin
MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
Result := False;
end;
end;
13 changes: 8 additions & 5 deletions scripts/install_java.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ if exist "%PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%" (

echo Downloading required files to %TEMP%
powershell -Command "Invoke-WebRequest %jdk_url% -OutFile $env:temp\%jdk_filename%.tar.gz"
:: Download 7zip (command line version) in order to extract the tar.gz file since there is no native support in Windows
powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"
if not exist "%TEMP%\7za920\7za.exe" (
:: Download 7zip ^(command line version^) in order to extract the tar.gz file since there is no native support in Windows
powershell -Command "Invoke-WebRequest https://www.7-zip.org/a/7za920.zip -OutFile $env:temp\7za920.zip"
powershell -Command "Expand-Archive $env:temp\7za920.zip -DestinationPath $env:temp\7za920 -Force"
)

echo Extracting and installing JDK to %PROGRAMFILES%\Java\openjdk\jdk-%jdk_version%
"%TEMP%\7za920\7za.exe" x "%TEMP%\%jdk_filename%.tar.gz" -o"%TEMP%" -r -y
Expand All @@ -41,8 +43,9 @@ md "%PROGRAMFILES%\Java\openjdk"
move "%TEMP%\openjdk-%jdk_version%\jdk-%jdk_version%" "%PROGRAMFILES%\Java\openjdk"

echo Removing downloaded files
rmdir /S /Q %TEMP%\7za920
del /Q %TEMP%\7za920.zip
if exist "%TEMP%\7za920.zip" (
del /Q %TEMP%\7za920.zip
)
rmdir /S /Q %TEMP%\openjdk-%jdk_version%
del /Q %TEMP%\%jdk_filename%.tar
del /Q %TEMP%\%jdk_filename%.tar.gz
Expand Down

0 comments on commit 4d8a348

Please sign in to comment.