Blame | Last modification | View Log
; -- im_bas.iss --; Copyright (C) 2016 RLD Automation; SQLscripter, Windows 2008, 7, 2012, SQL 2000, 2005, 2012, 2014#pragma option -v+#pragma verboselevel 9#define Debug#define Company "RLD Automation";FactoryLink version#define FlVer "Fl802";FactoryLink and/or OS version and SP required#define SysVer "FL8.0.2 Windows Windos XP (with SP2 or higher), Windows Server 2003/2008 (x86)";Application definitions#define AppName "SQL scripter"#define AppId "ISO-TP4"#define AppShort "iso_tp4"#define BaseDir "..\..\..\Flink"#define FlAppVersion GetFileVersion(BaseDir+"\Bin\"+FlVer+"\"+AppShort+".exe")#define VCredist "Visual Studio 2012 redistributables X86";Entry for ctlist file#define CtList "iso_tp4m iso_tp4x iso_tp4p iso_tp4d";Key files to add#define Key1 "iso_tp4"#define Key2 "tp4_prio"#define Key3 "tp4_type";Message files to add#define Msg1 "iso_tp4"#define Msg2 "isotp_ac"#define Msg3 ""[Setup]AppName={#AppName}AppVerName={#AppName} {#FlAppVersion}, for {#SysVer}AppCopyright=Copyright © 2005 {#Company}.AppPublisher=RLD AutomationAppPublisherURL=http://www.rldautomation.euAppSupportURL=http://www.rldautomation.euAppUpdatesURL=http://www.rldautomation.euAppVersion=3.1 ;{#FlAppVersion}OutputBaseFilename={#AppShort}InstallOutputDir=..\..\Setup\{#FlVer}WizardImageFile=..\Tecnomatix.bmpWizardSmallImageFile=..\SetupModernSmall25.bmpUninstallable=yesUninstallDisplayIcon={app}\{#AppShort}.exeUninstallDisplayName={#AppName}UninstallFilesDir={app}LicenseFile=..\license.txtInfoBeforeFile=..\infobefore.txtPrivilegesRequired=adminRestartIfNeededByRun=yesDisableStartupPrompt=yesDisableProgramGroupPage=yesDiskSpanning=0DefaultDirName={code:GetPrgDir|{pf}\{#AppShort}};DefaultGroupName={#Company}DirExistsWarning=no;MinVersion=4,4UsePreviousAppDir=yesWizardStyle=modernUninstallStyle=modernWindowVisible=falseBackColor=clSilverBackColor2=clBlackBackColorDirection=toptobottom;WizardDebug=no[Types]Name: "full"; Description: "Full installation";Name: "compact"; Description: "Compact installation"Name: "custom"; Description: "Custom installation"; Flags: iscustom[Components]Name: "main"; Description: "ISO-TP4 Driver"; Types: full custom; Flags: fixedName: manual; Description: {#AppShort} Task Manual; Types: fullName: vcredist; Description: {#VCredist}; Types: fullName: debug; Description: {#AppShort} Task Debug Support-files; Types: full[Files];FactoryLink filesSource: {#BaseDir}\Bin\{#FlVer}\{#AppShort}.exe; DestDir: {app}\bin; Flags: ignoreversion; Components: mainSource: {#BaseDir}\Bin\{#FlVer}\{#AppShort}.map; DestDir: {app}\bin; Flags: ignoreversion; Components: debug;Debug viewerSource: d:\Tecnomatix\Projects\DbgView\*; DestDir: {app}\bin; Flags: ignoreversion; Components: debug;VS redistributablesSource: ..\..\..\..\vcredist\vcredist2012_x86.exe; DestDir: {app}\bin; Components: vcredist;DocumentationSource: {src}\{#AppShort}.pdf; DestDir: {app}\..\Documentation\English; Flags: external skipifsourcedoesntexist; Components: manual;Source: ..\im_bas.exe; DestDir: {app}\bin; DestName: ReadMeIm_bas.exe; Flags: isreadme; Components: main;Protection managementSource: {#BaseDir}\bin\inst_seq.exe; DestDir: {app}; Flags: deleteafterinstall; Components: mainSource: {#BaseDir}\opt\rld.opt; DestDir: {app}\opt; Flags: onlyifdoesntexist; Components: mainSource: {src}\wizard.opt; DestDir: {app}; Flags: deleteafterinstall external skipifsourcedoesntexist; Components: main;Honeywell IPC620 systemsSource: {#BaseDir}\plc\ipc620\*; DestDir: {app}\plc\ipc620; Components: main;SIEMENS S5 PLC'sSource: {#BaseDir}\plc\s5\*; DestDir: {app}\plc\s5; Components: main;SIEMENS S7 S300 and S400 rangeSource: {#BaseDir}\plc\s7\SinecH1.zip; DestDir: {app}\plc\s7; Components: main;Readme fileSource: ..\Iso-Tp4.txt; DestDir: "{app}"; Flags: isreadme; Components: main[Registry]Root: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: ""; ValueData: "NC_TASKGROUP"; Flags: noerror createvalueifdoesntexist; Components: mainRoot: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: "Opened Icon"; ValueData: "folderclosed"; Flags: createvalueifdoesntexist; Components: mainRoot: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: "Closed Icon"; ValueData: "folderopened"; Flags: createvalueifdoesntexist; Components: mainRoot: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: "Description"; ValueData: "Task Group"; Flags: createvalueifdoesntexist; Components: mainRoot: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: "TG_CAPTION Device Interfaces"; ValueData: "Device Interfaces"; Flags: createvalueifdoesntexist; Components: mainRoot: HKLM; Subkey: "SOFTWARE\Tecnomatix\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP"; ValueType: String; ValueName: "Task Group Device Interfaces"; ValueData: "{code:GetDriverString}"; Components: main[Icons][Run]Filename: {app}\bin\acctmgr.exe; Parameters: -c -d -v; Check: AddTitle('{#AppShort},{#CtList}'); Flags: runhidden; StatusMsg: Updating FactoryLink account manager index...; Components: mainFilename: {app}\inst_seq.exe; Parameters: -M{#AppId} -S{app}\wizard.opt; Flags: runhidden; StatusMsg: Updating Wizard protection...; Components: mainFilename: {app}\bin\mkhelp.exe; Flags: runhidden; StatusMsg: Updating FactoryLik help file index...; Components: mainFilename: {app}\bin\vcredist2012_x86.exe; Parameters: /q; Flags: runhidden; StatusMsg: Installing Visual Studio 2012 C++ redistributables...; Components: vcredist[UninstallRun]Filename: {app}\bin\RLDTitle.exe; Parameters: " /REMOVE={#AppId}"; Flags: runhidden; StatusMsg: Updating FactoryLink account manager index...; Components: mainFilename: {app}\bin\acctmgr.exe; Parameters: -c -d -v; Check: RemoveTitle('{#AppShort}'); Flags: runhidden; StatusMsg: Updating FactoryLink account manager index...; Components: main[InstallDelete][Messages]RunEntryShellExec=Yes, I would like to view the README fileBeveledLabel={#Company}#ifdef Debug#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed.iss")#endif[Code]varDriverList: String;TaskName: String;function InitializeSetup(): Boolean;beginTaskName := '{#AppShort}';RegQueryStringValue(HKLM, 'SOFTWARE\USDATA\FactoryLink\Configuration Explorer\Menus\Node Classes\NC_TASKGROUP', 'Task Group Drivers', DriverList);if (DriverList = '') then beginDriverList := 'opcexp,opcclnt,ioxlator,edi_dev,te__,mb_plus,mbus,modp,mbustcp,sqrd,ab__,ab__rapd,netdtl,ktdtl,gene,asyn,omrn,sdrv,siem,h1mp,ti__,omux,ov60,mist,ldnr,t405,reli,gem_,dan2,eibi,apac2,bn90,dmod,es__,moor,rocm,tmdm,rmdm,hdp_rocm,bris,profibus,sinec_h1,s_3964r,stple,stplcnfg,Flgmmsg,Flgmport,Flgmproc,Flgmrprt,te__load,te__drq,eths,jbus,ucini,ucdef,ucref,ksv24ini,ksv24def,ksv24ref,comwiz,Mecomdef,Mecomrd,Mecomwr,odx,eci00,eci01,eci02,eco,S7D';end;if (Pos(TaskName, DriverList) = 0) then beginDriverList := DriverList + ',' + TaskName;end;Result := True;end;function GetDriverString(DefaultInput: String): String;begin{ Return the driver list }Result := DriverList;end;{Read the FactoryLink directory from the autostart service program location,using the environment variable FLINK will result in a directory withshort names. By using the autostart server the long names are found, andthe setup progam will use these names instead of the notation in short}function GetPrgDir(S: String): String;varMyDir: String;begin{read the autostart service directory, filename and extension}RegQueryStringValue( HKEY_LOCAL_MACHINE, 'System\CurrentControlSet\Control\Session Manager\Environment', 'FLINK', MyDir);{return default in case no directory is found}if (Length( MyDir) <= 0) then beginMyDir := S;end;{return the directory to install the program}Result := MyDir;end;{Add a AC line for the current task to the titles file, add a lineto the CTlist file. The taskname and ct-line are specified in thefunction-parameter: taskname,ct-line}function AddTitle( MyEntry: String): Boolean;varMyText: TArrayOfString;MyFile: String;MyAC: String;MyCT: String;k: Integer;bText: Boolean;found: Integer;begin{first file to load is th etitles file in the AC directory}MyFile := GetPrgDir( '') + '\ac\titles';bText := LoadStringsFromFile( MyFile, MyText);{AC entry looks like: taskname.ac}k := Pos( ',', MyEntry);if k = 0 then k := Pos( ':', MyEntry);MyAC := Copy( MyEntry, 0, k-1) + '.ac';MyCT := MyEntry;StrSet( ':', k, MyCt);{search for ac entry}found := 0;k := 0;while (k < GetArrayLength(MyText)) and (found = 0) do beginfound := Pos( MyAC, MyText[ k]);k := k + 1;end;{if the entry is not found, add a line to the titles file}if (found = 0) then beginSetArrayLength(MyText, GetArrayLength(MyText)+1);MyText[ GetArrayLength(MyText)-1] := MyAC;SaveStringsToFile( MyFile, MyText, false);end;{add entry to ctlist file}MyFile := GetPrgDir( '') + '\ctgen\ctlist';bText := LoadStringsFromFile( MyFile, MyText);{search for ctgen entry}found := 0;k := 0;while (k < GetArrayLength(MyText)) and (found = 0) do beginfound := Pos( MyCT, MyText[ k]);k := k + 1;end;{if the entry is not found, add a line to the ctlist file}if (found = 0) then beginSetArrayLength(MyText, GetArrayLength(MyText)+1);MyText[ GetArrayLength(MyText)-1] := MyCT;SaveStringsToFile( MyFile, MyText, false);end;{return always true, ac file must be installed, this functiononly adds a line to the titles file}Result := True;end;{Remove a AC line for the current task in the titles file, and removea line in the CTlist file the entry is specified with the task namein the function-parameter}function RemoveTitle( MyEntry: String): Boolean;varMyText: TArrayOfString;MyFile: String;MyAC: String;MyCT: String;Temp: String;k: Integer;found: Integer;bText: Boolean;beginMyAC := MyEntry + '.ac';MyCT := MyEntry + ':';{search the task name in the ctlist file}MyFile := GetPrgDir( '') + '\ctgen\ctlist';SetArrayLength( MyText, 0);bText := LoadStringsFromFile( MyFile, MyText);{search for the task name}for k:=0 to GetArrayLength(MyText)-1 do beginTemp := MyText[ k];if (found = 0) thenfound := Pos( MyCT, MyText[ k]);{if the entry is found, remove the line from the titles file}if (found <> 0) then beginif ((k+1) < GetArrayLength(MyText)) then beginMyText[ k] := MyText[ k+1];end else {begin;}MyText[ k] := '';end;end;if (found <> 0) then begin{shorten array with one}SetArrayLength( MyText, GetArrayLength( MyText) - 1);SaveStringsToFile( MyFile, MyText, false);end;{search the task name in the titles file}MyFile := GetPrgDir( '') + '\ac\titles';bText := LoadStringsFromFile( MyFile, MyText);found := 0;{search for the task name}for k:=0 to GetArrayLength(MyText)-1 do beginTemp := MyText[ k];if (found = 0) thenfound := Pos( MyAC, MyText[ k]);{if the entry is found, remove the line from the titles file}if (found <> 0) then beginif ((k+1) < GetArrayLength(MyText)) then beginMyText[ k] := MyText[ k+1];end else {begin;}MyText[ k] := '';end;end;if (found <> 0) then begin{shorten array with one}SetArrayLength( MyText, GetArrayLength( MyText) - 1);SaveStringsToFile( MyFile, MyText, false);end;{return always true, ac file must be removed}Result := True;end;