Using Launch.prg to Launch your Application
Starting with Web Connection 7.0 a simplified project launcher script called
Launch.prg file is generated for new projects. This file can be used to quickly launch your Web Connection applications using a number of different start modes. Rather than using the traditional
DO MyAppMain.prg you can use
- Launch your FoxPro Server
- Launch a separate Web Server like IIS Express
- Launch your Web Browser
all in one single command step.
You can use Launch.prg to work with these servers and combinations:
Launch.prg supports a number of different combinations of modes.
IIS Launches the application without any special server startup since IIS is always up and running. Opens the browser for the IIS URL. Urls include a virtual:
Launches the IIS Express WebServer on the default port
7000. If already running it'll try to launch again but this has no effect as it's already running. Then starts your Web Connection application and opens a Web Browser on the url:
NONE or SERVER
Launches your FoxPro server without launching any servers or opening a browser.
Documentation link that opens this Web page
Called with no Parameters
This mode will default to either IIS or IISExpress mode depending on which Web Server you chose during installation. You can modify
Launch.prgto set a different startup type to use as your default.
launch.prgmakes it easier to launch applications for the first time to get servers and browsers opened in one step, the traditional direct method of launching your server with
DO MyAppMain.prgstill works just fine and in fact is still a good way to launch once your server and browser are already open and running.
Applications prior to Web Connection 7.05 either didn't have a
Launch.prg or had a more limited version. So to take advantage of the above features you need can easily create a new
Launch.prg file into your existing project.
To do this:
- Use the Console to create a New Project
- Go to the project folder and copy
Launch.prginto your existing project
- Modify the startup parameters in
All of the necessary parameters for
Launch.prg are defined at the top of the program so you can easily change the code with the values for your specific project.
The code that needs to be adjusted is the following:
*** Generated Defaults lcAppName = "wwThreads" lcVirtual = "wwThreads" && or "" for root site lcScriptMap = "wwt" lcWcPath = ADDBS("C:\WEBCONNECTION\FOX\") lcWebPath = LOWER(FULLPATH("..\web")) llIisExpress = .F.
In this case I updated my Message Board application to use
Launch.prg. The changes I made are:
- Change the scriptmap to
And that's it.
lcAppNameis the name of your project, while
lcVirtualis the name of your Virtual directory (or empty (
"") for a root site) in IIS (even if you are not using IIS). In most cases these are the same but they can be different for projects with multiple process classes.
Note you can customize the
Launch.prg. This file is generated for your project and won't be changed after it's created.
To update to a newer version (if Web Connection changes behavior), you can always compare your version against the
Launch.prg in the root of the install folder. You can use a diffing tool like BeyondCompare to compare for changes.
Comment or report problem with topic