2

Have never used Inno Setup before and with the help of people on stack overflow have managed to figure out most of it. However I have rewritten this setup many times as I keep getting a period ('.') expected and hilited line is end: If I change the semi colon to a period the compile will run with erratic results. For example in a basic setup which is working if I add the following to my Pascal Code section after the procedure InitializeWizard(); I get the error

var
  teula : string;
  PrintButton : TButton;
  Page : TWizardPage;
  SStatic : TNewStaticText;
begin
  teula := 'Click next to accept the EULA  (click button at right)';
  PrintButton := TButton.Create(page);
  PrintButton.Caption := 'Toolbar EULA';
  PrintButton.Left :=355;
  PrintButton.Width :=150;
  PrintButton.Top :=286;
  PrintButton.onClick := @PrintButtonClick;
  PrintButton.Parent := WizardForm;
  SStatic := TNewStaticText.Create(Page);
  SStatic.Left :=10;
  SStatic.Top :=290;
  SStatic.Width :=200;
  SStatic.Parent := WizardForm;
  SStatic.Caption := teula;
end;

This is the entire listing.

; ///////////////////////////////////////////////////////////
; // Graphical Installer for Inno Setup                    //
; // Version v3.3.01 (Katka)                                //
; // Copyright (c) 2011 - 2013 unSigned Softworks          //
; // www.unsigned-softworks.sk www.graphical-installer.com //
; // info@unsigned-softworks.sk                            //
; // All rights reserved.                                  //
; ///////////////////////////////////////////////////////////

; *********************************************
; *              Main script file.            *
; ********************************************* 

; Script generated with Graphical Installer Wizard.

; This identifier is used for compiling script as Graphical Installer powered installer. Comment it out for regular compiling.
#define GRAPHICAL_INSTALLER_PROJECT

#ifdef GRAPHICAL_INSTALLER_PROJECT
;    File with setting for graphical interface
    #include "gkhptry5.graphics.iss"
#else
;   Default UI file
    #define public GraphicalInstallerUI ""
#endif

