Skip to content

Commit

Permalink
Merge pull request #519 from GeoDaCenter/1.8.12patch
Browse files Browse the repository at this point in the history
1.8.12patch
  • Loading branch information
lixun910 committed Nov 8, 2016
2 parents 5759306 + 432507f commit fcad9c6
Show file tree
Hide file tree
Showing 13 changed files with 310 additions and 163 deletions.
Binary file added BuildTools/CommonDistFiles/GeoDa.ico
Binary file not shown.
55 changes: 51 additions & 4 deletions BuildTools/windows/installer/32bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ OutputBaseFilename=geoda_setup
ChangesAssociations=yes

[dirs]
Name: "{app}"; Permissions: everyone-full; Check: InitializeSetup
Name: "{app}\basemap_cache"; Permissions: everyone-full
Name: "{app}"; Permissions: everyone-full
Name: "{app}\Examples"; Permissions: everyone-full

[Files]
Source: "..\..\Release\GeoDa.exe"; DestDir: "{app}"; DestName: "GeoDa.exe"
Source: "..\..\..\CommonDistFiles\GeoDa.ico"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\copyright.txt"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\GPLv3.txt"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\cache.sqlite"; DestDir: "{app}"
Expand All @@ -37,6 +39,7 @@ Source: "vcredist_x86.exe"; DestDir: "{app}"
Source: "ogr_FileGDB.dll"; DestDir: "{app}"
Source: "ogr_OCI.dll"; DestDir: "{app}"
Source: "ogr_SDE.dll"; DestDir: "{app}"
Source: "..\..\run_geoda.bat"; DestDir: "{app}"
Source: "..\..\Release\sqlite.dll"; DestDir: "{app}"
Source: "..\..\temp\curl-7.30.0\builds\curlib\bin\libcurl.dll"; DestDir: "{app}"
Source: "..\..\temp\expat-2.1.0\build\Release\expat.dll"; DestDir: "{app}"
Expand All @@ -55,7 +58,7 @@ Source: "..\..\temp\boost_1_57_0\stage\lib\boost_chrono-vc100-mt-1_57.dll"; Dest
Source: "..\..\temp\boost_1_57_0\stage\lib\boost_thread-vc100-mt-1_57.dll"; DestDir: "{app}"
Source: "..\..\temp\boost_1_57_0\stage\lib\boost_system-vc100-mt-1_57.dll"; DestDir: "{app}"

Source: "..\..\..\..\SampleData\Examples\*"; DestDir: "{userdocs}\Examples"; Flags: recursesubdirs uninsneveruninstall
Source: "..\..\..\..\SampleData\Examples\*"; DestDir: "{app}\Examples"; Flags: recursesubdirs uninsneveruninstall


Source: "..\..\temp\gdal\data\*"; DestDir: "{app}\data"; Flags: recursesubdirs
Expand All @@ -64,15 +67,18 @@ Source: "..\..\temp\gdal\data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

[Icons]
Name: "{group}\GeoDa"; Filename: "{app}\GeoDa.exe"
;Name: "{group}\GeoDa"; Filename: "{app}\run_geoda.bat"; IconFilename: "{app}\GeoDa.ico"
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GeoDa"; Filename: "{app}\GeoDa.exe"
;Name: "{commondesktop}\GeoDa"; Filename: "{app}\run_geoda.bat"; IconFilename: "{app}\GeoDa.ico"


[Registry]
; set PATH
; set GEODA_GDAL_DATA
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_GDAL_DATA"; ValueData:"{pf}\GeoDa Software\data"; Flags: preservestringtype uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_GDAL_DATA"; ValueData:"{app}\data"; Flags: preservestringtype uninsdeletevalue
; set GEODA_OGR_DRIVER_PATH
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_OGR_DRIVER_PATH"; ValueData:"{pf}\GeoDa Software"; Flags: preservestringtype uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_OGR_DRIVER_PATH"; ValueData:"{app}"; Flags: preservestringtype uninsdeletevalue

Root: HKCR; Subkey: ".gda"; ValueType: string; ValueName: ""; ValueData: "GeoDaProjectFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "GeoDaProjectFile"; ValueType: string; ValueName: ""; ValueData: "GeoDa Project File"; Flags: uninsdeletekey
Expand Down Expand Up @@ -109,5 +115,46 @@ begin
Result := not RegKeyExists(HKLM,'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}');
end;
function GetUninstallString: string;
var
sUnInstPath: string;
sUnInstallString: String;
begin
Result := '';
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\GeoDa_is1'); //Your App GUID/ID
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
function IsUpgrade: Boolean;
begin
Result := (GetUninstallString() <> '');
end;
function InitializeSetup: Boolean;
var
V: Integer;
iResultCode: Integer;
sUnInstallString: string;
begin
Result := True; // in case when no previous version is found
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\GeoDa_is1', 'UninstallString') then //Your App GUID/ID
begin
V := MsgBox(ExpandConstant('An old version of GeoDa was detected. Please uninstall it before continuing.'), mbInformation, MB_YESNO); //Custom Message if App installed
if V = IDYES then
begin
sUnInstallString := GetUninstallString();
sUnInstallString := RemoveQuotes(sUnInstallString);
Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);
Result := True; //if you want to proceed after uninstall
//Exit; //if you want to quit after uninstall
end
else
Result := False; //when older version present and not uninstalled
end;
end;
[Run]
Filename: {app}\vcredist_x86.exe; StatusMsg: Installing Visual Studio 2010 SP1 C++ CRT Libraries...; Check: VCRedistNeedsInstall
59 changes: 53 additions & 6 deletions BuildTools/windows/installer/64bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=yes

[dirs]
Name: "{app}"; Permissions: everyone-full; Check: InitializeSetup
Name: "{app}\Examples"; Permissions: everyone-full
Name: "{app}\basemap_cache"; Permissions: everyone-full
Name: "{app}"; Permissions: everyone-full



[Files]
Source: "..\..\Release\GeoDa.exe"; DestDir: "{app}"; DestName: "GeoDa.exe"; Check: IsX64
Source: "..\..\..\CommonDistFiles\GeoDa.ico"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\copyright.txt"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\GPLv3.txt"; DestDir: "{app}"
Source: "..\..\..\CommonDistFiles\cache.sqlite"; DestDir: "{app}"
Expand All @@ -50,6 +53,7 @@ Source: "vcredist_x64.exe"; DestDir: "{app}"
Source: "ogr_FileGDB.dll"; DestDir: "{app}"
Source: "ogr_OCI.dll"; DestDir: "{app}"
Source: "ogr_SDE.dll"; DestDir: "{app}"
Source: "..\..\run_geoda.bat"; DestDir: "{app}"
Source: "..\..\Release\sqlite.dll"; DestDir: "{app}"
Source: "..\..\temp\curl-7.46.0\builds\curlib\bin\libcurl.dll"; DestDir: "{app}"
Source: "..\..\temp\expat-2.1.0\build\Release\expat.dll"; DestDir: "{app}"
Expand All @@ -68,24 +72,25 @@ Source: "..\..\temp\boost_1_57_0\stage\lib\boost_chrono-vc100-mt-1_57.dll"; Dest
Source: "..\..\temp\boost_1_57_0\stage\lib\boost_thread-vc100-mt-1_57.dll"; DestDir: "{app}"
Source: "..\..\temp\boost_1_57_0\stage\lib\boost_system-vc100-mt-1_57.dll"; DestDir: "{app}"

Source: "..\..\..\..\SampleData\Examples\*"; DestDir: "{userdocs}\Examples"; Flags: recursesubdirs uninsneveruninstall


Source: "..\..\..\..\SampleData\Examples\*"; DestDir: "{app}\Examples"; Flags: recursesubdirs
Source: "..\..\temp\gdal\data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\GeoDa"; Filename: "{app}\GeoDa.exe"
;Name: "{group}\GeoDa"; Filename: "{app}\run_geoda.bat"; IconFilename: "{app}\GeoDa.ico"
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GeoDa"; Filename: "{app}\GeoDa.exe"
;Name: "{commondesktop}\GeoDa"; Filename: "{app}\run_geoda.bat"; IconFilename: "{app}\GeoDa.ico"


[Registry]
; set PATH
; set GEODA_GDAL_DATA
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_GDAL_DATA"; ValueData:"{pf}\GeoDa Software\data"; Flags: preservestringtype uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_GDAL_DATA"; ValueData:"{app}\data"; Flags: preservestringtype uninsdeletevalue
; set GEODA_OGR_DRIVER_PATH
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_OGR_DRIVER_PATH"; ValueData:"{pf}\GeoDa Software"; Flags: preservestringtype uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"GEODA_OGR_DRIVER_PATH"; ValueData:"{app}"; Flags: preservestringtype uninsdeletevalue

Root: HKCR; Subkey: ".gda"; ValueType: string; ValueName: ""; ValueData: "GeoDaProjectFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "GeoDaProjectFile"; ValueType: string; ValueName: ""; ValueData: "GeoDa Project File"; Flags: uninsdeletekey
Expand Down Expand Up @@ -124,5 +129,47 @@ begin
Result := not RegKeyExists(HKLM,'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}');
end;
function GetUninstallString: string;
var
sUnInstPath: string;
sUnInstallString: String;
begin
Result := '';
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\GeoDa_is1'); //Your App GUID/ID
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
function IsUpgrade: Boolean;
begin
Result := (GetUninstallString() <> '');
end;
function InitializeSetup: Boolean;
var
V: Integer;
iResultCode: Integer;
sUnInstallString: string;
begin
Result := True; // in case when no previous version is found
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\GeoDa_is1', 'UninstallString') then //Your App GUID/ID
begin
V := MsgBox(ExpandConstant('An old version of GeoDa was detected. Please uninstall it before continuing.'), mbInformation, MB_YESNO); //Custom Message if App installed
if V = IDYES then
begin
sUnInstallString := GetUninstallString();
sUnInstallString := RemoveQuotes(sUnInstallString);
Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);
Result := True; //if you want to proceed after uninstall
//Exit; //if you want to quit after uninstall
end
else
Result := False; //when older version present and not uninstalled
end;
end;
[Run]
Filename: {app}\vcredist_x64.exe; StatusMsg: Installing Visual Studio 2010 SP1 C++ CRT Libraries...; Check: VCRedistNeedsInstall

10 changes: 10 additions & 0 deletions BuildTools/windows/run_geoda.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo OFF
SET geodapath=%cd%
SET GEODA_GDAL_DATA="%geodapath%\data"
SET GEODA_OGR_DRIVER_PATH="%geodapath%"

@echo %geodapath%
@echo %GEODA_GDAL_DATA%
@echo %GEODA_GDAL_DRIVER_PATH%

start GeoDa.exe
3 changes: 2 additions & 1 deletion DialogTools/CreatingWeightDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void CreatingWeightDlg::OnCreateClick( wxCommandEvent& event )
wmi.SetToThres(id, dist_metric, dist_units, dist_units_str,dist_values, t_val, dist_var_1, dist_tm_1, dist_var_2, dist_tm_2);

if (m_is_arc && m_arc_in_km) {
t_val /= GenGeomAlgs::one_mi_in_km; // convert km to mi
//t_val /= GenGeomAlgs::one_mi_in_km; // convert km to mi
}

if (t_val > 0) {
Expand Down Expand Up @@ -1219,6 +1219,7 @@ bool CreatingWeightDlg::WriteWeightFile(GalElement *gal, GwtElement *gwt,
}
//GdaFrame::GetGdaFrame()->ShowConnectivityMapView(uid);
}
delete w;
} else {
success = false;
}
Expand Down
8 changes: 6 additions & 2 deletions Explore/Basemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,11 @@ bool Basemap::Draw(wxBitmap* buffer)
{
// when tiles pngs are ready, draw them on a buffer
wxMemoryDC dc(*buffer);
dc.SetBackground( *wxTRANSPARENT_BRUSH );
dc.Clear();
wxGraphicsContext* gc = wxGraphicsContext::Create(dc);
if (!gc)
return false;

int x0 = startX;
int x1 = endX;
Expand Down Expand Up @@ -683,11 +687,11 @@ bool Basemap::Draw(wxBitmap* buffer)
bmp.LoadFile(wxFilePath, wxBITMAP_TYPE_JPEG);
}
bool bmpOK = bmp.IsOk();
if (bmpOK) dc.DrawBitmap(bmp, pos_x, pos_y, true);
if (bmpOK) gc->DrawBitmap(bmp, pos_x, pos_y, 256,256);
//dc.DrawRectangle((i-startX) * 256 - offsetX, (j-startY) * 256 - offsetY, 256, 256);
}
}

delete gc;
isTileDrawn = true;
return isTileReady;
}
Loading

0 comments on commit fcad9c6

Please sign in to comment.