Autoupdater   >   About   >   Adding AutoUpdater to Your App
Adding AutoUpdater to Your App
This section covers adding AutoUpdater to your existing Omnis Studio application.
File Structure
The strategy behind AutoUpdater is that the user opens the AutoUpdater library rather than opening your application's library(s).
This gives the AutoUpdater library a chance to:
- Check to make sure all the files which are supposed to be included in the application are present, and if necessary, download and install any missing files.
- Check for any newer version files on the files server, and if necessary, download and replace any older version files.
AutoUpdater then opens your application's main library. Your application's main library is responsible for opening any additional libraries if you have a multi-library app.
In order to make it simple for your runtime users, it is recommended that you do the following to set up your application for use with AutoUpdater.
- Create a new empty folder. Name it an appropriate name, such as your application's short name. e.g. MyAmazingApp In this AutoUpdater documentation we refer to this folder as the APP folder.
- Put a copy of the AutoUpdater library inside the APP folder. Rename to an appropriate name that makes sense to your users. e.g. open_MyAmazingApp or MyAmazingApp_AutoUpdater. This is the file your users will double-click to open your application on their computer.
- Create a subfolder inside the APP folder. Name it libraries.
- Drag your application's files and folders inside the libraries folder. Your application's main library (the one users used to double-click to open your application) must be located directly inside the libraries subfolder.
Some developers have indicated that they want to copy the AutoUpdater library classes into their own main library, negating the need for a separate AutoUpdater library. Theoretically this is possible to do, however, I have not attempted to do this with any of my own applications. Doing so would mean that whenever your main library is updated you will have to do a self-update... a tricky operation.
Copy Classes
There are a few AutoUpdater classes which you need to copy to your application's main library.
- Open the AutoUpdater library located in your APP folder using your developer version of Omnis Studio.
Never open the AutoUpdater library in your development APP folder with a runtime version of OMST! Doing so could cause your development libraries to be overwritten with the last version of the libraries on the files server. Not a good thing!
AutoUpdater will not download files from the files server if you are using a developer version of Omnis Studio.
- When AutoUpdater asks if you want to open the main library, click the Yes button. All going well your application will be opened.
- Press F2 to open the F2 Browser.
- Expand the AutoUpdater library node under the Libraries node of the F2 Browser. (The AutoUpdater library will be whatever file name you gave it.)
- Select the Copy to Main Library folder in the F2 treelist.
- Drag the mAutoUpdater and the oAutoUpdater classes to your application's main library.
Menu Lines
You will now add a menu line to one of your application's menus to give your runtime users access to sending messages to your application's AutoUpdater library.
- Add a menu line to your application's main menu or your application's help menu.
- Select the added menu line and set the following properties for the new menu line:
- $cascading - select the mAutoUpdater class
- $name - enter AutoUpdater
- $text - enter Updates... or whatever is appropriate to your local language.
- Remove and reinstall the menu.
- Select the Update Preferences... line in the Software Updates cascading menu. All going well the runtime AutoUpdater Preferences window will be opened.
You can change the menu line $text properties of the mAutoUpdater menu to suit your local language.
Preferences
The next step is to set up the AutoUpdater Preferences for your application.
- From the AutoUpdater menu, select the menu line for your application.
- The Preferences > Developer tab will already be selected.
- Enter the full name of your application in the Application Name field. As you enter the application name the window title and AutoUpdater menu line will be updated.
- Enter the short name of your application in the Package Name field. If you have different version of your application for different clients append a client's ID to the package name.
Files Server - Database Settings
The next step is to set up the files server for your application.
If all of your users are operating on a local network with a common database it is recommended that you use a database as a files server. A database files server is much faster than an FTP files server.
To set up a database as a files server:
- Create a database named autoupdater using your database's administration tool.
- If required by your database create a user who has authority to create tables in the autoupdater database.
- Select the Preferences > Files Server tab
- Server Type - select Database
- DAM Name - select the appropriate DAM for your database. (If your database is not listed send me an email doug@vencor.ca )
- Enter the remaining fields as appropriate for the AutoUpdater database you have created.
- Click the Ping Server button. All going well, AutoUpdater will logon to your autoupdater database and immediately create the tables it needs.
Files Server - FTP Settings
To set up an FTP server as a files server:
- Create an autoupdater folder on your FTP site.
- Create an ftp_autoupdater user on your FTP site with a password. The ftp_autoupdater user should log directly into the autoupdater directory and not have rights to go any higher in your directory structure.
- Under the Preferences > Files Server tab
- Server Type - select FTP Server
- Enter the remaining fields as appropriate for the FTP files server you have prepared.
- Click the Ping Server button to make sure AutoUpdater can ping your FTP files server. (Provided your files server will respond to TCPPing)
- Click the Connect button to make sure AutoUpdater can FTPConnect to your FTP files server.
Create Package
Create and upload your first package in the same manner as you did in the Quickstart Tutorial.
- Select the Package Builder/Editor tab.
- Click the Prepare Package & Files button.
- Click the Upload Package and Files... button.
- All going well your package and files will be uploaded to (inserted into) your autoupdater database.
Your application is now AutoUpdater savvy!
Distributing your Application
Distributing your AutoUpdater savvy application to runtime users who have Omnis Studio installed on their computer is easy.
- Copy your AutoUpdater library to an empty appropriately named folder. e.g. MyAmazingApp
- Copy the folder with the enclosed AutoUpdater library to the runtime computer.
- Open the AutoUpdater library using a runtime version of Omnis Studio.
- AutoUpdater will connect to the specified files server and download and install all the files specified by the package.
- Each subsequent time the runtime user opens their AutoUpdater library, newer version files will be downloaded and installed prior to opening the application.
Summary
That covers the basics for adding AutoUpdater to your application, setting up your own files server, and distributing your AutoUpdater savvy application.
For a more in depth understanding of AutoUpdater and additional features read the
Technical Documentation section.