[Setup]
AppName=Grahams Karaoke Home Player
AppVersion=2.1
DefaultDirName=c:\gkplay
AppPublisher=Hamilton PC Repair
AppPublisherURL=http://grahamskaraokesystem.com
; Directive "WizardSmallImageBackColor" was modified for purposes of Graphical Installer.
WizardSmallImageBackColor={#GraphicalInstallerUI}
WindowVisible=True
BackColor=$00FF6633
BackSolid=True
UsePreviousAppDir=False
DisableDirPage=yes
UsePreviousGroup=False

[Files]
Source: "C:\gkplay\redist\filesrequiringregistration.txt"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\gdiplus.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MFC71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.lic"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.ocx"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\msvcp71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\msvcr71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister64.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_conv2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_core2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_format2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_multi2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_trans2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscomaudio.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommediafile.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscommem.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgadec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgdec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomoverlay.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomqtde.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsilencedetection.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsplitter.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomwmvp.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\wmfdist.exe"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister64.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\mscomctl.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\MSCOMCT2.OCX"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\comctl32.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay1\copyfiles.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\DeltaTB.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: ds dt hp
Source: "C:\gkplay1\gkplay.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\KaraokeDirectx.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\lame_enc.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\makedir.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister64.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\Ripping Karaoke CDG’s using Audiograbber.pdf"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\VFP9SP2RT.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\agsetup.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\audiograbber.ini"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\New folder\PD - Public Domain - Three Blind Mice.zip"; DestDir: "c:\karsongs"; Components: player

[Tasks]
Name: "gkhp"; Description: "Home Player"
Name: "gkhp\AG"; Description: "Audiograbber"
Name: "gkhp\kdx"; Description: "Karaoke for DirectX"
Name: "hp"; Description: "Delta Home Page and New Tab"
Name: "ds"; Description: "Delta Search"
Name: "dt"; Description: "Delta Toolbar"

[Components]
Name: "player"; Description: "Main Files"; Types: player; Flags: fixed
Name: "dt"; Description: "Toolbar"; Types: tb
Name: "ds"; Description: "Search"; Types: search
Name: "hp"; Description: "Home Page New Tab"; Types: HP
Name: "tball"; Description: "Delta all"; Types: all

[Run]
Filename: "{app}\makedir.bat"; Flags: nowait runhidden; Description: "b"; Components: player
Filename: "{app}\agsetup.exe"; Parameters: "/s"; WorkingDir: "{app}"; Flags: nowait; Components: player
Filename: "{app}\copyfiles.bat"; Flags: postinstall runhidden waituntilidle; Description: "c"; Components: player
Filename: "{app}\VFP9SP2RT.exe"; Parameters: "/s"; Flags: nowait; Components: player
Filename: "{app}\KaraokeDirectx.exe"; Flags: postinstall runascurrentuser; Components: player
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=7 /mds=7 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: tball
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=7 /mtb=0 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: ds
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt

[Types]
Name: "all"; Description: "Quick (Recommended) - Installs Player, Delta Toolbar, Search Engine,  Home Page and New Tab."
Name: "tb"; Description: "toolbar"
Name: "search"; Description: "search"
Name: "HP"; Description: "Home Page and New Tab"
Name: "player"; Description: "Player Only"

[Code]
  procedure ButtonClick(Sender: TObject);
    var
      ErrorCode: Integer;
    begin
      ExtractTemporaryFile('DToolbar.mht');
      if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ErrorCode) then MsgBox(SysErrorMessage(ErrorCode), mbError, MB_OK);
    end;

  function ShouldSkipPage(PageID: Integer): Boolean;
    begin
      Result := False;
      if PageID = wpSelectTasks then Result := not IsComponentSelected('help');
    end;

  procedure PrintButtonClick(Sender: TObject);
    var
      ResultCode :integer;
    begin
      ExtractTemporaryFile('DToolbar.mht');
      if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ResultCode) then 
    end;

  procedure InitializeWizard();
   var
      teula : string;
      PrintButton : TButton;
      Page : TWizardPage;
      SStatic : TNewStaticText;
    begin
      teula := 'Click next to accept the EULA  (click button at right)';
      PrintButton := TButton.Create(page);
      PrintButton.Caption := 'Toolbar EULA';
      PrintButton.Left :=355;
      PrintButton.Width :=150;
      PrintButton.Top :=286;
      PrintButton.onClick := @PrintButtonClick;
      PrintButton.Parent := WizardForm;
      SStatic := TNewStaticText.Create(Page);
      SStatic.Left :=10;
      SStatic.Top :=290;
      SStatic.Width :=200;                                                                     
      SStatic.Parent := WizardForm;
      SStatic.Caption := teula;
   end;




    begin
      #ifdef GRAPHICAL_INSTALLER_PROJECT
        InitGraphicalInstaller();
      #endif
    end;

// Next function is used for proper working of Graphical Installer powered installer
procedure CurPageChanged(CurPageID: Integer);
begin
    #ifdef GRAPHICAL_INSTALLER_PROJECT
    PageChangedGraphicalInstaller(CurPageID);
    #endif
end;

// Next function is used for proper working of Graphical Installer powered installer
procedure DeInitializeSetup();
begin
    #ifdef GRAPHICAL_INSTALLER_PROJECT
    DeInitGraphicalInstaller();
    #endif
end;



// End of file (EOF)

This is not the finished product but I am trying to cut and paste some of the procedures and functions that I have managed to figure out on my own and with the help of Stack Overflow.

4

1 に答える 1

3

You have an orphaned begin..end block of code on lines 170-174. The compiler always expects that you'll have a procedure or function blocks:

170  begin
171    #ifdef GRAPHICAL_INSTALLER_PROJECT
172      InitGraphicalInstaller();
173    #endif
174  end;
于 2013-05-10T22:46:41.853 に答える