; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{81DC8F0D-90A3-45ED-99BB-FD131088F854}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
DisableWelcomePage=no
DisableReadyMemo=yes
DisableReadyPage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
;Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "C:\DEV\HL\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Code]
const
MF_BYCOMMAND = 0;
MF_ENABLED = 0;
MF_GRAYED = 1;
MF_DISABLED = 2;
SC_CLOSE = 61536;
GCL_STYLE = -26;
CS_NOCLOSE = $200;
MF_BYPOSITION = $00000400;
type
HMENU = THandle;
function GetSystemMenu(hWnd: HWND; bRevert: BOOL): LongWord; external 'GetSystemMenu@user32.dll stdcall';
function EnableMenuItem(hMenu: THandle; uIDEnableItem: Longword; uEnable: Longword): Boolean; external 'EnableMenuItem@user32.dll stdcall';
function GetClassLong(Wnd: HWnd; Index: Integer): Longint; external 'GetClassLongA@user32.dll stdcall';
function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetClassLongA@user32.dll stdcall';
function DeleteMenu(hMenu: HMENU; uPosition, uFlags: UINT): BOOL; external 'DeleteMenu@user32.dll stdcall';
function GetMenuItemCount(hMenu: HMENU): Integer; external 'GetMenuItemCount@user32.dll stdcall';
procedure CurPageChanged(CurPageID: Integer);
begin
EnableMenuItem(GetSystemMenu(WizardForm.Handle, false), SC_CLOSE, MF_DISABLED or MF_BYCOMMAND);
if CurPageID = wpinstalling then
WizardForm.CancelButton.Enabled := False;
// Замена кнопки "Next" на "Install" (Требуеться для отключения компонента DisableReadyMemo)
if (CurPageID = wpSelectDir) or (CurPageID = wpReady) then
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
else if (CurPageID = wpFinished) then
WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
else
WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Cancel:= true;
Confirm:= false;
end;
procedure InitializeWizard;
var
SystemMenu: HMENU;
begin
SystemMenu := GetSystemMenu(WizardForm.Handle, False);
DeleteMenu(SystemMenu, 9999, MF_BYCOMMAND);
DeleteMenu(SystemMenu, GetMenuItemCount(SystemMenu)-1, MF_BYPOSITION);
//
SetClassLong(WizardForm.Handle, GCL_STYLE, GetClassLong(WizardForm.Handle, GCL_STYLE) or CS_NOCLOSE);
end;