Currentdir() woes...
Blitz3D Forums/Blitz3D Beginners Area/Currentdir() woes...
| ||
I have been a little trouble with CurrentDir() returning the path where the executable is located in a variable filesystem (i.e. the path to the application is dependant upon where a 'user' chooses to install it). Is there a way to get the path where my executable was started? ( when started it from a remote application) I have searched the forums and found that in Bmax you can: AppArg$[0] contains the name of the app as it was called, AppDir$ will contain the current apps path and AppFile$ will hold the apps full filename. I have been using the very good Inno Setup to produce my first 'installable' application. I am so close to having a successful installable application it almost hurts..... After initially installing the app it will execute successfully straight after install. But starting my initial application (which in turn executes my BB application) results in my BB application losing track of 'where it is....' The problem I am experiencing is that when the BB3d.exefile is double clicked from within the installed file directory it runs successfully. However, when I run the BB3d.exe from a remote application (via the start menu), currentdir$ returns the C:/Documentsandsettings/{username}/{installed_app_subdirectory}/{file_required} WHEREAS ideally I would prefer currentdir$ to return the name of the app as it was called, this would allow my BB3d exe to find the necessary files within the correct directory structure... I do have a protracted solution whereby my remote app will write to a textfile the 'app.path' as it interperets it', however my BB3d.exe will have trouble locating the 'variable' path that it has been installed to due to current dir returning NOT where my BB3d.exe has been installed but the user which is running the bb3d.exe in question. Thanks in advance to any advice... |
| ||
SystemProperty("Appdir") |
| ||
cheers, will try implementing this straight away.... I presume it's just a case of :- Global old_app_dir$ = CurrentDir() Global app_dir$ = SystemProperty(old_app_dir$) |
| ||
Um, no.path$ = SystemProperty("AppDir") Path$ will then be "C:\wherever\your\exe\is" etc |
| ||
Thanks again, will try it as you have suggested... My first implementation didn't quite do the trick. |
| ||
Yahooo.... Gfk you have no idea how thankful I am. My application now runs from the start menu after installation. Thanks again. There was a posting in the past about 'what have you achieved today', well thanks to you I now have a fully installable, runn-able from the start menu application. Cheers again Gfk.. |