Files
cms_thermo_active/Step/SetupActive.iss
T
Lucio Maranta a5cc072d4e Fix setup:
Added mariaDb installation
2019-04-12 13:05:27 +02:00

202 lines
9.8 KiB
Plaintext

;================================= 09-04-2019 =====
; CMS S.p.A. - UX-HMI Office
;
; Setup for Active
; Inno Setup Compiler version 5.6.0
;==================================================
#define MyAppName "Active"
#define MyAppVersion "1.0"
#define MyAppPublisher "CMS"
#define MyAppURL "https://www.scmgroup.com/it/cms"
#define MyAppExeName "Active.exe"
#define MySourcePath "C:\Workspace\CMS_STEP\Step\bin"
#define WwwRootPath "C:\Workspace\CMS_STEP\Step\wwwroot"
#define MyOtherAppPath "C:\CMS"
#define SinumerikPath1 "{pf}\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\"
#define SinumerikPath2 "C:\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\"
#define SinumerikPath3 "{pf}\Siemens\MotionControl\siemens\sinumerik\hmi\autostart\"
#define SinumerikAppName "Sinumerik HMI"
#define SinumerikAppExeName "run_hmi.exe"
; Support installers
; .Net
#define DotNetInstallerPath "C:\Users\marantalu\Desktop\Per installazioni Active\"
#define DotNetInstallerName "NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
; MariaDb
#define MariaDBInstallerPath "C:\Users\marantalu\Desktop\Per installazioni Active\"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\CMS\{#MyAppName}
DisableDirPage=false
DisableProgramGroupPage=yes
Compression=lzma
SolidCompression=true
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription={#MyAppName}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoCopyright={#MyAppPublisher}
;WizardImageFile=C:\Programmi\Inno Setup 5\WizModernImage-IS.bmp
;WizardSmallImageFile=C:\Programmi\Inno Setup 5\CMS.bmp
WindowVisible=false
PrivilegesRequired=admin
; Setup installation type
[Types]
Name: custom; Description: Custom installation; Flags: iscustom
; Set NC types, this types are used to configure server config file
[Components]
Name: Demo; Description: {#MyAppName} {cm:ForDemoNC}; Types: custom; Flags: exclusive
Name: Fanuc; Description: {#MyAppName} {cm:ForFanucNC}; Types: custom; Flags: exclusive
Name: Osai; Description: {#MyAppName} {cm:ForOsaiNC}; Types: custom; Flags: exclusive
Name: Siemens; Description: {#MyAppName} {cm:ForSiemensNC}; Types: custom; Flags: exclusive
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
[CustomMessages]
english.CreateStartupIcon=Create Startup &icon
english.CreateSinumerikIcons=Create &Sinumerik HMI icons
english.ForDemoNC=for DEMO NC
english.ForFanucNC=for FANUC NC
english.ForOsaiNC=for OSAI NC
english.ForSiemensNC=for SIEMENS NC
italian.CreateStartupIcon = Crea il collegamento in &Esecuzione Automatica
italian.CreateSinumerikIcons = Crea le icone di &Sinumerik HMI
italian.ForDemoNC=per CN DEMO
italian.ForFanucNC=per CN FANUC
italian.ForOsaiNC=per CN OSAI
italian.ForSiemensNC=per CN SIEMENS
english.InstallDotNet = Install .Net 4.6.2
english.InstallMariaDB = Install MariaDB
italian.InstallDotNet = Installa .Net 4.6.2
italian.InstallMariaDB = Installa MariaDB
italian.InstallingMariaDB = Installando MariaDB
english.InstallingMariaDB = Installing MariaDB
italian.InstallingDotNet = Installando .Net
english.InstallingDotNet = Installing .Net
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; Components: Demo Fanuc Osai Siemens
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Demo Fanuc Osai Siemens
Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Fanuc Osai
Name: sinumerikicons; Description: {cm:CreateSinumerikIcons}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Siemens
[Files]
Source: "{#MySourcePath}\Active.exe"; DestDir: "{app}"; Flags: ignoreversion
; Path to exe resources (dll, xml, config)
Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
; Configuration files
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
; Osai Library
Source: "{#MySourcePath}\CndexLinkDotNet.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Osai
; Languages
Source: "{#MySourcePath}\Language\*.*"; DestDir: "{app}\Language\"; Flags: ignoreversion; Components: Osai
Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
; Client copy
Source: "{#MySourcePath}\Client\x64\*.*"; DestDir: "{app}\Client\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens
; WWWRoot Files
Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Demo Fanuc Osai Siemens
; WWWRoot Directories
Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens
Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion; Components: Demo Fanuc Osai Siemens
;.Net Installer
;Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled
Source: {#MariaDBInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
[Icons]
; Default icons
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Comment: {#MyAppName}; Components: Demo Fanuc Osai
Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai
Name: {userstartup}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai
; Siemens startup icon with parameters "-start ..."
Name: {group}\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#MyAppName}; Components: Siemens
Name: {userdesktop}\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Comment: {#MyAppName}; Components: Siemens
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Comment: {#MyAppName}; Components: Siemens
[Run]
; Install .net
Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; Check: FrameworkIsNotInstalled
; Install MariaDb
Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}"
[Code]
///////////// SiemensPath ///////////////////////////////
function SiemensPath(S: String): string;
var
sSiemensPath: string;
sSelectedSinumerikDir: string;
begin
if DirExists(ExpandConstant('{#SinumerikPath3}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath3}')
else if DirExists(ExpandConstant('{#SinumerikPath2}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath2}')
else if DirExists(ExpandConstant('{#SinumerikPath1}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath1}')
else
begin
if (sSelectedSinumerikDir = '') then
BrowseForFolder('Sinumerik folder not found!'#13#10'Select Sinumerik folder containing run_hmi.exe'#13#10'ex: '+ExpandConstant('{#SinumerikPath1}'), sSelectedSinumerikDir, False);
sSiemensPath := sSelectedSinumerikDir + '\' ;
end;
Result := sSiemensPath ;
end;
function FrameworkIsNotInstalled: Boolean;
begin;
Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0');
end;
//procedure InstallFramework;
//var
// ResultCode: Integer;
//begin
// WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNet');
// WizardForm.ProgressGauge.Style := npbstMarquee;
// if not Exec(ExpandConstant('{tmp}\{#DotNetInstallerName}'), '/noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
// begin
// MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
// mbError, MB_OK);
// end;
//end;
//
//procedure InstallMariaDB;
//var
// ResultCode: Integer;
//begin
// WizardForm.StatusLabel.Caption := CustomMessage('InstallingMariaDB');
// WizardForm.ProgressGauge.Style := npbstMarquee;
// if not Exec(ExpandConstant('msiexec.exe'), '/i {tmp}\{#MariaDBInstallerName}', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
// begin
// MsgBox('MariaDb failed with code: ' + IntToStr(ResultCode) + '.',
// mbError, MB_OK);
// end;
//end;
//