Of course, the ultimate goal of any software developer is to get their program into the hands of users. If everyone needed to own a copy of Revolution in order to run the stack, distribution would be difficult.Fortunately, Revolution provides a robust set of tools for creating double-clickable, stand-alone applications on any supported platform. These standalone applications may be distributed without the developer having to pay royalties to Runtime Revolution (although Educational editions of Revolution are the exception to this policy).
Let's look at the tools for creating standalones.
TERM |
TYPE |
Description |
platform |
function |
The
|
environment |
function |
The |
lookAndFeel |
property |
The The |
machine |
function |
The machine function returns
the type of hardware the application is running on. For instance, if you
were running on a Macintosh PowerBook, the function should return "Powerbook".
On Windows systems the function always returns "x86". |
processor |
function |
Use the The |
systemVersion |
function |
The This allows you to check for specific versions of the Mac and Windows OS as you are launching your stack. |
specialFolderPath |
function |
The |
Sometimes you will notice that a stack or standalone changes appearance in minor ways when moving them between platforms. For instance, the fonts might be slightly different, or the background color might be different. This is in part due to differing default settings that the Revolution engine uses on different platforms. One way to avoid these differences is to set the stack's textFont, textStyle, and textSize properties, and its backgroundColor, foregroundColor, and other color properties, to the values you want before creating the standalone.
Even though Revolution presents several common button styles—Push Button, Default Button, Checkbox, etc., the appearance and behavior can be different enough between platforms that you will want to be sure to test them extensively on all platforms you are targeting.
As you know, menus look and behave differently on Mac OS vs. Windows and Linux/Unix systems. Most obviously, menus on the Mac OS appear at the top of the screen, while on Windows and Unix they appear in the application window. That means that you have to leave a little extra room at the top of your card for a menubar, if you are planning to deploy on Windows. This menubar would be hidden on Mac systems, so you have to decide if you like having the blank strip at the top of the card, or if you would rather resize the stack window slightly when running on Macs. Revolution does provide some automated help in this area, but you still need to check it on all platforms to make sure it works the way you want.
The various operating systems take differing approaches to securing certain areas of the file system against changes that could adversely affect the performance of the system. For instance, you don't want to allow programs (or Revolution stacks!) to delete critical system files. To prevent this, operating systems impose a system of permissions that determine which users or programs can write to which directories on the disk. Operating systems also provide certain directories that are always available and "safe" to write in. Examples include the user's Documents folder, the user Preferences folder and others. Revolution provides the specialFolderPath function to provide a cross-platform way of referring to these folder locations.
Another way to compensate for platform appearance differences is to use profiles. A profile is a set of object property settings that can be used to quickly change things like languages, appearance and so forth in your stack. Creating profiles can be a useful strategy of optimizing your stack for different operating systems. For example, you might create separate profiles for Macintosh and Windows that use different fonts for buttons or fields, or that set slightly different background colors to compensate for the slightly different screen gammas (darkness or lightness of colors) between Mac and Windows monitors.
The first step in creating a standalone application is to establish the desired settings. To do this choose Standalone Application Settings... from the File menu. This brings up a special settings window that make it simple for you to prepare a stack or stacks for distribution as a standalone application.
|
|
General settings.Standalone Name: The name of the standalone application you want to create. Inclusions. Here you can choose to include various types of resource in the standalone file. The first radio button ("Search for required inclusions...") will scan your stack and attempt to automatically include the required libraries in the standalone. Alternatively, you can check the"Select inclusions..." button to manually choose the libraries to include in the standalone. What you check depends upon what resources your stack uses. For instance, if you have no animations in your stack you don't need to keep the Animation Libraries in the distribution. If you use the ask and answer commands in your stack be sure to check the Ask Dialog and Answer Dialog check boxes.Property Profiles. A profile is a set of property settings for an object. You can create multiple profiles for each object in your stack in the Profile panel of the Property Inspector. In this section you can choose which profile will be used when building your standalone application. For example, you might create separate profiles for Macintosh and Windows that use different fonts for button or field objects. Here you can choose to either remove all profiles from all objects in your stack (in effect making the settings in Master profile the ones that are used), choosing a specific profile for all objects to use, or to include all profiles and the profile library, making it possible for users of your standalone to choose a profile. |
|
|
Stack files to include.Here you may select the stack files that are to be included in the distribution. There are buttons that let you add or remove stack files. The mainstack of the selected stack file will always appear first in the "Stacks in the selected stack file" list. Advanced Options Section
|
![]() |
Copy Files into the AppIf you want to automatically copy external files—images, video or sound files,for example —into your standalone application folder, use this pane. The files that you add to the application will then be copied to a location that makes it possible for the standalone to find and use them. For Windows executables and Classic Mac OS applications the files will be copied into the same folder as the standalone executable file. For Mac OS X applications: Applications on Mac OS X are actually specialized folders called packages or bundles. Copied external files will be put inside this package so that they will not be immediately visible in the Finder. To see where the files are placed, Control-click or right-click on the application file and choose Show Package Contents from the popup menu. A window will open showing a folder called Contents. Open the Contents folder, then the MacOS folder. Here is where you will find copied files. (Note: If you have set the defaultFolder property in your stack to the folder that contains the stack file, when you create the standalone the defaultFolder will be this MacOS folder. On the other hand, if you never explicitly set the defaultFolder property in your stack, when you create the standalone the defaultFolder is set to the folder that contains the application package.) |
![]() |
Set OS Specific SettingsThese four panes allow you to specify settings that determine how the standalone file will appear in the file system of the operating systems for which you are building your app. Here you can set things like application icon*, version number, and copyright notices. |
|
|
|
|
Mac OS PaneBuild for: This refers to the various processors that Classic Mac OS may run under. If in doubt, choose Mac OS fat. Creator Signature and Document Type : Document type refers to the type of document your application can create or open. It can be an existing type or you may make your own custom type. In the latter case it should also be registered with Apple to avoid conflicts with existing type codes. Include resources from file: Every Mac file can have what is called a resource fork, where special resources like cursors, icons, sounds, menus and others are stored. This option allows you to bring resources from any file into your own stack. Macintosh Memory Information: Version Information: |
![]() |
OS X PaneCheck the Build for Mac OS X box to save a standalone that will run under Mac OS X. Icons*: You can assign a finder icon to the application by choosing a previously-created icon with the Choose... button next to the Application Icon field. You can assign a Finder icon to the application's documents by choosing a previously-created icon with the Choose... button next to the Document Icon field. You can also specify a custom icon to be displayed in ask and answer dialogs. PLIST: A plist is basically a specially-formatted preference file. Unless you are familiar with XML and plists in OS X, choose the first option. Name, Signature, Document section:
Version Information section. The information you provide in here will help you keep track of version, copyright and other information under Macintosh OS X. The Long Version and Short Version fields hold strings that describe which version of the application this build is. It is important to carefully increment your version number with each successive build to avoid confusion over which build is the latest. The copyright notice appears in the Finder's Get Info box for your application. The bundler identifier helps identify your application to the OS. Normally you shouldn't have to change this.
|
![]() |
Windows PaneThis tab is where you may include Windows-specific information, such as which icons* will appear with the application, version and copyright information, and others. It is important to carefully increment your version number with each successive build to avoid confusion over which build is the latest. You can assign an icon to your Application by clicking Choose... and navigating to a previously-created .ico file. |
![]() |
Unix Pane Build for: Choose the version of Unix you want to run your application on. Include: Unix-specific libraries you may wish to include in your application. |
![]() |
Bug Report PaneIf you wish to provide a mechanism for your users to report bugs and errors back to you, click the Include Error Reporting Dialog box. You can then customize the error dialog text, assign a custom error dialog icon, and allow the user to save the report, enter their own comments, and even email you a copy of the error to assist you in debugging. |
*Custom application icons: More information on creating icons for standalone applications can be found in this excellent tutorial by Chipp Walters of Altuit, Inc., a major Revolution developer.