GST Billing Software

header image

How to create an Installation Script for applications developed

Erachana Line

In Kushal we are using 'Inno Setup Compiler' as 3 rd party software to create 'Setup' of application.

Steps to Create Installation Script

After Completing development / generating the source code from Kushal, click on the 'Create Inno Installation Script' Button.

To know More about Inno Scripting: http://www.jrsoftware.org/ishelp/index.php



A file will be generated in the project source code directory, as shown.





InstallationScript. iss is the file which contains script to build your application setup.

Run the InstallationSript.iss file (It opens in Inno Setup Compiler application).



In this application, modify the Inno Script File generated as below.

1) Add AppPublisher and AppPublisherURL in script

• AppPublisher as 'ERACHANA TECHNOLOGIES.'

• AppPublisherURL as '/'



For more info: http://www.jrsoftware.org/ishelp/index.php?topic=setupsection

2) Mention the Default directory for application installation. When Script gets generated from Kushal it will be'DefaultDirName={pf32}\SampleProject', change it to 'C:\ERachana\ SampleProject' .

a. As per the ERachana's application development standards all applications have to be installed in 'C:\ERachana\{Application Name}'by default. (It should have provision to change while installing by end user if he wants to install other than mentioned directory)

b. Add this in script

DefaultGroupName = {Application Name}



3) Set the Output directory to store generated Setup. By default it will be 'OutputDir=:{Source Code Path}\{Application Name}\src\'. You can Change it to as per your requirement if needed.



4) Add Version information about the application version. It should be same as the version number which is used in the Project Version and Version controller.

Add Various details of Version as show below.



5) Add Wizard Image File, this image will show at the left side of the installation screen.



Keep an image file in the same directory where Inno Script File is present.



Note: The Image file should be in 'bmp' extension with 16-bit Color format.

6) Add Wizard Small Image File, this image will show at the right-side corner of the installation screen.



Keep an image file in the same directory, where Inno Script File present.



Note: The Image file should be in 'bmp' extension with 16-bit Color format.

7) Add Privileges of the administrator for application installation. By Adding below line, while installing application, permission required from the system administrator user.



8) Add License Agreement content for the application to avoid the unauthorized installation / usage.

Keep the license file in the same directory where Inno Script File present.





Note: License file should in 'txt' format.

9) In Icons section, specify the icon and its path of Exe which has to show on Desktop screen, All Program Screen and in Program List. (Make changes only if you want to display other icons on the screen or else leave as it is)



For More info: http://www.jrsoftware.org/ishelp/index.php?topic=iconssection

10) In the Files section, specify the all files which have to be installed (By default Kushal generates in the release folder and the same is mentioned here. If you have changed the build path in Visual Studio Solution file (Configuration done to x86) same has to mention here)



11) Change the directory of Source path if you are considering files from different directories (If obfuscation is needed then obfuscated files has to be kept in a separate folder and that path has to be mention here, in normal case no change required). Set required Flags for the installation process.



For more info: http://www.jrsoftware.org/ishelp/index.php?topic=filessection

12) Add other Files which need to be installed with application and set required path and Flags.



13) To do a registry entry for application file extension, Add the required values in the following format in Registry Section.



for more info: http://www.jrsoftware.org/ishelp/index.php?topic=registrysection

14) If you want to run any other exe after the regular installation procedure, in Run section add exe / File name and set flag when it has to run.



For more info: http://www.jrsoftware.org/ishelp/index.php?topic=runsection

After Completing these save the file and run (F9) to create the setup of the application. Inno Setup Compiler will start with compilation with all files and code, if it finds any error it will stop and throws the exception.



Finally, it builds the setup and automatically runs the same.

Constants which are used commonly in script

{app} : The application directory, which the user selects on the Select Destination Location page of the wizard.

{win} : The system's Windows directory.

{sys} : The system's System32 directory.

{syswow64} : On 64-bit Windows, the system's SysWOW64 directory,

{pf} : Program Files. The path of the system's Program Files directory.

{pf32} : 32-bit Program Files. The path of the system's 32-bit Program Files directory,

{pf64} : 64-bit Windows only: 64-bit Program Files.

{cf} : Common Files. The path of the system's Common Files directory.

{cf32} : 32-bit Common Files. The path of the system's 32-bit Common Files directory

{tmp} : Temporary directory used by Setup or Uninstall

For more info: http://www.jrsoftware.org/ishelp/index.php?topic=consts


Just for your info: You can also use another software called 'IS TOOL' which will help you in scripting and setup building.



Obfuscation

Before generating the Setup follow the instructions given below:

Once the source code is generated from Kushal, before generating the Setup script, execute the application once. From the Debug folder include all files except the following:

.manifest

.pdb

. vshost.exe

With the following files prepare obfuscation using Intelli Lock Software:

.exe

Kushal.Controls.dll

Kushal.ImportTemplate.dll

Include dll files of the SQLCE based on the version of the database,

If SQLCE version is 3.5, then include 3.5 dll files by referring to the location where SQLCE is installed, similarly for the version 4.0

Steps to use ISTool:

ISTool script editor allows you to create the script for its different sections in a friendly way by setting properties in dialog windows.

The Installation script can be written directly in the ISTool or the script which is written using Inno Script can be edited.

To edit the Inno script:



  • Right click on the Inno Script and Select Open with ISTool as shown below:

Following are the options which can be used to build the Script:

Under the Sections:

Script: Script is used to write Scripts for Setup (Here the script can be written manually using commands)

Files and Dirs.: Files and Directories can be included directly by selecting form name in the windows explorer.

Icons: Here in this menu Icons for .exe file grouping can be done.

Registry: Here the file extension needs to set by referring to the operating systems registry.

Install Delete: Here the files which needs to be deleted on Installation can be included.

Install Run: Here the files which needs to be executed during installation process needs to be included.

Uninstall Run: Here the files which should be executed during uninstalling an application can be included.

Uninstall Delete: Here the files which needs to be deleted on uninstalling an application can be included.