Skip to content

Commit

Permalink
Fix win installer for multiusers (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Apr 11, 2022
1 parent 67df3a9 commit f0b09b8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions BuildTools/windows/installer/32bit/GeoDa-win7+.iss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Source: "..\..\libraries\bin\gdal\plugins-external\ogr_FileGDB.dll"; DestDir: "{
Source: "..\..\..\..\Algorithms\lisa_kernel.cl"; DestDir: "{app}"
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{userappdata}\GeoDa\lang"; Flags: recursesubdirs
Source: "..\..\..\..\internationalization\lang\config.ini"; DestDir: "{userappdata}\GeoDa\lang"
; Add lang data back to {app} so they can be copied to other new windows users
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
Source: "..\..\libraries\bin\gdal-data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
Expand Down
2 changes: 2 additions & 0 deletions BuildTools/windows/installer/32bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Source: "..\..\libraries\bin\gdal\plugins-optional\ogr_MSSQLSpatial.dll"; DestDi
Source: "..\..\libraries\bin\gdal\plugins-external\ogr_FileGDB.dll"; DestDir: "{app}"
Source: "..\..\..\..\Algorithms\lisa_kernel.cl"; DestDir: "{app}"
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
; Add lang data back to {app} so they can be copied to other new windows users
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
Source: "..\..\libraries\bin\gdal-data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
Expand Down
2 changes: 2 additions & 0 deletions BuildTools/windows/installer/64bit/GeoDa-win7+.iss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Source: "..\..\libraries\bin\gdal\plugins-external\ogr_FileGDB.dll"; DestDir: "{
Source: "..\..\..\..\Algorithms\lisa_kernel.cl"; DestDir: "{app}"
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{userappdata}\GeoDa\lang"; Flags: recursesubdirs
Source: "..\..\..\..\internationalization\lang\config.ini"; DestDir: "{userappdata}\GeoDa\lang"
; Add lang data back to {app} so they can be copied to other new windows users
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
Source: "..\..\libraries\bin\gdal-data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
Expand Down
2 changes: 2 additions & 0 deletions BuildTools/windows/installer/64bit/GeoDa.iss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Source: "..\..\libraries\bin\gdal\plugins-optional\ogr_MSSQLSpatial.dll"; DestDi
Source: "..\..\libraries\bin\gdal\plugins-external\ogr_FileGDB.dll"; DestDir: "{app}"
Source: "..\..\..\..\Algorithms\lisa_kernel.cl"; DestDir: "{app}"
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
; Add lang data back to {app} so they can be copied to other new windows users
Source: "..\..\..\..\internationalization\lang\*"; DestDir: "{app}\lang"; Flags: recursesubdirs
Source: "..\..\libraries\bin\gdal-data\*"; DestDir: "{app}\data"; Flags: recursesubdirs

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
Expand Down
2 changes: 1 addition & 1 deletion DialogTools/PreferenceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ void PreferenceDlg::OnChooseLanguage(wxCommandEvent& ev)
OGRDataAdapter::GetInstance().AddEntry("gda_ui_language", sel_str);

// also update the lang/config.ini content
wxString configPath = GenUtils::GetLangSearchPath() + wxFileName::GetPathSeparator() + "config.ini";
wxString configPath = GenUtils::GetLangConfigPath() + wxFileName::GetPathSeparator() + "config.ini";
wxConfigBase * config = new wxFileConfig("GeoDa", wxEmptyString, configPath);

if (lan_sel > 0) {
Expand Down
13 changes: 12 additions & 1 deletion GenUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@ wxString GenUtils::GetCachePath()
#endif
}

wxString GenUtils::GetLangSearchPath()
wxString GenUtils::GetLangConfigPath()
{
#ifdef __linux__
wxString search_path = GetExeDir() + wxFileName::GetPathSeparator() + "lang";
Expand All @@ -2485,3 +2485,14 @@ wxString GenUtils::GetLangSearchPath()

return search_path;
}

wxString GenUtils::GetLangSearchPath()
{
#ifdef __WXMAC__
wxString search_path = GetExeDir() + "/../Resources/lang";
#else
wxString search_path = GetExeDir() + wxFileName::GetPathSeparator() + "lang";
#endif

return search_path;
}
1 change: 1 addition & 0 deletions GenUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ namespace GenUtils {
wxString GetBasemapDir();
wxString GetCachePath();
wxString GetLangSearchPath();
wxString GetLangConfigPath();
wxString GetLoggerPath();

bool less_vectors(const vector<int>& a,const vector<int>& b);
Expand Down
3 changes: 1 addition & 2 deletions GeoDa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ bool GdaApp::OnInit(void)
// search_path is the ./lang directory
// config_path it the exe directory (every user will have a different config file?)
wxString search_path = GenUtils::GetLangSearchPath();

wxString config_path = GenUtils::GetLangConfigPath() + wxFileName::GetPathSeparator()+ "config.ini";
// load language from lang/config.ini if user specified any
wxString config_path = search_path + wxFileName::GetPathSeparator()+ "config.ini";
bool use_native_config = false;
m_TranslationHelper = new wxTranslationHelper(*this, search_path, use_native_config);
m_TranslationHelper->SetConfigPath(config_path);
Expand Down
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ namespace Gda {
const int version_major = 1;
const int version_minor = 20;
const int version_build = 0;
const int version_subbuild = 10;
const int version_subbuild = 12;
const int version_year = 2022;
const int version_month = 2;
const int version_day = 5;
const int version_month = 4;
const int version_day = 10;
const int version_night = 0;
const int version_type = 2; // 0: alpha, 1: beta, 2: release
}

0 comments on commit f0b09b8

Please sign in to comment.