;================================= 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 IconsPath "C:\Workspace\CMS_STEP\Step\Desktop_Link\" #define SCMIcoName "SCM.ico" #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=true 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: CMS 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; ;Check: FrameworkIsNotInstalled Source: {#MariaDBInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall; [Icons] ; Default icons Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; Name: {userstartup}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: NOT GetStyleOption; ; Siemens startup icon with parameters "-start ..." Name: {group}\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Comment: {#MyAppName}; Components: Siemens; Check: NOT GetStyleOption; Name: {userdesktop}\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Comment: {#MyAppName}; Components: Siemens; Check: NOT GetStyleOption; 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; Check: NOT GetStyleOption; ; Default icons Name: {group}\{#MyAppName}; Filename: {#IconsPath}{#SCMIcoName}; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; Name: {userdesktop}\{#MyAppName}; Filename: {#IconsPath}{#SCMIcoName}; Tasks: desktopicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {#IconsPath}{#SCMIcoName}; Tasks: quicklaunchicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; Name: {userstartup}\{#MyAppName}; Filename: {#IconsPath}{#SCMIcoName}; Tasks: startupicon; Comment: {#MyAppName}; Components: Demo Fanuc Osai; Check: GetStyleOption; ; SCM Siemens startup icon with parameters "-start ..." Name: {group}\{#MyAppName}; Filename: {#IconsPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Comment: {#MyAppName}; Components: Siemens; Check: GetStyleOption; Name: {userdesktop}\{#MyAppName}; Filename: {#IconsPath}{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName}; Tasks: desktopicon; Comment: {#MyAppName}; Components: Siemens; Check: GetStyleOption; Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {#IconsPath}{#SCMIcoName};Tasks: quicklaunchicon; Comment: {#MyAppName}; Components: Siemens; Check: GetStyleOption; [Run] ; Install .net Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; ;Check: NetFrameworkIsMissing ; Install MariaDb Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}" [Code] ///////////// SiemensPath /////////////////////////////// var CheckBoxIni: TCheckBox; CustomInputOptionCMSorSCM: TInputOptionWizardPage; IsSCM: Boolean; function GetStyleOption: Boolean; begin Result := IsSCM; end; ////////////////// GetSiemens Path /////////////////// 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; ///////////////// FrameworkIsNotInstalled //////////////////////////////////// function FrameworkIsNotInstalled: Boolean; begin; Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0'); end; function NetFrameworkIsMissing(): Boolean; var bSuccess: Boolean; regVersion: Cardinal; begin Result := True; bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion); if (True = bSuccess) and (regVersion >= 394802) then begin Result := False; end; end; ///////////////// CreateCustomInputOptionCMsorSCM ////////////////////////// procedure CreateCustomInputOptionCMSorSCM; begin CustomInputOptionCMSorSCM := CreateInputOptionPage(wpSelectComponents, 'Seleziona lo stile:', '', '', True, False); //Add Fields CustomInputOptionCMSorSCM.Add('CMS'); CustomInputOptionCMSorSCM.Add('SCM'); // Set initial values (optional) CustomInputOptionCMSorSCM.Values[0] := True; end; ///////////// InitializeWizard ////////////////////////// procedure InitializeWizard(); begin CreateCustomInputOptionCMSorSCM; end; procedure CurStepChanged(CurStep: TSetupStep); begin if CustomInputOptionCMSorSCM.Values[0] then IsSCM := false else IsSCM := true end;