Когда я начинаю создавать мне выдаёт ошибку. Что то не так. Знаю что ошибка в разделе code. Что там надо исправить? [more]
[Setup]
AppName=Counter-Strike Source
AppVerName=Counter-Strike Source 1.0.0.59
AppPublisher=Valve
AppPublisherURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
AppSupportURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
AppUpdatesURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
DefaultDirName=\Program Files\Valve\Counter-Strike Source
DefaultGroupName=Counter-Strike Source
AllowNoIcons=yes
LicenseFile=D:\Files\Rumyantsev\valve\css\readme Counter-Strike Source.txt
OutputDir=D:\css
OutputBaseFilename=setup
SetupIconFile=D:\Files\Rumyantsev\valve\css\autorun.ico
Compression=lzma
SolidCompression=true
DiskSpanning=true
DiskSliceSize=210000000
AppID={{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}
UninstallDisplayIcon={app}D:\css\css_1.ico
WizardSmallImageFile=D:\css\css_2.bmp
WizardImageFile=D:\css\css_1.bmp
[Languages]
Name: russian; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: D:\css\css_1.ico; DestDir: {app}
Source: D:\css\css_1.ico; DestDir: {app}
Source: D:\Program Files\Valve\Counter-Strike Source\Run_CSS.exe; DestDir: {app}; Flags: ignoreversion
Source: D:\Program Files\Valve\Counter-Strike Source\*; DestDir: {app}; Flags: ignoreversion
; IOIAOUOA: Ia eniieucoeoa "Oea?ee: I?ieaii?e?iaaou aa?ne?" ia e?auo iauaainooiiuo nenoaiiuo oaeeao
[Icons]
Name: {group}\Counter-Strike Source; Filename: {app}\Run_CSS.exe
Name: {group}\{cm:ProgramOnTheWeb,Counter-Strike Source}; Filename: http://forum.freedom-vrn.ru/viewforum.php?f=59
Name: {group}\{cm:UninstallProgram,Counter-Strike Source}; Filename: {uninstallexe}
Name: {commondesktop}\Counter-Strike Source; Filename: {app}\Run_CSS.exe; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Counter-Strike Source; Filename: {app}\Run_CSS.exe; Tasks: quicklaunchicon
[Run]
Filename: {app}\Run_CSS.exe; Description: {cm:LaunchProgram,Counter-Strike Source}; Flags: nowait postinstall skipifsilent
[Dirs]
Name: {app}; Attribs: system; AfterInstall: CreateIni()
[code]
procedure CreateIni();
begin
SaveStringsToFile(ExpandConstant('{app}\Desktop.ini'), ['[.ShellClassInfo]',
'IconFile=%SystemRoot%\system32\SHELL32.dll',
'IconIndex=27'], False)
end;
type TSystemTime = record wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: Word; end;
var StartTime, Time: TSystemTime; TLabel: TNewStaticText;
function GetLocalTime(var lpTime: TSystemTime): Boolean; external 'GetLocalTime@kernel32.dll stdcall';
Function GetWorkTime: String;
Begin
GetLocalTime(Time) {время завершения установки}
if Time.wHour < StartTime.wHour then begin
Time.wHour:= 24 - StartTime.wHour + Time.wHour
end else begin
Time.wHour:= Time.wHour - StartTime.wHour
end
if Time.wMinute < StartTime.wMinute then begin
Time.wMinute:= 60 - StartTime.wMinute + Time.wMinute
Time.wHour:= Time.wHour - 1
end else begin
Time.wMinute:= Time.wMinute - StartTime.wMinute
end
if Time.wSecond < StartTime.wSecond then begin
Time.wSecond:= 60 - StartTime.wSecond + Time.wSecond
Time.wMinute:= Time.wMinute - 1
end else begin
Time.wSecond:= Time.wSecond - StartTime.wSecond
end
if Time.wMilliseconds < StartTime.wMilliseconds then begin
Time.wMilliseconds:= 1000 - StartTime.wMilliseconds + Time.wMilliseconds
Time.wSecond:= Time.wSecond - 1
end else begin
Time.wMilliseconds:= Time.wMilliseconds - StartTime.wMilliseconds
end
Result:= 'Длительность: ' + IntToStr(Time.wHour) + ' час, ' + IntToStr(Time.wMinute) + ' мин, ' + FloatToStr((Time.wSecond*1000 + Time.wMilliseconds)/1000) + ' сек.'
End;
Procedure CurPageChanged(CurPageID: Integer);
Begin
if CurPageID = wpFinished then TLabel.Caption:= TLabel.Caption + #13#10 + GetWorkTime;
End;
Procedure InitializeWizard;
Begin
GetLocalTime(StartTime) {время начала установки}
TLabel:= TNewStaticText.Create(WizardForm);
TLabel.Top:= WizardForm.CancelButton.Top;
TLabel.Left:= WizardForm.ClientWidth - WizardForm.CancelButton.Left - WizardForm.CancelButton.Width;
TLabel.Parent:= WizardForm;
TLabel.Caption:= 'Время старта: ' + IntToStr(StartTime.wHour) + ' час, ' + IntToStr(StartTime.wMinute) + ' мин, ' + FloatToStr((StartTime.wSecond*1000 + StartTime.wMilliseconds)/1000) + ' сек.' ;
End;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
end;
const
TransparentPercent = 80; // процент прозрачности
WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);
function SetLayeredWindowAttributes(hwnd: HWND; crKey: TColor; bAlpha: BYTE; dwFlags: DWORD): Boolean;
external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(Wnd: HWnd; Index: Integer): Longint;
external 'GetWindowLongA@user32.dll stdcall';
function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint;
external 'SetWindowLongA@user32.dll stdcall';
Procedure InitializeWizard();
begin
SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(WizardForm.Handle, 0, (255 * TransparentPercent) / 100, LWA_ALPHA);
end;
Интересный эффект дает и такое использование:
Procedure InitializeWizard();
begin
WizardForm.ReadyMemo.Color:= clRed;
SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(WizardForm.Handle, clRed, (255 * TransparentPercent) / 100, LWA_COLORKEY);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
Path: String;
FreeMB, TotalMB: Cardinal;
begin
Result:= True;
if CurPageID = wpSelectDir then
begin
Path:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
begin
MsgBox('Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' MB,'#13+ 'а на выбранном Вами диске доступно только '+ IntToStr(FreeMB)+' MB', mbCriticalError, MB_OK)
Result := False;
end;
end;
end;
function InitializeSetup(): Boolean;
begin
Result:=True;
begin
if not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322')
or not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727')
then
begin
if MsgBox('Attention! On your computer is not found required packages of Microsoft .NET Framework 1.1 or Microsoft .NET Framework 2.0 or both their.'#13#13'Do you want to continue?', mbError, MB_YESNO) = idNo
then
Result:=False;
end;
end;
end;
var
ResultStr:string;
ResultCode: Integer;
function InitializeSetup(): Boolean;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}_is1', 'UninstallString', ResultStr)
if ResultStr='' then
begin
Result := True;
end
else
ResultStr:=RemoveQuotes(ResultStr);
Exec(ResultStr, '', '', SW_SHOWNORMAL, ewNoWait, ResultCode)
end;
procedure InitializeWizard();
var
Form1: TSetupForm;
StaticText: TNewStaticText;
BitmapImage: TBitmapImage;
BitmapFileName: String;
begin
Form1 := CreateCustomForm();
try
with Form1 do
begin
ClientWidth := ScaleX(380);
ClientHeight := ScaleY(120);
BorderStyle:= bsToolWindow; // или bsDialog, bsNone кому что нравится
BorderIcons:= BorderIcons - [biSystemMenu];
FormStyle:= fsStayOnTop;
Center;
end;
BitmapFileName := ExpandConstant('{tmp}\WizModernSmallImage.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
BitmapImage := TBitmapImage.Create(Form1);
BitmapImage.Left := ScaleX( ;
BitmapImage.Top := ScaleY( ;
BitmapImage.AutoSize := True;
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
BitmapImage.Parent := Form1;
StaticText := TNewStaticText.Create(Form1);
StaticText.Top := BitmapImage.Top;
StaticText.Left := BitmapImage.Left + BitmapImage.Width + ScaleX(
StaticText.Caption := 'Inno Setup is a free installer for Windows programs.' + #10#13 + 'Support for all versions of Windows in use today';
StaticText.AutoSize := True;
StaticText.Parent := Form1;
Form1.Show();
Form1.Repaint;
Sleep(2000);
finally
Form1.Free();
end;
end;
procedure InitializeWizard();
begin
with WizardForm do begin
with MainPanel do
Height := Height - 1;
with WizardSmallBitmapImage do begin
Left := 0;
Top := 0;
Height := 58; //Размер рисунка
Width := 497; //
end;
with PageNameLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
end;
end;[/more]
[Setup]
AppName=Counter-Strike Source
AppVerName=Counter-Strike Source 1.0.0.59
AppPublisher=Valve
AppPublisherURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
AppSupportURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
AppUpdatesURL=http://forum.freedom-vrn.ru/viewforum.php?f=59
DefaultDirName=\Program Files\Valve\Counter-Strike Source
DefaultGroupName=Counter-Strike Source
AllowNoIcons=yes
LicenseFile=D:\Files\Rumyantsev\valve\css\readme Counter-Strike Source.txt
OutputDir=D:\css
OutputBaseFilename=setup
SetupIconFile=D:\Files\Rumyantsev\valve\css\autorun.ico
Compression=lzma
SolidCompression=true
DiskSpanning=true
DiskSliceSize=210000000
AppID={{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}
UninstallDisplayIcon={app}D:\css\css_1.ico
WizardSmallImageFile=D:\css\css_2.bmp
WizardImageFile=D:\css\css_1.bmp
[Languages]
Name: russian; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: D:\css\css_1.ico; DestDir: {app}
Source: D:\css\css_1.ico; DestDir: {app}
Source: D:\Program Files\Valve\Counter-Strike Source\Run_CSS.exe; DestDir: {app}; Flags: ignoreversion
Source: D:\Program Files\Valve\Counter-Strike Source\*; DestDir: {app}; Flags: ignoreversion
; IOIAOUOA: Ia eniieucoeoa "Oea?ee: I?ieaii?e?iaaou aa?ne?" ia e?auo iauaainooiiuo nenoaiiuo oaeeao
[Icons]
Name: {group}\Counter-Strike Source; Filename: {app}\Run_CSS.exe
Name: {group}\{cm:ProgramOnTheWeb,Counter-Strike Source}; Filename: http://forum.freedom-vrn.ru/viewforum.php?f=59
Name: {group}\{cm:UninstallProgram,Counter-Strike Source}; Filename: {uninstallexe}
Name: {commondesktop}\Counter-Strike Source; Filename: {app}\Run_CSS.exe; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Counter-Strike Source; Filename: {app}\Run_CSS.exe; Tasks: quicklaunchicon
[Run]
Filename: {app}\Run_CSS.exe; Description: {cm:LaunchProgram,Counter-Strike Source}; Flags: nowait postinstall skipifsilent
[Dirs]
Name: {app}; Attribs: system; AfterInstall: CreateIni()
[code]
procedure CreateIni();
begin
SaveStringsToFile(ExpandConstant('{app}\Desktop.ini'), ['[.ShellClassInfo]',
'IconFile=%SystemRoot%\system32\SHELL32.dll',
'IconIndex=27'], False)
end;
type TSystemTime = record wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: Word; end;
var StartTime, Time: TSystemTime; TLabel: TNewStaticText;
function GetLocalTime(var lpTime: TSystemTime): Boolean; external 'GetLocalTime@kernel32.dll stdcall';
Function GetWorkTime: String;
Begin
GetLocalTime(Time) {время завершения установки}
if Time.wHour < StartTime.wHour then begin
Time.wHour:= 24 - StartTime.wHour + Time.wHour
end else begin
Time.wHour:= Time.wHour - StartTime.wHour
end
if Time.wMinute < StartTime.wMinute then begin
Time.wMinute:= 60 - StartTime.wMinute + Time.wMinute
Time.wHour:= Time.wHour - 1
end else begin
Time.wMinute:= Time.wMinute - StartTime.wMinute
end
if Time.wSecond < StartTime.wSecond then begin
Time.wSecond:= 60 - StartTime.wSecond + Time.wSecond
Time.wMinute:= Time.wMinute - 1
end else begin
Time.wSecond:= Time.wSecond - StartTime.wSecond
end
if Time.wMilliseconds < StartTime.wMilliseconds then begin
Time.wMilliseconds:= 1000 - StartTime.wMilliseconds + Time.wMilliseconds
Time.wSecond:= Time.wSecond - 1
end else begin
Time.wMilliseconds:= Time.wMilliseconds - StartTime.wMilliseconds
end
Result:= 'Длительность: ' + IntToStr(Time.wHour) + ' час, ' + IntToStr(Time.wMinute) + ' мин, ' + FloatToStr((Time.wSecond*1000 + Time.wMilliseconds)/1000) + ' сек.'
End;
Procedure CurPageChanged(CurPageID: Integer);
Begin
if CurPageID = wpFinished then TLabel.Caption:= TLabel.Caption + #13#10 + GetWorkTime;
End;
Procedure InitializeWizard;
Begin
GetLocalTime(StartTime) {время начала установки}
TLabel:= TNewStaticText.Create(WizardForm);
TLabel.Top:= WizardForm.CancelButton.Top;
TLabel.Left:= WizardForm.ClientWidth - WizardForm.CancelButton.Left - WizardForm.CancelButton.Width;
TLabel.Parent:= WizardForm;
TLabel.Caption:= 'Время старта: ' + IntToStr(StartTime.wHour) + ' час, ' + IntToStr(StartTime.wMinute) + ' мин, ' + FloatToStr((StartTime.wSecond*1000 + StartTime.wMilliseconds)/1000) + ' сек.' ;
End;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
end;
const
TransparentPercent = 80; // процент прозрачности
WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $20;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (-20);
function SetLayeredWindowAttributes(hwnd: HWND; crKey: TColor; bAlpha: BYTE; dwFlags: DWORD): Boolean;
external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(Wnd: HWnd; Index: Integer): Longint;
external 'GetWindowLongA@user32.dll stdcall';
function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint;
external 'SetWindowLongA@user32.dll stdcall';
Procedure InitializeWizard();
begin
SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(WizardForm.Handle, 0, (255 * TransparentPercent) / 100, LWA_ALPHA);
end;
Интересный эффект дает и такое использование:
Procedure InitializeWizard();
begin
WizardForm.ReadyMemo.Color:= clRed;
SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(WizardForm.Handle, clRed, (255 * TransparentPercent) / 100, LWA_COLORKEY);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
Path: String;
FreeMB, TotalMB: Cardinal;
begin
Result:= True;
if CurPageID = wpSelectDir then
begin
Path:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < NeedSize then
begin
MsgBox('Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' MB,'#13+ 'а на выбранном Вами диске доступно только '+ IntToStr(FreeMB)+' MB', mbCriticalError, MB_OK)
Result := False;
end;
end;
end;
function InitializeSetup(): Boolean;
begin
Result:=True;
begin
if not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322')
or not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727')
then
begin
if MsgBox('Attention! On your computer is not found required packages of Microsoft .NET Framework 1.1 or Microsoft .NET Framework 2.0 or both their.'#13#13'Do you want to continue?', mbError, MB_YESNO) = idNo
then
Result:=False;
end;
end;
end;
var
ResultStr:string;
ResultCode: Integer;
function InitializeSetup(): Boolean;
begin
RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0872DB47-24CB-4C7F-AC4B-E6EFC27BD244}_is1', 'UninstallString', ResultStr)
if ResultStr='' then
begin
Result := True;
end
else
ResultStr:=RemoveQuotes(ResultStr);
Exec(ResultStr, '', '', SW_SHOWNORMAL, ewNoWait, ResultCode)
end;
procedure InitializeWizard();
var
Form1: TSetupForm;
StaticText: TNewStaticText;
BitmapImage: TBitmapImage;
BitmapFileName: String;
begin
Form1 := CreateCustomForm();
try
with Form1 do
begin
ClientWidth := ScaleX(380);
ClientHeight := ScaleY(120);
BorderStyle:= bsToolWindow; // или bsDialog, bsNone кому что нравится
BorderIcons:= BorderIcons - [biSystemMenu];
FormStyle:= fsStayOnTop;
Center;
end;
BitmapFileName := ExpandConstant('{tmp}\WizModernSmallImage.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
BitmapImage := TBitmapImage.Create(Form1);
BitmapImage.Left := ScaleX( ;
BitmapImage.Top := ScaleY( ;
BitmapImage.AutoSize := True;
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
BitmapImage.Parent := Form1;
StaticText := TNewStaticText.Create(Form1);
StaticText.Top := BitmapImage.Top;
StaticText.Left := BitmapImage.Left + BitmapImage.Width + ScaleX(
StaticText.Caption := 'Inno Setup is a free installer for Windows programs.' + #10#13 + 'Support for all versions of Windows in use today';
StaticText.AutoSize := True;
StaticText.Parent := Form1;
Form1.Show();
Form1.Repaint;
Sleep(2000);
finally
Form1.Free();
end;
end;
procedure InitializeWizard();
begin
with WizardForm do begin
with MainPanel do
Height := Height - 1;
with WizardSmallBitmapImage do begin
Left := 0;
Top := 0;
Height := 58; //Размер рисунка
Width := 497; //
end;
with PageNameLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
end;
end;[/more]