Subversion Repositories Aluchemie.datataker

Rev

Rev 46 | Blame | Compare with Previous | Last modification | View Log | Download

; -- valmet.iss --
; Copyright (C) 2008 RLD Automation
; FL7.5.1, Windows 2003 + XP

#pragma option -v+
#pragma verboselevel 9
#pragma spansymbol "_"

#define Debug
#define Company "RLD Automation"
;OS version and SP required
#define SysVer "Windows 7 (with SP1 or higher)"

;Application definitions
#define AppName  "Datataker VS2012"
#define AppId    "DATATAKER"
#define AppShort "Datataker"
;#define BaseDir  "..\..\..\Flink"
#define AppVersion GetFileVersion("..\release\"+AppShort+".exe")

#define VCredist "Visual Studio redistributables X86"
#define dotNET ".NET redistributables"

;Entry for ctlist file
;#define CtList "val_pd_m val_pd_x val_pd_t val_pd_z val_pd_d"

;Key files to add
;#define Key1 "val_bus"
;#define Key2 "val_type"
;#define Key3 ""
;#define Key4 ""
;#define Key5 ""

;Message files to add
;#define Msg1 "valmet"
;#define Msg2 "valm_ac"
;#define Msg3 "Imx_ser"

[Setup]
AppName={#AppName}
AppVerName={#AppName} {#AppVersion}, for {#SysVer}
AppCopyright=Copyright © 2008 {#Company}.
AppPublisher={#Company}
AppPublisherURL=http://www.rldautomation.eu
AppSupportURL=http://www.rldautomation.eu
AppUpdatesURL=http://www.rldautomation.eu
;AppVersion=1.0 ;{#AppVersion}

OutputBaseFilename={#AppShort}Install{#AppVersion}
OutputDir=.\Setup

WizardImageFile=.\SetupModern23.bmp
WizardSmallImageFile=.\SetupModernSmall15.bmp

Uninstallable=yes
UninstallDisplayIcon={app}\{#AppShort}.exe
UninstallDisplayName={#AppName}
UninstallFilesDir={app}

LicenseFile=.\license.txt
InfoBeforeFile=.\infobefore.txt

PrivilegesRequired=poweruser
RestartIfNeededByRun=yes
;AlwaysRestart=yes
DisableStartupPrompt=yes
DisableProgramGroupPage=no
DiskSpanning=0
DefaultDirName={pf}\{#AppShort}
DefaultGroupName={#AppShort}
DirExistsWarning=no
;MinVersion=4,4
UsePreviousAppDir=yes
WizardStyle=modern
UninstallStyle=modern
WindowVisible=false
BackColor=clSilver
BackColor2=clBlack
BackColorDirection=toptobottom
;WizardDebug=no
AllowNoIcons=yes
UsePreviousTasks=no

[Types]
Name: compact; Description: Datataker program only installation
Name: full; Description: Full installation
Name: custom; Description: Custom installation; Flags: iscustom

[Components]
Name: main; Description: {#AppName} Program; Types: compact full custom; Flags: fixed
Name: manual; Description: {#AppShort}  User Guide; Types: full compact
Name: debug; Description: {#AppShort} Debug Viewer Support-files; Types: full 
Name: vcredist; Description: {#VCredist}; Types: full
;Name: dotnet; Description: {#dotNET}; Types: full

[Tasks]
;Name: startupicon; Description: "Start program after installation."; _
;      GroupDescription: "Additional options:"; Components: main;

[Files]
;Datataker files
Source: ..\release\{#AppShort}.exe; DestDir: {app}; Components: main
Source: ..\release\{#AppShort}.map; DestDir: {app}; Components: main
Source: ..\release\{#AppShort}.map; DestDir: {localappdata}\CrashDumps\DataTaker; Components: main

Source: ..\{#AppShort}.ini; DestDir: {app}; Flags: onlyifdoesntexist; Components: main
;Source: "MyProg-x64.exe"; DestDir: "{app}"; Check: IsWin64;
;Source: "MyProg-x86.exe"; DestDir: "{app}"; Check: "not IsWin64";

;Debug viewer
Source: ..\..\DbgView\*; DestDir: {app}; Flags: ignoreversion; Components: debug

;VS redistributables
Source: ..\..\VS-redistributables\vc2012redist_x86.exe; DestDir: {app}; Components: vcredist
Source: ..\..\VS-redistributables\vc2012redist_x64.exe; DestDir: {app}; Check: "IsWin64"; _
        Components: vcredist

;dotnet 3.x
;Source: ..\..\dotNET\dotnetfx3.exe; DestDir: {app}; Components: dotnet
;Source: ..\..\dotNET\dotnetfx35setup.exe; DestDir: {app}; Components: dotnet


;Documentation
Source: {src}\*.pdf; DestDir: {app}; _
        Flags: external; Components: manual

;Readme file
;Source: ..\Im_bas.txt; DestDir: "{app}"; Flags: isreadme; Components: main

[Registry]
;Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; _
;      ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{pf}\datataker"; _
;      Check: NeedsAddPath('{pf}\datataker')
;Minidump settings
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: none; ValueName: ""; ValueData: ""; _
      Components: main
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: expandsz; ValueName: "DumpFolder"; _
      ValueData: "%LOCALAPPDATA%\CrashDumps"; _
      Flags: createvalueifdoesntexist; Components: main
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: dword; ValueName: "DumpCount"; _
      ValueData: "10"; _
      Flags: createvalueifdoesntexist; Components: main
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: dword; ValueName: "DumpType"; _
      ValueData: "1"; _
      Flags: createvalueifdoesntexist; Components: main
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\{#AppShort}.exe"; _
      ValueType: none; ValueName: ""; ValueData: ""; _
      Flags: createvalueifdoesntexist; Components: main
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\{#AppShort}.exe"; _
      ValueType: expandsz; ValueName: "DumpFolder"; _
      ValueData: "%LOCALAPPDATA%\CrashDumps\{#AppShort}"; _
      Flags: createvalueifdoesntexist; Components: main
;Minidump x64
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: none; ValueName: ""; ValueData: ""; _
      Components: main; Check: "IsWin64";
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: expandsz; ValueName: "DumpFolder"; _
      ValueData: "%LOCALAPPDATA%\CrashDumps"; _
      Flags: createvalueifdoesntexist; Components: main; Check: "IsWin64";
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: dword; ValueName: "DumpCount"; _
      ValueData: "10"; _
      Flags: createvalueifdoesntexist; Components: main; Check: "IsWin64";
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps"; _
      ValueType: dword; ValueName: "DumpType"; _
      ValueData: "1"; _
      Flags: createvalueifdoesntexist; Components: main; Check: "IsWin64";
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\{#AppShort}.exe"; _
      ValueType: none; ValueName: ""; ValueData: ""; _
      Flags: createvalueifdoesntexist; Components: main; Check: "IsWin64";
Root: HKLM64; Subkey: "SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\{#AppShort}.exe"; _
      ValueType: expandsz; ValueName: "DumpFolder"; _
      ValueData: "%LOCALAPPDATA%\CrashDumps\{#AppShort}"; _
      Flags: createvalueifdoesntexist; Components: main; Check: "IsWin64";
      
[Icons]
Name: "{group}\DataTaker"; Filename: "{app}\datataker.exe"; WorkingDir: "{app}"
Name: "{group}\Debug Viewer"; Filename: "{app}\Dbgview.exe"; WorkingDir: "{app}"; Components: debug;
Name: "{commonstartup}\DataTaker"; Filename: "{app}\datataker.exe"; WorkingDir: "{app}"; 
;      Tasks: startupicon;

[Run]
Filename: {app}\vc2012redist_x86.exe; Parameters: /q; Flags: runhidden; _
          StatusMsg: Installing Visual Studion 2012 SP4 C++ redistributables x86...; _
          Components: vcredist
Filename: {app}\vc2012redist_x64.exe; Parameters: /q; Flags: runhidden; _
          StatusMsg: Installing Visual Studion 2012 SP4 C++ redistributables x64...; _
          Check: "IsWin64"; Components: vcredist
Filename: "{app}\datataker.exe"; Description: "Launch DataTaker application"; _
          Flags: postinstall nowait skipifsilent unchecked;
;Filename: {app}\bin\dotnetfx3.exe; Parameters: /q; Flags: runhidden; _
;          StatusMsg: Installing .NET redistributables...; Components: dotnet
;Filename: {app}\bin\dotnetfx35setup.exe; Parameters: /q; Flags: runhidden; _
;          StatusMsg: Installing .NET redistributables...; Components: dotnet

[UninstallRun]

[InstallDelete]

[Messages]
RunEntryShellExec=Yes, I would like to view the README file
BeveledLabel={#Company}

#ifdef Debug
  #expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed.iss")
#endif

[Code]

var
  DriverList: String;
  TaskName: String;
{  UserPage: TInputQueryWizardPage;   }
  UsagePage: TInputOptionWizardPage;
 { LightMsgPage: TOutputMsgWizardPage;  }
 { KeyPage: TInputQueryWizardPage;       }
 { ProgressPage: TOutputProgressWizardPage; }
 { DataDirPage: TInputDirWizardPage;         }
  FlVersion: String;

function InitializeSetup(): Boolean;
begin

  Result := True;
end;

procedure InitializeWizard;
begin
  { Create the pages }

{  UserPage := CreateInputQueryPage(wpWelcome,
    'Personal Information', 'Who are you?',
    'Please specify your name and the company for whom you work, then click Next.');
  UserPage.Add('Name:', False);
  UserPage.Add('Company:', False);
}
{  UsagePage := CreateInputOptionPage(wpWelcome,
    'FactoryLink Version Information', 'For which version are you installing the IM-BAS application?',
    'Please select the correct version of FactoryLink, then click Next.',
    True, False);}
  {UsagePage.Add('FactoryLink 7.0, or FactoryLink 7++');} {selection 0}
  {UsagePage.Add('FactoryLink 7.1');}                      {selection 1}
  {UsagePage.Add('FactoryLink 7.2');}                      {selection 2}
  {UsagePage.Add('FactoryLink 7.5');}                      {selection 3}

{  LightMsgPage := CreateOutputMsgPage(UsagePage.ID,
    'Personal Information', 'How will you use My Program?',
    'Note: to enjoy all features My Program can offer and to support its development, ' +
    'you can switch to sponsored or paid mode at any time by selecting ''Usage Mode'' ' +
    'in the ''Help'' menu of My Program after the installation has completed.'#13#13 +
    'Click Back if you want to change your usage mode setting now, or click Next to ' +
    'continue with the installation.');
 }
  {KeyPage := CreateInputQueryPage(UsagePage.ID,
    'Personal Information', 'What''s your registration key?',
    'Please specify your registration key and click Next to continue. If you don''t ' +
    'have a valid registration key, click Back to choose a different usage mode.');
  KeyPage.Add('Registration key:', False);

  ProgressPage := CreateOutputProgressPage('Personal Information',
    'What''s your registration key?');

  DataDirPage := CreateInputDirPage(wpSelectDir,
    'Select Personal Data Directory', 'Where should personal data files be installed?',
    'Select the folder in which Setup should install personal data files, then click Next.',
    False, '');
  DataDirPage.Add('');
  }
  { Set default values, using settings that were stored last time if possible }

  {case GetPreviousData('FlVersion', '') of
    'light': UsagePage.SelectedValueIndex := 0;
    'sponsored': UsagePage.SelectedValueIndex := 1;
    'paid': UsagePage.SelectedValueIndex := 2;
  else
    UsagePage.SelectedValueIndex := 3;
  end;}

  {DataDirPage.Values[0] := GetPreviousData('DataDir', '');}
end;


function rmNextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
begin
  { Validate certain pages before allowing the user to proceed }
  {if CurPageId = UsagePage.ID then begin
    case UsagePage.SelectedValueIndex of
      0: FlVersion := 'FL70';
      1: FlVersion := 'FL71';
      2: FlVersion := 'FL72';
      else
         FlVersion := 'FL75';
    end;
  end;}
  {if CurPageID = UserPage.ID then begin
    if UserPage.Values[0] = '' then begin
      MsgBox('You must enter your name.', mbError, MB_OK);
      Result := False;
    end else begin
      if DataDirPage.Values[0] = '' then
        DataDirPage.Values[0] := 'C:\' + UserPage.Values[0];
      Result := True;
    end;
  end else}
  {if CurPageID = KeyPage.ID then begin}
    { Just to show how 'OutputProgress' pages work.
      Always use a try..finally between the Show and Hide calls as shown below. }
{    ProgressPage.SetText('Authorizing registration key...', '');
    ProgressPage.SetProgress(0, 0);
    ProgressPage.Show;
    try
      for I := 0 to 10 do begin
        ProgressPage.SetProgress(I, 10);
        Sleep(100);
      end;
    finally
      ProgressPage.Hide;
    end;
    if KeyPage.Values[0] = 'inno' then
      Result := True
    else begin
      MsgBox('You must enter a valid registration key. (Hint: The key is "inno".)', mbError, MB_OK);
      Result := False;
    end;
  end else}
    Result := True;
end;

function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
begin
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon
  // Pos() returns 0 if not found
  Result := Pos(';' + UpperCase(Param) + ';', ';' + UpperCase(OrigPath) + ';') = 0;  
  if Result = True then
     Result := Pos(';' + UpperCase(Param) + '\;', ';' + UpperCase(OrigPath) + ';') = 0; 
end;