diff --git a/MSI/ZRCola/Main/Makefile b/MSI/ZRCola/Main/Makefile index dbd85de..af3d8ad 100644 --- a/MSI/ZRCola/Main/Makefile +++ b/MSI/ZRCola/Main/Makefile @@ -56,6 +56,8 @@ Component Component compwxstd.mo.sl_SI {A5FEEA94-08CA-4E12-993F-A115601EF258} ZRCOLALOCSLSIDIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) filewxstd.mo.sl_SI compLocalizationRepositoryPath {0E96110A-C38D-4600-9AE2-B8B59AF53A00} ZRCOLALOCDIR $(MSIBUILD_COMPONENT_ATTRIB_REGISTRY) regLocalizationRepositoryPath compLanguage {B78359AC-9484-402C-8384-3A4595B39389} ZRCOLALOCDIR $(MSIBUILD_COMPONENT_ATTRIB_REGISTRY) regLanguage +compDatabasePath {DF3C720D-50BB-4377-9EE0-9AC21C02B9DD} ZRCOLADATADIR $(MSIBUILD_COMPONENT_ATTRIB_REGISTRY) regDatabasePath +compZRCola.zrcdb {0585A51F-1411-43A3-AC50-F04A253FDED4} ZRCOLADATADIR $(MSIBUILD_COMPONENT_ATTRIB_FILE) fileZRCola.zrcdb comp00_ZRCola_Re.ttf {B6CE8B39-11DC-4B59-B10C-3F0FFE8F81AF} FontsFolder 0 file00_ZRCola_Re.ttf comp00_ZRCola_It.ttf {10613965-2874-470D-9D5A-B7D535AA3317} FontsFolder 0 file00_ZRCola_It.ttf comp00_ZRCola_Bd.ttf {C036BE8D-6D2F-4DBF-99D6-F53702EAEBB6} FontsFolder 0 file00_ZRCola_Bd.ttf @@ -142,6 +144,7 @@ ZRCOLABINDIR ZRCOLADIR .:X64~1.REL|x64.Release !ENDIF ZRCOLALOCDIR ZRCOLADIR locale ZRCOLALOCSLSIDIR ZRCOLALOCDIR sl_SI +ZRCOLADATADIR ZRCOLADIR data < NUL + reg.exe add "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\data" $(REG_FLAGS) > NUL !IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" reg.exe add "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\locale" $(REG_FLAGS32) > NUL + reg.exe add "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" /t REG_SZ /d "$(MAKEDIR)\$(OUTPUT_DIR)\data" $(REG_FLAGS32) > NUL !ENDIF UnregisterSettings :: -reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" $(REG_FLAGS) > NUL + -reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" $(REG_FLAGS) > NUL !IF "$(PROCESSOR_ARCHITECTURE)" == "AMD64" -reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "LocalizationRepositoryPath" $(REG_FLAGS32) > NUL + -reg.exe delete "HKLM\Software\Amebis\ZRCola" /v "DatabasePath" $(REG_FLAGS32) > NUL !ENDIF InstallFonts :: \ diff --git a/ZRCola/MSIBuild/Makefile b/ZRCola/MSIBuild/Makefile index 2e36fe6..25edb1b 100644 --- a/ZRCola/MSIBuild/Makefile +++ b/ZRCola/MSIBuild/Makefile @@ -125,6 +125,8 @@ featZRCola compwxExtend.mo.sl_SI featZRCola compwxstd.mo.sl_SI featZRCola compLocalizationRepositoryPath featZRCola compLanguage +featZRCola compDatabasePath +featZRCola compZRCola.zrcdb featZRCola comp00_ZRCola_Re.ttf <argv[0])); - sPath << wxT("\\..\\data\\ZRCola.zrcdb"); // TODO: Make database file configurable - - std::fstream dat((LPCTSTR)sPath, std::ios_base::in | std::ios_base::binary); + std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabasePath(), std::ios_base::in | std::ios_base::binary); if (dat.good()) { if (stdex::idrec::find(dat, ZRCOLA_DB_ID, sizeof(ZRCola::recordid_t))) { ZRCola::recordsize_t size; diff --git a/ZRCola/zrcolakeyhndlr.cpp b/ZRCola/zrcolakeyhndlr.cpp index 8c92a01..dcafb8c 100644 --- a/ZRCola/zrcolakeyhndlr.cpp +++ b/ZRCola/zrcolakeyhndlr.cpp @@ -26,10 +26,7 @@ wxZRColaKeyHandler::wxZRColaKeyHandler() : wxEvtHandler() { - wxString sPath(wxPathOnly(wxTheApp->argv[0])); - sPath << wxT("\\..\\data\\ZRCola.zrcdb"); // TODO: Make database file configurable - - std::fstream dat((LPCTSTR)sPath, std::ios_base::in | std::ios_base::binary); + std::fstream dat((LPCTSTR)((ZRColaApp*)wxTheApp)->GetDatabasePath(), std::ios_base::in | std::ios_base::binary); if (dat.good()) { if (stdex::idrec::find(dat, ZRCOLA_DB_ID, sizeof(ZRCola::recordid_t))) { ZRCola::recordsize_t size;