Michael Stratmann wrote:
Hello,
I discovered, that my app.exe needs an env var wxArt2d or wxArt2d_Art. In the
relevant folder are four cursor icons, that's all.
You forgot you can also set the internal variable.
wxString* artdir =
a2dGeneralGlobals->GetVariablesHash().GetVariableString(
wxT( "WXART2D_ART" ) );
And this you can set at the beginning of your program to any thing you want.
The big question is to what??
wxStandardPaths::GetExecutablePath
wxString GetExecutablePath() const
Return the directory and the filename for the current executable.
Example return values:
Unix: /usr/local/bin/exename
Windows: C:\Programs\AppFolder\exename.exe
Mac: /Programs/exename
OR
wxStandardPaths::GetResourcesDir
Etc.
It is certainly not possible to get the executable path of the executable you
start on Unix, since one can have links etc., and the path will be wrong in such
cases. On windows, it seems to work, but i do not recommend it.
On windows it might be portable, but on Linux not.
All complex CAE programs suites i work with use an environment variable, which
is what i think is best. You do not start the executable, but instead a
mySuperApp.bat, in there the WXART2D variable is set. The value of is generated
during installation of your program, since that is when your program will need
to get the path where it will be installed.
To make it portable as on memory stick, you can test first the executable path,
and if not found there, you can ask it to the user.
My app shall run without needing env vars or registry. So it can run from an
USB stick. The cursor icons I would like to put to my other resorces. Or
built in in the lib and exe.
All possible, the problem is to have to location to them.
That is exactly the reason for having this variable in wxArt2d. With this
variable, your application can define the resources needed in/by wxArt2D.
You just copy them into you distribution, and wxArt2D libraries will take it
from there. And you can even redefine you cursor images.
How to get rid of the need for the env var? Would it be a good idea to modify
wxart2d so all exe do not need the env var?
That is already the case.
a2dDocviewGlobals->GetVariablesHash().SetVariableString( wxT("WXART2D_ART"),
maskprocRoot + wxT("/art") );
Are there more surprises like the
cursors?
Just a quick search, on what is used by some dialogs/samples.
No big deal,
Klaas
C:\data\art2d\wxArt2D\modules\artbase\src\artglob.cpp(40):
a2dGeneralGlobals->GetVariablesHash().SetVariableString( wxT("wxart2dlayers"),
wxT("wxart2dlayers.cvg") );
C:\data\art2d\wxArt2D\modules\artbase\src\artglob.cpp(41):
a2dGeneralGlobals->GetVariablesHash().SetVariableString(
wxT("layerFileSavePath"), wxGetHomeDir() );
C:\data\art2d\wxArt2D\modules\editor\src\layerdlg.cpp(759):
a2dGeneralGlobals->GetVariablesHash().SetVariableString(
wxT("lastLayerFileSavePath"), wxPathOnly(fullname) );
C:\data\art2d\wxArt2D\modules\editor\src\layerdlg.cpp(789):
a2dGeneralGlobals->GetVariablesHash().SetVariableString(
m_args.argValue.varname, m_args.argValue.varvalue );
C:\data\art2d\wxArt2D\apps\maskproc\src\maskprocmain.cpp(418):
a2dDocviewGlobals->GetVariablesHash().SetVariableString( wxT("wxart2dlayers"),
wxT("maskproclayers.cvg") );
C:\data\art2d\wxArt2D\apps\maskproc\src\maskprocmain.cpp(419):
a2dDocviewGlobals->GetVariablesHash().SetVariableString( wxT("WXART2D_ART"),
maskprocRoot + wxT("/art") );
C:\data\art2d\wxArt2D\samples\aggdrawer\samples\tutoagg\tutoagg.cpp(736):
a2dDocviewGlobals->GetVariablesHash().SetVariableString( wxT("wxart2dlayers"),
wxT("maskproclayers.cvg") );
C:\data\art2d\wxArt2D\samples\aggdrawer\samples\tutoagg\tutoagg.cpp(737):
a2dDocviewGlobals->GetVariablesHash().SetVariableString(
wxT("layerFileSavePath"), wxT("C:/tmp") );
--
Unclassified
------------------------------------------------------------------------------------------------------------
Disclaimer:
If you are not the intended recipient of this email, please notify the sender and delete it.
Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------
begin:vcard
fn:Klaas Holwerda
n:Holwerda;Klaas
note:Unclassified
version:2.1
end:vcard
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev