Using Launch.prg to Launch your Application
Starting with Web Connection 7.0 a
Launch.prg file is generated into 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 and/or BrowserSync
- Launch your Web Browser
all in one single command step.
You can use Launch.prg to work with these servers and combinations:
- Browser Sync Live Reload Server
For more information on BrowserSync and seeing HTML,CSS,Script and JS changes live reloaded in your browser as soon as you save a change to disk, please see the Using BrowserSync topic.
Note: BrowserSync and 'action' commands are new in 7.05. Previously you could only use .t. or .f. for IISEXPRESS and IIS respectively. We recommend you update to the 7.05 model. See below for how you can update your projects to the new
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:
BROWSERSYNC or BROWSERSYNCIIS
Launches the Browser Sync Live Reload NodeJS Component (has to be installed!) as a proxy to IIS. Then launches your Web Connection server and opens the browser on the BrowserSync port of
Launches the Browser Sync as a proxy to IIS Express. Then launches your Web Connection server and opens the browser on the BrowserSync port of
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 lcVirtual = "wwThreads" lcAppName = "wwThreads" 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.
Comment or report problem with topic