Coming changes in trunk

Money Manager Ex Development related posts for both Android and Desktop

Moderator: Renato

Post Reply
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Coming changes in trunk

Post by Vadim »

Hi everyone,
It is time for next portion of changes in sources :-)

First of all I don't like mmex\runtime directory. So, its content will be moved to anothers directories and mmex\runtime will be deleted. I have already moved mmex\runtime\en to mmex\i18n. The same very soon will happen with remaining files. All .txt files go to docs or may be another dir, graphics files to mmex\graphics. I will change InnoSetup script to get these files from its new locations. Mac developers should change theirs scripts accordingly.

The mmex\runtime is obsolete because we have InnoSetup script which can get files from any location and because build scripts now have install\uninstall targets. So, you can do
make
make install
and get cogerent mmex's folder. The mmex\build\msw\config.* scripts have new option "prefix" which default is C:\opt. So, mmex will be installed to C:\opt\mmex. If you type "make install PREFIX=D:\some_folder", the mmex will be installed to D:\some_folder\mmex.


The " make install" supports even on Windows. If you want to debug mmex, you can "make install" once and run mmex from installation dir. Or you can build and run setup and later just copy new executable to this folder before new debug session.
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

But the most important coming thing is change of structure of directories in mmex's installation folder.

I want these folders on Windows:
C:\Program Files\MoneyManagerEx <-- installation dir
bin\mmex.exe, *.dll <-- executable and VC++ or MinGW runtime dll-s will be here
help\ <-- all html help files (no changes here)
resources\ <-- here can be icons and others graphics files
the rest of files (*.txt) can be in root of dir or in the docs\ folder.
mmexini.db3 <-- will be in %APPDATA%\MoneyManagerEx
user's database <-- default will be in %APPDATA%\MoneyManagerEx

On Linux files go to completely different directories.
/usr/bin/mmex <-- executable
/usr/share/doc/mmex-0.X.X <-- all documentation
/usr/lib/mmex/ <-- rest of files
%HOME%/.mmex/mmexini.db3 <-- program's settings
%HOME%/.mmex/database.mmb <-- default for users' data file
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

So, we need new API to get locations of such files as icons, help, mmexini.db3, etc. I will create this API, this is next target of my development efforts. Surely, this API will have common declaration of some functions in .h file and independents implementations in .cpp files for Win, Unix & Mac. No more #ifdef in sources!!!
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

On Mac:
/MMEX.app/Contents/MacOS/mmex <-- executable
/MMEX.app/Contents/doc <-- all documentation
/MMEX.app/Contents/Resources <-- rest of files
%HOME%/Library/Preferences/mmex/mmexini.db3 <-- program's settings
%HOME%/database.mmb <-- default for users' data file
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

The change of installation dirs is absolutely necessary for such task as rpm build on Linux. I have completed spec file (mmex\setup\linux\rpm\mmex.spec) for building mmex's rpm. The right way of distribution of mmex is higly important task for us. The right way is RPM on Fedora, OpenSUSE and some others distributions on Linux, .deb package on Debian systems (Ubuntu, Kubunty, etc). MMEX will never be included in official release of any Linux distribution if we don't release official rpm-s and .deb-s. The our aim is any distribution of Linux should contain mmex among set of software on installation DVD.

So, we can build rpm now. But we have a problem with installation dir. /usr or /usr/local or /opt usually use to install software. So, /usr/lib/mmex. But what with mmexini.db3? User will not have rights to modify this file in /usr/lib/mmex/mmexini.db3. The same thing with database.

The same thing on Windows. We have to install mmex to %USERPROFILE% instead of "C:\Program Files". Thus, the change of structure of installed dirs is necessary.
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

%HOME%/.mmex/mmexini.db3 <-- program's settings
%HOME%/.mmex/database.mmb <-- default for users' data file
Vadim
MMEX Developer

Posts: 126
Joined: Mon Aug 03, 2009 3:35 am
You don't need to put mmexini.db3 in /usr/local or /usr/lib, just put it as above in ~/.mmex/mmexini.db3
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

Surely, but current version of program finds files in its own directory. We must change the program also.
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

Now might be a great time then to look at changing all the filepaths to wxStandardPaths. For mmexini.db3 we could use this:

Code: Select all

wxStandardPaths::GetUserConfigDir
wxString GetUserConfigDir()

Return the directory for the user config files:

Unix: ~ (the home directory)
Windows: C:\Documents and Settings\username
Mac: ~/Library/Preferences
Only use this method if you have a single configuration file to put in this directory, otherwise GetUserDataDir() is more appropriate.
So our program code would change to:

