Creation installation file in Inno Setup

In Visual Studio Express Edition there is no possibility to create instalation file for our projects. There is not such a function? In order to create exe file help us Inno Setup Compiler. This is free tool to create installation files.

Attention! This post has been published on my old website that has been down. Inno Setup was used long time ago by me, but I’m archive old posts for possible future use. Please be careful when using this post content.

If there is no need to build advanced installer – Inno Setup helps us to create it in one minute. But if someone want to add some extensions then Pascal has to be used to write code.

My VB Visual Studio project required three following things:
1. checking if Net.Framework >= 3.5 package is installed on local computer
2. checking if SQL SERVER CE 4.0 is installed on local computer
3. possibility to remove previous version when installing new one

My installer checks if Net.Framework and SQL SERVER are installed. What more, there is an option to download required files directly from website where packages have been published. Installer checks if previous version is already installed – if yes user might remove it.

Pay attention on AppId. If new version has been created, AppId has to be same as in previous version:


In installer code AppId is mentioned in two places, there where installer checks id previous version is installed:

sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{{809B9E8D-0216-4263-83D9-B2A87E4AB658}_is1'); //Your App GUID/ID
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\{809B9E8D-0216-4263-83D9-B2A87E4AB658}_is1', 'UninstallString') then  //Your App GUID/ID

Quite important is code part in section [Dirs]. It allows to install our app on limited account (user account, not admin) in Widnows. Thanks to [Dirs] Windows will ask user to write admin password in order to install app:

Name: "{app}\"; Permissions: everyone-modify

Unfortunately i don’t remember from where I took code to check if Net.Framework i SQL SERVER CE are installed. Removing previous app version has been took from this site:

Comparing original code following part has been add to comment:

//sUnInstallString := GetUninstallString();

Removing this part of code was needed because when installer detected previous version then it asked to remove old version. It doesn’t make sense because this question was asked when installer have been run.

Of course basic code has been created in Inno Setup creator in order to modify it later. Below whole code from Inno Setup to create installer file:

; Script generated by the Inno Setup Script Wizard.

#define MyAppName "Nazwa mojej aplikacji"
#define MyAppVersion ""
#define MyAppPublisher "Pawel Bartkowiak"
#define MyAppURL "http://localhost/pawelbartkowiak/_public_html/wordpress/"
#define MyAppExeName "NazwaInstalatora.exe"

; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
;AppVerName={#MyAppName} {#MyAppVersion}

Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"

Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

Source: "C:\Users\Pawel\Documents\Visual Studio 2012\Projects\Nazwa Projektu\bin\Debug\Instalator.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Pawel\Documents\Visual Studio 2012\Projects\Nazwa Projektu\bin\Debug\BazaGrzejniki.sdf"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

Name: "{app}\"; Permissions: everyone-modify

dotnetmissing1=Minimum Microsoft .NET Framework 3.5 is required. Would you like to download it?
dotnetmissing2=SQL SERVER CE 4.0 is required. Would you like to download it?
function CheckDotNetFx(): Boolean;
    Result:= RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5');

function CheckSSCE(): Boolean;
    Result:= RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server Compact Edition\v4.0');

function CheckIsReady(): Boolean;
    Result:= CheckDotNetFx() and CheckSSCE();

function GetUninstallString: string;
  sUnInstPath: string;
  sUnInstallString: String;
  Result := '';
  sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{{809B9E8D-0216-4263-83D9-B2A87E4AB658}_is1'); //Your App GUID/ID
  sUnInstallString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
  Result := sUnInstallString;

function IsUpgrade: Boolean;
  Result := (GetUninstallString() <> '');

function InitializeSetup(): Boolean;
var Path:string;
   //ResultCode: Integer;
    ErrorCode: Integer;
    V: Integer;
    iResultCode: Integer;
    sUnInstallString: string;
   // Checking if net.framework 3.5 is installed
  if not CheckDotNetFx() then
   if (MsgBox(ExpandConstant('{cm:dotnetmissing1}'), mbConfirmation, MB_YESNO) = idYes)then
    result := false;
  // Checking if  SQL SERVER CE 4.0 is installed
  if not CheckSSCE() then
   if (MsgBox(ExpandConstant('{cm:dotnetmissing2}'), mbConfirmation, MB_YESNO) = idYes)then
    result := false;

    Result := CheckIsReady();

  Result := True; // in case when no previous version is found
  if RegValueExists(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows\CurrentVersion\Uninstall\{809B9E8D-0216-4263-83D9-B2A87E4AB658}_is1', 'UninstallString') then  //Your App GUID/ID
    V := MsgBox(ExpandConstant('Earlier version detected - it should be removed. Would you like to remove it?'), mbInformation, MB_YESNO); //Custom Message if App installed
    if V = IDYES then
      //sUnInstallString := GetUninstallString();
      sUnInstallString :=  RemoveQuotes(sUnInstallString);
      Exec(ExpandConstant(sUnInstallString), '', '', SW_SHOW, ewWaitUntilTerminated, iResultCode);
      Result := True; //if you want to proceed after uninstall
                //Exit; //if you want to quit after uninstall
      Result := False; //when older version present and not uninstalled

Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

48 thoughts on “Creation installation file in Inno Setup

  1. Pingback: Homepage

  2. Pingback: number game

  3. Pingback: cá độ bóng đá ảo

  4. Pingback: số đề con chó

  5. Pingback: buy rishi turkey tail Magic Mushroom pills Capsules trip drug online for sale near me in USA Canada UK Australia overnight delivery cheap

  6. Pingback: trang web đánh lô đề uy tín

  7. Pingback: her response

  8. Pingback: nam mo thay ran danh con gi

  9. Pingback: game poker đổi thưởng

  10. Pingback: replica watch forums

  11. Pingback: Eat Verts

  12. Pingback: buy peyote cactu gta mescaline plant online for sale near me in USA Canada UK Australia overnight delivery cheap

  13. Pingback: Blazing Trader

  14. Pingback: English bulldog puppies for sale near me in CA ON MA CO OH PA SC MS TN FL UT NH VA AL TX

  15. Pingback: is bitcoin loophole a fake?

  16. Pingback: press brake machine

  17. Pingback: bitcoin era media review

  18. Pingback: bitcoin evolution

  19. Pingback: Gazzy Colon

  20. Pingback: SKBproductionsllc Film in Atlanta

  21. Pingback: bitcoin evolution

  22. Pingback: mơ thấy tiền đánh con gì

  23. Pingback: mơ thấy gạo đánh con gì

  24. Pingback: Pomsky breeders

  25. Pingback: Social Media Marketing

  26. Pingback: mo nhat duoc vang

  27. Pingback: Jungle Boys |Jungle Boys weed | Jungle Boys strains |Buy Jungle Boys Online | Jungle Boys Dispensary

  28. Pingback: SSCN BKN 2021 Kabupaten Bungo

  29. Pingback: mơ thấy thuyền đánh con gì

  30. Pingback: BP-12

  31. Pingback: AR-12 Pro

  32. Pingback: nằm mơ thấy máu

  33. Pingback: XFINITY Store by Comcast

  34. Pingback: nằm mơ thấy người thân bị bệnh

  35. Pingback: chiem bao thay lua

  36. Pingback: nằm mơ thấy rắn hổ mang đen

  37. Pingback: mơ thấy cá chép đánh con gì

  38. Pingback: xep hang 12 chom sao

  39. Pingback: mơ thấy mít chín đánh con gì

  40. Pingback: bảo bình hợp với cung nào nhất

  41. Pingback: cung song ngu nam

  42. Pingback: giải mã giấc mơ thấy người yêu cũ

  43. Pingback: giải mã ác mộng

  44. Pingback: mơ thấy đi xe đạp

  45. Pingback: tennis truc tuyen

  46. Pingback: mơ bị đứt tay

  47. Pingback: game dua ngua dat cuoc

  48. Pingback: Data Pengeluaran Sgp

Leave a Reply

Your email address will not be published. Required fields are marked *