App-related variables

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

I think the following app-related variables would be nice...

AppName() -- Returns name of executable ("MyApp.exe") without the path.
AppSize() -- Returns byte size of executable (good for security checks).
AppDir() -- Full path where executable was run from, with trailing slash.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.

I also vote for this, AppDir() would be useful to test if my app is started from cdrom, from a directory on hd etc.
And AppName() + AppSize() is handy for testing, if someone has manipulated my exe :)

Regards
André

*** German PureBasic Support ***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

I need AppSize() for my first PB Virus!

:-)

Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

This returns the full path and filename of the executable, but only for windows.

path$=space(255)
GetModuleFileName_(#null,@path$,255)

messagerequester("",path$,0)
Post Reply