Skip to content

Commit 07ebf63

Browse files
committed
wip
1 parent 2de4f31 commit 07ebf63

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

.github/workflows/appimage-build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,44 @@ jobs:
131131
cp BuildTools/ubuntu/build/GeoDa GeoDa.AppDir/usr/bin/
132132
chmod +x GeoDa.AppDir/usr/bin/GeoDa
133133
134+
# Bundle template cache.sqlite next to the executable for first-run copy
135+
if [ -f "BuildTools/CommonDistFiles/cache.sqlite" ]; then
136+
cp BuildTools/CommonDistFiles/cache.sqlite GeoDa.AppDir/usr/bin/cache.sqlite
137+
fi
138+
139+
# Bundle geoda_prefs files used by the application
140+
if [ -f "BuildTools/CommonDistFiles/geoda_prefs.sqlite" ]; then
141+
cp BuildTools/CommonDistFiles/geoda_prefs.sqlite GeoDa.AppDir/usr/bin/geoda_prefs.sqlite
142+
fi
143+
if [ -f "BuildTools/CommonDistFiles/geoda_prefs.json" ]; then
144+
cp BuildTools/CommonDistFiles/geoda_prefs.json GeoDa.AppDir/usr/bin/geoda_prefs.json
145+
fi
146+
147+
# Bundle web_plugins (contains samples.sqlite and sample assets)
148+
if [ -d "BuildTools/CommonDistFiles/web_plugins" ]; then
149+
mkdir -p GeoDa.AppDir/usr/bin/web_plugins
150+
cp -a BuildTools/CommonDistFiles/web_plugins/. GeoDa.AppDir/usr/bin/web_plugins/
151+
fi
152+
153+
# Bundle basemap_cache
154+
mkdir -p GeoDa.AppDir/usr/bin/basemap_cache
155+
156+
# Bundle Resources
157+
mkdir -p GeoDa.AppDir/usr/bin/Resources
158+
cp -a rc/*.xrc GeoDa.AppDir/usr/bin/Resources/
159+
160+
# Bundle internationalization
161+
mkdir -p GeoDa.AppDir/usr/bin/lang
162+
cp -rf internationalization/lang/* GeoDa.AppDir/usr/bin/lang/
163+
164+
# Bundle gdaldata
165+
mkdir -p GeoDa.AppDir/usr/bin/gdaldata
166+
cp -a /usr/share/gdal/* GeoDa.AppDir/usr/bin/gdaldata/
167+
168+
# Bundle proj
169+
mkdir -p GeoDa.AppDir/usr/bin/proj
170+
cp -a /usr/share/proj/* GeoDa.AppDir/usr/bin/proj/
171+
134172
# Copy existing desktop file and modify for AppImage
135173
cp BuildTools/ubuntu/package/usr/share/applications/GeoDa.desktop GeoDa.AppDir/usr/share/applications/geoda.desktop
136174

GenUtils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,9 @@ wxString GenUtils::GetCachePath()
24462446
wxString cachePath = geodaUserDir + wxFileName::GetPathSeparator() + "cache.sqlite";
24472447
if (wxFileExists(cachePath) == false) {
24482448
wxString origCachePath = GetExeDir() + "cache.sqlite";
2449-
wxCopyFile(origCachePath, cachePath);
2449+
if (wxFileExists(origCachePath)) {
2450+
wxCopyFile(origCachePath, cachePath);
2451+
}
24502452
}
24512453
return cachePath;
24522454
#elif __WXMAC__
@@ -2461,7 +2463,9 @@ wxString GenUtils::GetCachePath()
24612463
wxString cachePath = geodaUserDir + wxFileName::GetPathSeparator() + "cache.sqlite";
24622464
if (wxFileExists(cachePath) == false) {
24632465
wxString origCachePath = GetExeDir() + "cache.sqlite";
2464-
wxCopyFile(origCachePath, cachePath);
2466+
if (wxFileExists(origCachePath)) {
2467+
wxCopyFile(origCachePath, cachePath);
2468+
}
24652469
}
24662470
return cachePath;
24672471
#endif

0 commit comments

Comments
 (0)