и иногда просто могут быть ошибки
Скрипты Inno Setup. Помощь и советы [часть 6]
-
ABBAT
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
странности с инно происходят,когда через инно сделал сетап,то во время установки такие ошибки идут
и иногда просто могут быть ошибки
http://i47.fastpic.ru/big/2013/0429/...b7d871fcea.jpg
и иногда просто могут быть ошибки
-
Johny777
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
ABBAT,
потому что не тестил за неимением пакуемых файлов, а искать надлежащие файлы для скрипта у меня нет времени
короче исправил пред. пост, тестируй
потому что не тестил за неимением пакуемых файлов, а искать надлежащие файлы для скрипта у меня нет времени
короче исправил пред. пост, тестируй
-
ABBAT
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
Johny777,
Спасибо большое вроде все как надо работает (на Win8 не тестил)
Файлы я беру в ветке "Наборы обновлений для Windows..." тема FullFlash аддон 'mPaSoft' он Flash в 7z пакует.
(я бы может и не парился но у него он такой страшный, в 7z батники, файлы реестра. (удивляюсь как это все работает, но работает же ыыы))
Вот
Спасибо Johny777 за помощь.
Спасибо большое вроде все как надо работает (на Win8 не тестил)
Файлы я беру в ветке "Наборы обновлений для Windows..." тема FullFlash аддон 'mPaSoft' он Flash в 7z пакует.
(я бы может и не парился но у него он такой страшный, в 7z батники, файлы реестра. (удивляюсь как это все работает, но работает же ыыы))
Вот
скрипт
со всем необходимым для создания аддона Adobe Flash Player 11 ActiveX & PluginСпасибо Johny777 за помощь.
-
habib2302
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
люди.я незнаю как это вам объяснить.короче.помогите мне пожалуйста разделить мне мой скрипт от AIDA64 на части.например.1 часть это кликабельное лого без фона,2 часть wizardimage и wazardsmallimage без фона,3 часть это поменять местами страницы Select dir и select components и т.п.а то я запутался в своем скрипте.вот скрипт
Код:
читать дальше »
Код:
Код: Выделить всё
; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "AIDA64"
#define MyAppVersion "2.85.2400"
#define MyAppPublisher "Copyright (c) 1995-2013 FinalWire Ltd."
#define MyAppURL "http://www.aida64.com/"
#define AIDA641 "AIDA64 Extreme Edition"
#define AIDA642 "AIDA64 Business Edition"
#define AIDA64EXE1 "aida64.exe"
#define AIDA64EXE2 "aida64.exe"
#define AuthRep "Xabib"
#include "WinTB.iss"
#include "botva2.iss"
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\FinalWire
DefaultGroupName=FinalWire
AllowNoIcons=true
OutputBaseFilename={#MyAppName} {#MyAppVersion}
SetupIconFile=ico.ico
Compression=lzma/Ultra64
SolidCompression=true
InternalCompressLevel=Ultra64
DiskSpanning=false
DiskSliceSize=736000000
ShowLanguageDialog=auto
SlicesPerDisk=4
UninstallDisplayIcon={app}\ico.ico
InfoBeforeFile=info.rtf
;Авторские права.
VersionInfoCopyright={#AuthRep}
;Производитель.
AppPublisher={#AuthRep}
RawDataResource=Botva:botva2.dll|b2p:b2p.dll|Logo:logo.png|bPic:bPic.png|LiPic:LiPic.png|aPic:aPic.png
AppCopyright={#AuthRep}
AppVerName={#MyAppVersion}
UninstallDisplayName={#MyAppName}
AppModifyPath={app}
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
DirExistsWarning=no
AppendDefaultDirName=no
AppendDefaultGroupName=no
LicenseFile=license.txt
DisableReadyPage=yes
AppId=TheBestAidaInstallEver
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Components]
Name: AIDA641; Description: {#AIDA641}; Flags: exclusive;
Name: AIDA642; Description: {#AIDA642}; Flags: exclusive;
[Tasks]
Name: icons; Description: Создать Ярлыки:;
Name: icons\desktop; Description: На Рабочем Столе;
Name: icons\quicklaunchicon; Description: В Панели Задач; OnlyBelowVersion: 0,6.1;
[Files]
;Файлы распаковываемые в папку с игрой. Необходимы для деинсталлятора;
Source: WinTB.dll; Flags: dontcopy;
Source: info.rtf; DestDir: {app}; Flags: ignoreversion
Source: license.txt; DestDir: {app}; Flags: ignoreversion
Source: ico.ico; DestDir: {app}; Flags: ignoreversion
Source: 1.ico; DestDir: {app}; Flags: ignoreversion
Source: 2.ico; DestDir: {app}; Flags: ignoreversion
Source: {app}\{#AIDA641}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA641;
Source: {app}\{#AIDA642}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA642;
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: {group}\{#AIDA641}; Filename: {app}\{#AIDA64EXE1}; Components: AIDA641;
Name: {group}\{#AIDA642}; Filename: {app}\{#AIDA64EXE2}; Components: AIDA642;
Name: {group}\{cm:UninstallProgram,{#AIDA641}}; Filename: {uninstallexe}; Components: AIDA641; IconFilename: {app}\1.ico;
Name: {group}\{cm:UninstallProgram,{#AIDA642}}; Filename: {uninstallexe}; Components: AIDA642; IconFilename: {app}\2.ico;
Name: {group}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA641;
Name: {group}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA642;
Name: {group}\Справка {#AIDA641}; Filename: {app}\aida64.chm; Components: AIDA641;
Name: {group}\Справка {#AIDA642}; Filename: {app}\aida64.chm; Components: AIDA642;
Name: {commondesktop}\{#AIDA641}; Filename: {app}\{#AIDA64EXE1}; Tasks: icons\desktop; Components: AIDA641;
Name: {commondesktop}\{#AIDA642}; Filename: {app}\{#AIDA64EXE2}; Tasks: icons\desktop; Components: AIDA642;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA641}; Filename: {app}{#AIDA64EXE1}; Tasks: icons\quicklaunchicon; Components: AIDA641;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA642}; Filename: {app}{#AIDA64EXE2}; Tasks: icons\quicklaunchicon; Components: AIDA642;
[Run]
Filename: {app}\{#AIDA64EXE1}; Description: "{cm:LaunchProgram,{#StringChange(AIDA641, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA641;
Filename: {app}\{#AIDA64EXE2}; Description: "{cm:LaunchProgram,{#StringChange(AIDA642, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA642;
[Messages]
BeveledLabel=RePack by {#AuthRep}
[...Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
RT_RCDATA = 10;
APPID_AIDA_EXTREME = 'AIDA64 Extreme Edition';
APPID_AIDA_BUISNES = 'AIDA64 Business Edition';
WAIT_OBJECT_0 = $0;
STARTF_USESHOWWINDOW = 1;
NORMAL_PRIORITY_CLASS = $00000020;
INFINITE = $FFFFFFFF;
type
_STARTUPINFO = record
cb: DWORD;
#ifdef UNICODE
lpReserved, lpDesktop, lpTitle: PAnsiChar;
#else
lpReserved, lpDesktop, lpTitle: PChar;
#endif
dwX, dwY, dwXSize, dwYSize, dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags: DWORD;
wShowWindow, cbReserved2: Word;
lpReserved2: Byte;
hStdInput, hStdOutput, hStdError: THandle;
end;
_PROCESS_INFORMATION = record
hProcess: THandle;
hThread: THandle;
dwProcessId: DWORD;
dwThreadId: DWORD;
end;
function CloseHandle(hObject: THandle): BOOL; external 'CloseHandle@kernel32.dll stdcall';
function WaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD; external 'WaitForSingleObject@kernel32.dll stdcall';
#ifdef UNICODE
function CreateProcess(lpApplicationName, lpCommandLine: PAnsiChar; lpProcessAttributes, lpThreadAttributes: Longint; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment, lpCurrentDirectory: PAnsiChar; const lpStartupInfo: _STARTUPINFO; var lpProcessInformation: _PROCESS_INFORMATION): BOOL; external 'CreateProcess{#A}@kernel32.dll stdcall';
#else
function CreateProcess(lpApplicationName, lpCommandLine: PChar; lpProcessAttributes, lpThreadAttributes: Longint; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment, lpCurrentDirectory: PChar; const lpStartupInfo: _STARTUPINFO; var lpProcessInformation: _PROCESS_INFORMATION): BOOL; external 'CreateProcess{#A}@kernel32.dll stdcall';
#endif
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;
ResultCode: Integer;
lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
BtnImage: TBitmapImage;
CheckLicense: TCheckBox;
iInitialize: Boolean;
function GetUninstallPath(const AppIds: array of String): array of String;
var
StringList: TStringList;
i, Len: Integer;
Buff: String;
begin
for i := 0 to GetArrayLength(AppIds)-1 do
begin
Buff := RemoveQuotes(ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + AppIds[i] + '_is1,UninstallString|}'));
if Buff '' then
begin
Len := GetArrayLength(Result);
SetArrayLength(Result, Len+1);
Result[Len] := Buff;
end;
end;
end;
procedure UninstallApps(const UninstallPathes: array of String);
var
pi: _PROCESS_INFORMATION;
si: _STARTUPINFO;
i: Integer;
begin
for i := 0 to GetArrayLength(UninstallPathes)-1 do
begin
si.cb := SizeOf(si);
si.dwFlags := STARTF_USESHOWWINDOW;
si.wShowWindow := SW_SHOWNORMAL;
#ifdef UNICODE
if not CreateProcess('', PAnsiChar(UninstallPathes[i]), 0, 0, False, NORMAL_PRIORITY_CLASS, '', '', si, pi) then
#else
if not CreateProcess('', PChar(UninstallPathes[i]), 0, 0, False, NORMAL_PRIORITY_CLASS, '', '', si, pi) then
#endif
begin
MsgBox(SysErrorMessage(DLLGetLastError), mbCriticalError, MB_OK);
Exit;
end;
try
while WaitForSingleObject(pi.hProcess, INFINITE) WAIT_OBJECT_0 do Application.ProcessMessages;
finally
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
end;
end;
end;
function GetFromRes(const ResName, SaveFileName: String): Boolean;
var
lResStream: TResourceStream;
begin
lResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
try
lResStream.SaveToFile(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
finally
lResStream.Free;
Result := FileExists(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
end;
end;
function InitializeSetup:boolean;
var
i, Len: Integer;
uArray: array of String;
begin
uArray := GetUninstallPath( ['{#SetupSetting("AppID")}', APPID_AIDA_EXTREME, APPID_AIDA_BUISNES] );
Len := GetArrayLength(uArray);
Result := Len = 0;
if not Result then if MsgBox('Перед установкой необходимо удалить все старые версии приложения, вызвать программы удаления сейчас?', mbError, MB_YESNO) = IDYES then
begin
UninstallApps(uArray);
Result := InitializeSetup();
end;
end;
procedure LicenseOnClick(Sender: TObject);
begin
case TCheckBox(Sender).Checked of
True: WizardForm.LicenseAcceptedRadio.Checked := True;
False: WizardForm.LicenseNotAcceptedRadio.Checked := True;
end;
end;
procedure TDVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+''
else
if IsComponentSelected('AIDA642') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'';
end;
procedure TFVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+''
else
if IsComponentSelected('AIDA642') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'';
end;
function OnShouldSkipPage(Sender: TWizardPage): Boolean;
begin
if WizardForm.ComponentsList.Items.Count > 0 then WizardForm.Tag:= 1; // отображаются страницы выбора папки и компонентов
end;
procedure RedesignWizardForm;
begin
with WizardForm.ComponentsList do
begin
Top := ScaleY(50);
Height := ScaleY(155);
end;
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
WizardForm.TypesCombo.hide;
PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage;
WizardForm.LicenseNotAcceptedRadio.Hide;
WizardForm.LicenseAcceptedRadio.Hide;
WizardForm.LicenseMemo.Height := ScaleY(175);
CheckLicense:= TCheckBox.Create(WizardForm);
CheckLicense.Left:= ScaleX(0);
CheckLicense.Top:= ScaleY(216);
CheckLicense.Caption:= WizardForm.LicenseAcceptedRadio.Caption;
CheckLicense.Width:= ScaleX(417);
CheckLicense.OnClick:= @LicenseOnClick;
CheckLicense.Parent:= WizardForm.LicensePage;
with WizardForm do
begin
iInitialize := True;
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_BPIC', 'bPic.png') and GetFromRes('_IS_LIPIC', 'LiPic.png') and GetFromRes('_IS_APIC', 'aPic.png') then
begin
bPicHandle := ImgLoad(WelcomePage.Handle, ExpandConstant('{tmp}\aPic.png'), WizardBitmapImage.Left, WizardBitmapImage.Top, WizardBitmapImage.Width, WizardBitmapImage.Height, True, True);
WizardBitmapImage.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(WelcomePage.Handle);
bPicHandle := ImgLoad(FinishedPage.Handle, ExpandConstant('{tmp}\bPic.png'), WizardBitmapImage2.Left, WizardBitmapImage2.Top, WizardBitmapImage2.Width, WizardBitmapImage2.Height, True, True);
WizardBitmapImage2.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(FinishedPage.Handle);
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
lPLogo:= ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38), True, True);
ImgApplyChanges(WizardForm.Handle);
end;
ExtractTemporaryFile('WinTB.dll');
SetTaskBarProgressValue(0, 60);
SetTaskBarProgressState(0, TBPF_ERROR);
TaskBarV10(MainForm.Handle, WizardForm.Handle, false, false, 0, 0, _m_);
TDV:= TFolderTreeView.Create(WizardForm);
TDV.Top:= WizardForm.DirEdit.Top+28;
TDV.Width:= 417;
TDV.Height:= 100;
TDV.OnChange:= @TDVOnChange;
TDV.Parent:= WizardForm.SelectDirPage;
TFV:= TStartMenuFolderTreeView.Create(nil);
TFV.Top:= WizardForm.GroupEdit.Top+28;
TFV.Width:= 417;
TFV.Height:= 100;
TFV.SetPaths(ExpandConstant('{userprograms}'),ExpandConstant('{commonprograms}'),ExpandConstant('{userstartup}'),ExpandConstant('{commonstartup}'));
TFV.OnChange:= @TFVOnChange;
TFV.Parent:= WizardForm.SelectProgramGroupPage;
with TLabel.Create(WizardForm) do
begin
Parent:=WizardForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38));
end;
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
wpSelectDir: if WizardForm.Tag = 1 then
begin
WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectComponents);
WizardForm.Hint:= WizardForm.PageDescriptionLabel.Caption; // запомнить SetupMessage(msgSelectDirDesc)
WizardForm.PageDescriptionLabel.Caption:= SetupMessage(msgSelectComponentsDesc);
end;
wpSelectComponents: if WizardForm.Tag = 1 then
begin
WizardForm.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
WizardForm.DiskSpaceLabel.Caption:= WizardForm.ComponentsDiskSpaceLabel.Caption;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir);
WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint; // иначе вместо названия программы [name]
if IsComponentSelected('AIDA641') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA641}';
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA641}';
end else
if IsComponentSelected('AIDA642') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA642}'
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA642}'
end;
end;
wpSelectTasks:
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
end;
end;
procedure DeinitializeSetup();
begin
if iInitialize then
begin
gdipShutdown;
TaskBarDestroy;
end;
end;
procedure InitializeUninstallProgressForm;
begin
with UninstallProgressForm do
begin
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_LIPIC', 'LIPic.png') then
begin
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
lPLogo:= ImgLoad(UninstallProgressForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38), True, True);
ImgApplyChanges(UninstallProgressForm.Handle);
end;
with TLabel.Create(nil) do
begin
Parent:=UninstallProgressForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38));
end;
end;
end;
procedure DeinitializeUninstall();
begin
gdipShutdown;
end;-
saurn
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
Johny777, спасибо. Склеил простенький скрипт на проверку файловой системы с выводом имени оной в TNewStaticText на SelectDirPage
Может, кому сгодится:
Код:
Может, кому сгодится:читать дальше »
Код:
Код: Выделить всё
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
OutputDir=.
[Code]
const
MAX_PATH = 260;
TARGET_FILE_SYSTEM = 'NTFS';
function GetVolumeInformation(lpRootPathName: String; lpVolumeNameBuffer: String; nVolumeNameSize: DWORD; lpVolumeSerialNumber: DWORD; var lpMaximumComponentLength, lpFileSystemFlags: DWORD; lpFileSystemNameBuffer: String; nFileSystemNameSize: DWORD): BOOL; external 'GetVolumeInformation{#A}@kernel32.dll stdcall';
var
FileSystemLabel, FileSystemLabel2: TNewStaticText;
function ExtractFileSystemName(const DriveLetter: string): string;
var
VolumeName, FileSystemName: String;
ComponentLength, SerialNumber, FileSystemFlags: DWORD;
begin
VolumeName := StringOfChar(#32, MAX_PATH);
FileSystemName := StringOfChar(#32, MAX_PATH);
DriveLetter := AddBackslash( ExtractFileDrive(WizardDirValue()) );
GetVolumeInformation(DriveLetter, VolumeName, MAX_PATH, SerialNumber, ComponentLength, FileSystemFlags, FileSystemName, MAX_PATH);
Result := Trim(FileSystemName);
end;
procedure ObjectOnChange(Sender: TObject);
var
FileSystemType: String;
begin
case TEdit(Sender) of
WizardForm.DirEdit:
begin
FileSystemLabel2.Caption := ExtractFileSystemName(FileSystemType);
WizardForm.NextButton.Enabled := (ExtractFileSystemName(FileSystemType) = TARGET_FILE_SYSTEM);
if ExtractFileSystemName(FileSystemType) = TARGET_FILE_SYSTEM then
FileSystemLabel2.Font.Color := clBlack else FileSystemLabel2.Font.Color := clRed;
end;
end;
end;
procedure InitializeWizard();
begin
with WizardForm do
begin
DirEdit.OnChange := @ObjectOnChange;
FileSystemLabel := TNewStaticText.Create(nil);
with FileSystemLabel do
begin
Parent := SelectDirPage;
SetBounds(WizardForm.DiskSpaceLabel.Left, WizardForm.DiskSpaceLabel.Top - 18, 0, 0);
AutoSize := True;
Caption := 'Файловая система:';
end;
FileSystemLabel2 := TNewStaticText.Create(nil);
with FileSystemLabel2 do
begin
Parent := SelectDirPage;
SetBounds(FileSystemLabel.Left + 100, FileSystemLabel.Top, 0, 0);
AutoSize := True;
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectDir: ObjectOnChange(WizardForm.DirEdit);
end;
end;
-
habib2302
-
Mailchik
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
Renko13,
Код:
читать дальше »
Код:
Код: Выделить всё
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
var
ResultCode: integer;
begin
if CurPageID = wpSelectDir then begin
Exec(ExpandConstant('{src}\test.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Result := True
end else
Result := True;
end;
//ExpandConstant('{src}\test.exe') --- запускаемое приложение.
//SW_HIDE --- запустить в скрытом режиме
//ewWaitUntilTerminated --- дождаться завершения работы приложения-
Renko13
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
Помогите !!! Или дале игнорируэте меня !!! Остался последний вопрос.
Например, чтоби при просмотре замисть 67% било 67.0% (проценти 67.1% єсть )на екране процентов зделать так
Додаю скрипт
[Setup]
AppName=MyApp
AppVerName=MyApp
DefaultDirName={pf}\MyApp
[Files]
Source: innocallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: files\*; DestDir: {app}; Flags: recursesubdirs
Например, чтоби при просмотре замисть 67% било 67.0% (проценти 67.1% єсть )на екране процентов зделать так
Додаю скрипт
читать дальше »
[Setup]
AppName=MyApp
AppVerName=MyApp
DefaultDirName={pf}\MyApp
[Files]
Source: innocallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: files\*; DestDir: {app}; Flags: recursesubdirs
Код: Выделить всё
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);
var
TimerID: LongWord;
PercentsLabel: TLabel;
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.1n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
procedure PercentsInstall();
begin
with WizardForm.ProgressGauge do
begin
PercentsLabel.Caption:= 'Установка игры: ' + NumToStr((Position*100)/Max) + ' %';
end;
end;
Procedure MyTimerProc(h, msg, idevent, dwTime: Longword);
Begin
if WizardForm.CurPageID = wpInstalling then PercentsInstall();
End;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;
procedure InitializeWizard();
begin
PercentsLabel:= TLabel.Create(WizardForm);
with PercentsLabel do
begin
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ScaleY(30);
Width:= WizardForm.StatusLabel.Width;
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Alignment := taCenter;
Font.Style:= [fsBold, fsItalic];
Font.Size:= 14;
Font.Name:= 'Times New Roman';
Font.Color:= ClMaroon;
Parent:= WizardForm.InstallingPage;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
TimerID:= SetTimer(0, 0, 500 {Установка игры}, WrapTimerProc(@MyTimerProc, 4));
end;
end;-
Mailchik
Re: Скрипты Inno Setup. Помощь и советы [часть 6]
neorom,
Код:
Код:
Код: Выделить всё
procedure PercentsInstall();
begin
with WizardForm.ProgressGauge do begin
PercentsLabel.Caption := 'Установка игры: ' + NumToStr((Position*100)/Max) + '.' + Chr(48 + Position mod 10) + ' %';
end;
end;