Skip to content

Instantly share code, notes, and snippets.

@filipeandre
Created June 20, 2018 14:41
Show Gist options
  • Save filipeandre/9012f1e1557518a908524a279f4a8428 to your computer and use it in GitHub Desktop.
Save filipeandre/9012f1e1557518a908524a279f4a8428 to your computer and use it in GitHub Desktop.
Inno Setup Compiller Example
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Smartdigit sage api configurator"
#define MyAppVersion "1.0.2.3-2017.02.005"
#define MyAppPublisher "SmartDigit – Unipessoal, Lda"
#define MyAppURL "http://smartdigit.pt"
#define MyAppExeName "Api.Sage.Configurator.exe"
[Setup]
; 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.)
AppId={{4766DF74-E354-4C2A-BC5B-B8C577F59177}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\inetpub\api.sage
DisableDirPage=yes
DisableProgramGroupPage=yes
OutputDir=C:\Users\Filipe\Desktop\Compiler
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "C:\Users\Filipe\Desktop\Update\bin\Api.Sage.Helper.exe"; DestDir: "{app}"; Flags: ignoreversion; BeforeInstall: TaskKill('Api.Sage.Helper.exe')
Source: "{app}\bin\data\Api.Sage.config"; DestDir: "{tmp}"; DestName: "Api.Sage.config"; Flags: external skipifsourcedoesntexist
Source: "C:\Users\Filipe\Desktop\Update\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{tmp}\Api.Sage.config"; DestDir: "{app}\bin\data\"; DestName: "Api.Sage.config"; Flags: external skipifsourcedoesntexist
[Code]
procedure TaskKill(FileName: String);
var
ResultCode: Integer;
begin
Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + FileName + '"', '', SW_HIDE,
ewWaitUntilTerminated, ResultCode);
end;
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\bin\{#MyAppExeName}"
[Run]
Filename: "{app}\bin\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: postinstall skipifsilent runascurrentuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment