Deploying an Application
Okay, so now we will deploy our little cooltool.bas project as an application. To do this, we need to tell Assist where we want it deployed to. The information is kept in the project's resources. Let's open the resources dialog now using the File+Project+Resources menu (or press Alt+R).
Open the project resources dialog
Below is what the resources dialog looks like.
Project resources dialog
Notice the list of resource files. These are all defaults. The first item is the runtime engine which will be renamed to cooltool.exe. The other support libraries will be copied to our deployment path without renaming. The cooltool.bas file will be compiled into a cooltool.tkn file and also copied to the deployment path along with the other files.
Let's set a deployment path now and deploy our application. We type c:\cooltool\ into the Deploy Path: field as shown and click OK.
Setting the deployment path
We must remember to save the project (press Ctrl+S) so that we will not lose the changes we made to resources.
Now we use the File+Project+Deploy project menu (or type Alt+D) as shown.
How to deploy
We see the following deployment popup dialog and check the Open Explorer on Application checkbox so that we can see what files are assembled to make our deployment. Then we click on Deploy.
Let's open Explorer
After a progress dialog and assuming the compile goes without error, we get a confirmation popup.
We click OK to put this away and Explorer opens on our deployed application's folder. Here's what that should look like.
Our finished application!
Now we just double-click on the cooltool.exe file and we see our (very plain) application window open.
The world's simplest software program
Okay, let's add a couple of things to our application to better show how the deployment process works. We put the Cool Tool window away and go back to the Liberty BASIC editor window. Open the resources view (Alt+R).
Cooltool resources
Let's add a resource file. Clicking on the new button activates the Browse button to the right of the Resource File field so we click on that button now. Then we navigate up one folder to the Liberty BASIC v4.03 folder and then into the bmp folder and choose the GRPHBTTN.BMP file as shown.
Choose the GRPHBTTN.BMP file
Now we click on Open and see the new resource file inserted into our Resource File field like so.
Our new resource
Now we'll specify a place where the file will be copied during deployment. If we don't do this, it will be copied to the same place all the other files go by default, but let's copy it into a new subfolder named bmp. We type .\bmp\ into the Copy to: field and click on Accept.
An alternate destination folder
Now we see the following as the resource file is added to the list of resources.
Added to the list
Now we click on okay to accept the changes.
Let's add some code to our program to use the new bitmap we've added to our deployment. We add this line right before the open statement.
bmpbutton #mainview.graph, "bmp\grphbttn.bmp", [clicked], UL, 10, 10
And add this little handler code for the button:
[clicked]
notice "The graph button was clicked!"
wait
Here's what it should look like.
With button code added
Let's save this now by pressing Ctrl+S. This saves not just the code but also the new resource we added to the project's list of resources.
Now we'll deploy by pressing Alt+D. When deployment is finished we should see the following Explorer folder.
Now with a bmp subfolder
Double-clicking on the cooltool.exe file launches our new application. A click on the graph button tests it out.
It's alive!
Now let's version this code by pressing Alt+C and adding the comment Added a graph button. Then we click OK.
Version 3
Okay, now let's add an icon to our application. From the Liberty BASIC editor we click on the Setup+Icon Editor menu.
Let's make an icon
Now we'll draw an icon for our cooltool application. Here is a crude wrench icon.
Good enough for our purposes
Using the File+Save Icon... menu we save it in the cooltool_project folder as wrench.ico as shown.
Saving as wrench.ico
Now we close the Icon Editor window and open our resources dialog again using Alt+R. We type wrench.ico into the Icon File: field as shown. By default it is going to look for the icon in the cooltool_project folder so we don't need to use the Browse button go looking for it.
Setting the icon file
Let's click OK to accept our new change and type Alt+D to deploy this application. When deployment is completed you should see the following Explorer folder.
Deployed with wrench.ico
We double-click on the cooltool.exe icon to see what our application window looks like with its new icon.
Now with a custom icon
Copyright 1992-2009 Shoptalk Systems