After you developed and built your main application, you will develop and build a Launcher. This Launcher will check if your main application is already running, if it's not, the Launcher will execute your application. If your main application is already running, the Launcher will give you a message, showing that the main application has been already executed and it is still running. After clicking
OK on the message, the Launcher application will exit.
- Create your main program code. For example, we will use a program that generates a random value from a specified range.
Main application example. Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
- Build an Application (EXE) from your Code. When you create it, the Target filename will be the name of the process that you will look for later.
- After you build your application, create the Launcher that will look for the process of your application on Windows before launching it. Use the Target Filename string constant to look for your Main application Filename and the Path of the Application string constant to run it, in case it is not already running.
Launcher application Example. Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
- Build an Application (EXE) of the Launcher.
- Run your Main application through the Launcher application.
IMPORTANT: Make sure that you always execute your application from the Launcher and not from the Main program executable.