Code: Select all

const wxChar *MMEX_INIDB_FNAME = wxStandardPaths::GetUserConfigDir() + wxT("/mmex/mmexini.db3");
And now the program would expect mmexini.db3 to be in:
~/mmex/mmexini.db3 (Linux)
~/Library/Preferences/mmex (Mac)
C:\Documents and Settings\username\mmex\mmexini.db3 (Win)
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

Quick question in regards to getting MMEX pre-installed on some linux distributions. wxWidgets is an intermediate to gtk right? I mean there is a wxMac, wxMSW, and wxGTK, but there is no wxQt. So mmex can only be built for the Gnome Desktop Environment right?
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

It is requires libgtk-dev to build mmex. But mmex can run if GNOME runtime libraries installed.
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

Vadim what do you think about my idea for using wxStandardPaths?
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

wxStandardPaths must be used :-) I knew about this class.
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

I have already done most of described changes in sources. So, mmex installs in %ProgramFiles%, mmexini.db3 home is %USERPROFILE%. This perfectly works on Windows, but I didn't have enough time to complete this task for Unix. MMEX doesn't work on Unix at the moment. I will fix this issue on this weekends.
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

So, I added src\paths.h with helper functions to get locations of mmex's files and dirs. All sources modified to use this new API. Three new implementations of this API added in src\win\platfdep.cpp, src\unix\platfdep.cpp and src\mac\platfdep.cpp. No more #ifdef -s!!!
Mac developers should modify mac\platfdep.cpp in case of some problems with my default implementation. I can't test on Mac. Also you should change build and install scripts for Mac. I did it in bakefile's scripts for win and unix.
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

Also these changes broke mmex's portability (ability to run from flash drive, for example). I will fix portability later. We can just build special "portable" version of mmex or use the same installation and some tricks. This issue is investigated :-)
omalleypat
Super User
Posts: 112
Joined: Tue Jul 28, 2009 10:34 pm
Are you a spam bot?: No
Location: Atchison, KS

Re: Coming changes in trunk

Post by omalleypat »

Wes or I will have to look into this, on mac the ~/Library/Application Support/MoneyManagerEx directory is created with the wrong permissions:

Code: Select all

dr----x--x   2 pom   pom     68 Nov 25 08:24 MoneyManagerEx
This leads to a can't open database error in mmex.cpp OnInitImpl

Code: Select all

    inidb.Open(mmex::getPathUser(mmex::SETTINGS));
Just putting this here as a reminder...
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

I forgot to modify default path for new database. Surely, this should be user's home directory as ~/.mmex on Unix or ~./MoneyManagerEx (?) on Mac.

~/Library/Application Support/MoneyManagerEx must be read-only for user so no error here.
elliswr
Super User
Posts: 102
Joined: Tue May 05, 2009 8:21 am
Are you a spam bot?: No
Location: Granbury, TX

Re: Coming changes in trunk

Post by elliswr »

we'll probably end up making it ~/Documents or ~/Documents/MMEX. It is best not to use a hidden folder on a mac, that is a filename with a . in front of it, because this is not visible in the default file viewer (Finder). Doing it this way would require the user to open the terminal if they wanted to delete the directory or database.
Vadim
Super User
Posts: 142
Joined: Mon Aug 03, 2009 7:35 am
Are you a spam bot?: No

Re: Coming changes in trunk

Post by Vadim »

In user home directory should be only database and mmexini.db3. All others files should be shared among all users as others applications' files (for Unix, such paths are /usr/lib/mmex, /usr/share/doc/mmex ). In ~/.mmex should resides mmexini.db3 and this normal that this folder is hidden. But database can be created in directory which user will select and default dir can be ~.
omalleypat
Super User
Posts: 112
Joined: Tue Jul 28, 2009 10:34 pm
Are you a spam bot?: No
Location: Atchison, KS

Re: Coming changes in trunk

Post by omalleypat »

Vadim wrote:I forgot to modify default path for new database. Surely, this should be user's home directory as ~/.mmex on Unix or ~./MoneyManagerEx (?) on Mac.

~/Library/Application Support/MoneyManagerEx must be read-only for user so no error here.
I think that ~/Library/Application Support/MoneyManagerEx is fine for the mmexini.db3, but what I'm saying is that the code wouldn't work until I changed the permissions. After adding write permission to the ~/Library/Application Support/MoneyManagerEx folder, it created the inidb and everything was ok.
Post Reply