Wednesday, 25 February 2015

Adding Installers in your project using InoSetup


What is Innosetup Installer ?
It is used to create a installer for your project. For e.g: You are delivering a project to a client, but a client cannot register the service of its own or can execute the sql queries. To resolve this issue, we can make the installers which will register the services automatically and can run batch files which will execute sql queries automatically.

[Inosetup installer]
Inosetup

Steps to work with Inosetup installer in c#:-

1.Install the Inosetup
2.Add the .iss file in your solution projects
For e.g:- If you are having three projects[Client,Service,Shell] in your solution project then you need to add three installer[.iss] files per project
3. In your client project add the "Common.iss" installer which contains the common functionalities of the installers like the installer pop-up windows.
4.In your service project you will have installer file which will help you to register the .xml config file.
Your service installer[.iss] file will basically have a procedure which will execute the [.xml] config file.
E.g:-
procedure AfterInstallBatch();
begin
if     ExecBatch('Registering Warranty Title Tools Server Package...',  ExpandConstant('{app}\sps.exe'),         ExpandConstant('register /server:{code:GetSPServerInfo|Address} /user:{code:GetSPServerInfo|Username},{code:GetSPServerInfo|Password} ProjectServiceRegistration.xml'))

5.In your shell[U.I part of the project]project, you will add the projectname.Shell.Install.iss which will basically copies the ProjectName.client.dll and ProjectName.Shell.dll of your project from the bin folder to the softwares service directory which you want to integrate with your project.

Download .iss installer files [replace projectname with your project names]

Add the Installer\common.iss in your client project :-
common.iss

Add the Installer\projectname.service.install.iss in your client project :-
Service Installer
Add the Installer\projectname.shell.installer.iss in your shell project
Shell installer

No comments:

Post a Comment