Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting if running from a .app file
Message
From
21/04/2011 11:18:38
 
 
To
20/04/2011 17:42:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01507913
Message ID:
01508041
Views:
57
>My question is: why do you care?
>

For a user using my tool:

If possible, I'd like to avoid having my tool make any Set Path, Set Procedure, or Set Classlib calls when a user runs the .app in their VFP IDE. I want to make as few changes to their environment as possble.

Since a compiled .app has those resources within itself, I hoped that I could get by without making these Set calls in order to access the ClassLibs or Procedures.


But, when I am developing the tool in my IDE:

When I am actualy working on the tool to develope it, I do not run the .app file, but rather I run the boot.prg directly, so I need these Set calls to be made so that it will launch and run properly.


So that's whay I want a test... Am *I* running it in development mode, make the Set call. If a *user* is running the *app*, do not make the Set calls.


Again, my simple goal is to not piddle with their environment with Set calls, if it can be avoided.


Even after I make the test, I still have to see how lean I go with the Set statements and still have the app run property.





>
>>I have some code in my boot prg that sets Path and Classlib to set up the environment for when I am running the boot prg manually from the IDE.
>>
>>However, when shipping this app, it will go out as a .APP or .EXE file, so all the VCX and PRG files that I am pointing to with my Set Path and Set Classlib statements will not really be necessary, since the targeted resources will exitist within the running .app file. Therefore, I do not want to call these Set Path and Set Clisslib statements if running from an .app or .exe file.
>>
>>I want something like this in my boot.prg:
>>
>>
>>
>>If .not. RunningFromApp()
>>
>>  Set Path to 'C:\Blah\Boo'
>>  Set Path to 'C:\Blah\Foo' Addi
>> 
>>  Set Classlib to 'D:\Code\SomeClassLib.vcx'
>>  Set Classlib to 'D:\Code\SomeOtherClassLib.vcx' Addi
>>  
>>
>>EndIf
>>
>>
>>
>>
>>Isn't it correct that if the PRGS and VCX that live at these locations are compiled into the .app file, then these statements would not be needed when launching the .app file directly, but they would be needed if I am manually running the boot.prg file from within the IDE (launching boot.prg from the Command Window or running it frmo the Project Manager)
>>
>>
>>So, what test can I use in RunningFromApp() to know if the file that is running is .app, .exe, or a manually launched prg?
>>
>>.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform