Read this file in other languages: English, French
Proposes to provide an architecture and an organization to efficiently build an desktop application Windows with AutoIt.
For documentation, visit https://v20100v.github.io/autoit-gui-skeleton/
AutoIt Gui Skeleton (AGS) give an environment for developers, that makes it easy to build AutoIt applications.
In order to organize the code of an AutoIT application, AGS propose to use conventions and a following model to develop and build AutoIt application with an graphic user interface (GUI).
An AGS project respects the following organization for its files and directories.
project root folder
|
| myApplication.au3 # Main entry program
| myApplication_GLOBAL.au3 # All global variables declaration
| myApplication_GUI.au3 # Main program to handle GUI
| myApplication_LOGIC.au3 # Business code only
| README.md # Cause We always need it
|
+---assets # All applications assets (images, files...)
| +---css
| +---html
| +---images
| \---javascript
|
+---deployment
| \---releases # Contains releases setup (zip and Windows setup files)
| deployment.bat # Windows batch bandmaster to pilot the creation of the Windows setup
| deploymeny.iss # ISS to generate Windows setup
|
+---vendor # All third-party code use in this project
| \--- FolderVendor
|
\---views # Views declaration
View_About.au3
View_Footer.au3
View_Welcome.au3
We organize the files of an AutoIt project in specific directories.
This directory contains the elements used in the application like images, text files, pdf, html, css, javascript. This folder contains all local files need into the application.
This directory contains a Windows batch that controls the creation of a Windows installer with the InnoSetup solution. To run the batch, it is necessary that the InnoSetup compiler and 7zip be installed on the pc. If this is not the case, I advise you to use the Windows package manager Chocolatey to install them simply:
C: \> choco install 7zip
C: \> choco install innosetup
This directory is the place where to conventionally store the code developed by third parties in a project. In this project (https://github.com/v20100v/autoit-gui-skeleton), we have for example put the GUICtrlOnHover v2.0 library created by G.Sandler a.k.a MrCreatoR in this directory.
This directory contains view managers. All the code of all the views are defined each time in a specific file and stored in that directory.
The main entry program serves as a single point of entre for AutoIt application. This is the location where the application starts. In the latter we start by including all the other dependencies that it needs: libraries of AutoIt, third-party libraries, the declaration of global variables, the code of the application GUI and business.
It starts application with the main handler GUI _main_GUI()
.
The main handler GUI contains the _main_GUI()
method which is only called by the main entry program. This method is designed to create the graphical user interface (GUI) and manage all user interactions and events.
All constants and global variables are set in one place, in the file myProject_GLOBALS.au3
. With the exception of all global variables of graphic elements which are set in each specific view file. It is recalled that constants can no longer change their value over time, unlike global variables.
By convention, all the global variables must be written in capital letter and separated by underscore. For example : Global Const $APP_EMAIL_CONTACT
In order to facilitate the deployment of a Windows desktop application develop with AutoIt, we propose to use an automated process to build a Windows installer with the InnoSetup solution. In AGS we use a Windows batch file, called .deployment_autoit_application.bat
, which plays the role of orquestrian leader in the generation of the setup. In the \Deployment
directory, it will create the \releases\vx.y.z\
directories where the application zip archive and the Windows will built.
For generate a Windows application installer, we must a preparation whose main steps are:
- Assign a version number to the application;
- Compile the application, i.e. compile the main entry point myProject.au3 with aut2exe compiler;
- Copy the assets (images, files …) necessary for the proper functioning of the application in the output directory;
- Create a zip archive to recover the application;
- And finally build the installer by compiling the associated InnoSetup script.
All these steps are driven by the Windows batch deployment_autoit_application.bat
.
In this git repository, we added into folder source an AutoIt project, built with AGS conventions. To create a new project with AGS, i advise you to start with it, and change mentions 'myApplication' with the real name of your application.
- AGS v1.0.0 - 2018.05.16
Comments, pull-request & stars are always welcome !
Copyright (c) 2018 by v20100v. Released under the Apache license.