Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 6]
habib2302, а просто тупо скопировать мой скрипт и запустить не пробовал?
habib2302
08-04-2013, 12:55
nik1967, скрипт рабочий,но при объединении этих двух скриптов
[....code]
function OnShouldSkipPage(Sender: TWizardPage): Boolean;
begin
if WizardForm.ComponentsList.Items.Count > 0 then WizardForm.Tag:= 1; // отображаются страницы выбора папки и компонентов
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]
end;
end;
End;
Procedure InitializeWizard;
Begin
PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpSelectDir:
begin
if IsComponentSelected('AIDA641') then WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA641}'
else WizardForm.DirEdit.Text := ExpandConstant('{#SetupSetting("DefaultDirName")}');
if IsComponentSelected('AIDA642') then WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA642}'
else WizardForm.DirEdit.Text := ExpandConstant('{#SetupSetting("DefaultDirName")}');
end;
wpSelectProgramGroup:
begin
if IsComponentSelected('AIDA641') then WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA641}'
else WizardForm.GroupEdit.Text := ExpandConstant('{#SetupSetting("DefaultGroupName")}');
if IsComponentSelected('AIDA642') then WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA642}'
else WizardForm.GroupEdit.Text := ExpandConstant('{#SetupSetting("DefaultGroupName")}');
end ;
end;
end;
он выдают ошибку
http://img805.imageshack.us/img805/5184/thumblk.png (http://img199.imageshack.us/img199/3962/snagit00070804201311543.png)
и я тебя прошу.объедени мне пожалуйста эти два скрипта
скрипт рабочий,но при объединении этих двух скриптов »
и я тебя прошу.объедени мне пожалуйста эти два скрипта »
Дак я уже объединил их, что там ещё объединять то?
; Скрипт создан через Мастер 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.p ng
AppCopyright={#AuthRep}
AppVerName={#MyAppVersion}
UninstallDisplayName={#MyAppName}
AppModifyPath={app}
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
DirExistsWarning=no
[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: 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}\{#AIDA641}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA641;
Source: {app}\{#AIDA642}\*; DestDir: {app}\{#AIDA642}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA642;
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: {group}\{#AIDA641}\{#AIDA641}; Filename: {app}\{#AIDA641}\{#AIDA64EXE1}; Components: AIDA641;
Name: {group}\{#AIDA642}\{#AIDA642}; Filename: {app}\{#AIDA642}\{#AIDA64EXE2}; Components: AIDA642;
Name: {group}\{#AIDA641}\{cm:UninstallProgram,{#AIDA641}}; Filename: {uninstallexe}; Components: AIDA641; IconFilename: {app}\1.ico;
Name: {group}\{#AIDA642}\{cm:UninstallProgram,{#AIDA642}}; Filename: {uninstallexe}; Components: AIDA642; IconFilename: {app}\2.ico;
Name: {group}\{#AIDA641}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA641;
Name: {group}\{#AIDA642}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA642;
Name: {group}\{#AIDA641}\Справка {#AIDA641}; Filename: {app}\{#AIDA641}\aida64.chm; Components: AIDA641;
Name: {group}\{#AIDA642}\Справка {#AIDA642}; Filename: {app}\{#AIDA642}\aida64.chm; Components: AIDA642;
Name: {commondesktop}\{#AIDA641}; Filename: {app}\{#AIDA641}\{#AIDA64EXE1}; Tasks: icons\desktop; Components: AIDA641;
Name: {commondesktop}\{#AIDA642}; Filename: {app}\{#AIDA642}\{#AIDA64EXE2}; Tasks: icons\desktop; Components: AIDA642;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA641}; Filename: {app}\{#AIDA641}\{#AIDA64EXE1}; Tasks: icons\quicklaunchicon; Components: AIDA641;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA642}; Filename: {app}\{#AIDA642}\{#AIDA64EXE2}; Tasks: icons\quicklaunchicon; Components: AIDA642;
[Run]
Filename: {app}\{#AIDA641}\{#AIDA64EXE1}; Description: "{cm:LaunchProgram,{#StringChange(AIDA641, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA641;
Filename: {app}\{#AIDA642}\{#AIDA64EXE2}; Description: "{cm:LaunchProgram,{#StringChange(AIDA642, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA642;
[Messages]
BeveledLabel=RePack by {#AuthRep}
[Code]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
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;
{ ReservationBegin }
// Вы можете добавить ваш код здесь.
{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!
const
RT_RCDATA = 10;
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;
ResultCode: Integer;
lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
BtnImage: TBitmapImage;
function GetFromRes(const ResName, SaveFileName: String): Boolean;
var
lResStream: TResourceStream;
begin
lResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
try
lResStream.SaveToFile(ExpandConstant('{tmp}\') + SaveFileName);
finally
lResStream.Free;
Result := FileExists(ExpandConstant('{tmp}\') + SaveFileName);
end;
end;
procedure TDVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#AIDA641}'
else
if IsComponentSelected('AIDA642') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#AIDA642}';
end;
procedure TFVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#AIDA641}'
else
if IsComponentSelected('AIDA642') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#AIDA642}';
end;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\WinTB.dll')) then ExtractTemporaryFile('WinTB.dll');
Result:=True;
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
WizardForm.TypesCombo.hide;
PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage;
with WizardForm do
begin
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;
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('{us erstartup}'),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;
end;
end;
procedure DeinitializeSetup();
begin
gdipShutdown;
TaskBarDestroy;
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;
[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D0030106402000054504630F10B5457697A617264466F726D0A57697A61726 4466F726D0C436C69656E744865696768740368010B436C69656E74576964746803F1010C4578706C696369744C656674020 00B4578706C69636974546F7002000D4578706C6963697457696474680301020E4578706C69636974486569676874038E010 D506978656C73506572496E636802600A54657874486569676874020D00F10C544E65774E6F7465626F6F6B0D4F757465724 E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650D4578706C6963697457696 4746803F1010E4578706C696369744865696768740339010000F110544E65774E6F7465626F6F6B5061676509496E6E65725 06167650D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100F10C544E65774E6F74656 26F6F6B0D496E6E65724E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B4C6963656E7365506167650D4 578706C69636974576964746803A1010E4578706C6963697448656967687403ED000000F110544E65774E6F7465626F6F6B5 06167651453656C656374436F6D706F6E656E7473506167650D4578706C69636974576964746803A1010E4578706C6963697 448656967687403ED0000F110544E6577436865636B4C697374426F780E436F6D706F6E656E74734C69737403546F7002320 6486569676874039B000B4578706C69636974546F7002320E4578706C69636974486569676874039B000000F10C544E65774 36F6D626F426F780A5479706573436F6D626F0A4974656D486569676874020D00000000000000
Правда один момент мне непонятный:
Source: {app}\{#AIDA641}\*; DestDir: {app}\{#AIDA641}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA641;
Source: {app}\{#AIDA642}\*; DestDir: {app}\{#AIDA642}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA642;
откуда будут браться файлы для установки? Константа {app} - "Папка, куда устанавливается приложение. Она выбирается пользователем в окне Выбор папки назначения при установке."
habib2302
08-04-2013, 14:35
подскажите пожалуйста.как скрыть страницу ReadyPage?
я пытался скрыть эту страницу добавив в процедуру InitializeWizard этот код WizardForm.ReadyPage.Hide; но к сажелению эффекта нет
habib2302, держи (http://rghost.ru/45135193). Вроде всё корректно работает.
[hr]
[Setup]
DisableReadyPage=yes
и
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
------------------------
wpSelectTasks:
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
end;
end;
end;
; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "AIDA64"
#define MyAppVersion "2.85.2400"
#define MyAppVersionName "AIDA64 v.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={#MyAppVersionName}
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.p ng
AppCopyright={#AuthRep}
UninstallDisplayName={#MyAppName}
AppModifyPath={app}
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
DirExistsWarning=no
AppendDefaultDirName=no
AppendDefaultGroupName=no
DisableReadyPage=yes
[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: ico.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: 1.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: 2.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
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]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
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;
{ ReservationBegin }
// Вы можете добавить ваш код здесь.
{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!
const
RT_RCDATA = 10;
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;
ResultCode: Integer;
lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
BtnImage: TBitmapImage;
function GetFromRes(const ResName, SaveFileName: String): Boolean;
var
lResStream: TResourceStream;
begin
lResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
try
lResStream.SaveToFile(ExpandConstant('{tmp}\') + SaveFileName);
finally
lResStream.Free;
Result := FileExists(ExpandConstant('{tmp}\') + SaveFileName);
end;
end;
procedure TDVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#AIDA641}'
else
if IsComponentSelected('AIDA642') then
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'{#AIDA642}';
end;
procedure TFVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#AIDA641}'
else
if IsComponentSelected('AIDA642') then
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'{#AIDA642}';
end;
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\WinTB.dll')) then ExtractTemporaryFile('WinTB.dll');
Result:=True;
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
WizardForm.TypesCombo.hide;
PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage;
with WizardForm do
begin
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;
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('{us erstartup}'),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
gdipShutdown;
TaskBarDestroy;
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;
habib2302
08-04-2013, 15:06
nik1967, помоги мне пожалуйста скрыть страницу ReadyPage
WizardForm.ReadyPage.Hide; но к сажелению эффекта нет »
И не будет. Для некоторых страниц существует возможность отключения через секцию Setup. Например, для ReadyPage:
[Setup]
DisableReadyPage=yes
Есть так же специальная функция ShouldSkipPage в Code, например, если необходимо пропустить несколько страниц, в рамках некоего условия. Пример:
function ShouldSkipPage(PageID: Integer): Boolean;
begin
case PageID of
wpSelectComponents, wpSelectProgramGroup, wpSelectTasks, wpReady: Result := True;
end;
end;
nik1967, помоги мне пожалуйста скрыть страницу ReadyPage »
Смотри выше (http://forum.oszone.net/post-2128242-125.html)
Nightwishh
08-04-2013, 17:34
saurn, Спасибо за помощь! а посмотрите я для GroupEdit я правильно сделал?
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
OutputDir=.
[ Code]
var
PathLabel: TLabel;
function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL;
external 'PathCompactPathExA@shlwapi.dll stdcall';
function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, 260);
PathCompactPathEx(Result, Input, Length, 0);
end;
procedure GroupEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath('' + #32 + TEdit(Sender).Text, 55);
end;
procedure InitializeWizard();
begin
PathLabel := TLabel.Create(WizardForm);
with PathLabel do
begin
Parent:= WizardForm.SelectProgramGroupPage;
Caption := ShortPath('' + #32 + WizardForm.GroupEdit.Text, 55);
Transparent := True;
Font.Size := 9;
Left := WizardForm.DirEdit.Left;
Top := WizardForm.DirEdit.Top + Round((WizardForm.DirEdit.Height - Height) div 2);
end;
WizardForm.GroupEdit.OnChange := @GroupEditOnChange;
WizardForm.GroupEdit.Hide;
end;
[Icons]
Name: {group}\1; Filename: {app}\fjhjk.exe; WorkingDir: {app}; Flags: createonlyiffileexists
в чем сложность? Скрипт покажите. »
У меня в скрипте нету прописано процентов (попрасту я собераюсь прописать проценти туда, а не получаэться(бо неумею, а хотелось би)).
Ну и, если хочется проценты через внешнюю библиотеку »
Да хочу, но чтоби проценти возрастали при возрастании процес бара, а не получаэться.
audiofeel
08-04-2013, 23:33
помогите добавить к имени (mytext.txt) и пароль , пробовал дублировать ошибок нет но и результата тоже нет - одно имя. [.....Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
[...Code]
var
EditPage: TWizardPage;
MyEdit, MyEdit1: TEdit;
procedure MyEditOnChange(Sender: TObject);
begin
if MyEdit.Text = '' then
WizardForm.NextButton.Enabled := False
else
WizardForm.NextButton.Enabled := True;
end;
procedure MyEdit1OnChange(Sender: TObject);
begin
if MyEdit1.Text = '' then
WizardForm.NextButton.Enabled := False
else
WizardForm.NextButton.Enabled := True;
end;
procedure CreateEditPage();
begin
EditPage := CreateCustomPage(wpWelcome, 'Введите данные учетной записи ЦРУ', '');
with TNewStaticText.Create(EditPage) do
begin
SetBounds(10,25,100,14);
Caption := 'Введите свой ник:';
Parent := EditPage.Surface;
end;
with TNewStaticText.Create(EditPage) do
begin
SetBounds(10,65,100,14);
Caption := 'Введите пароль:';
Parent := EditPage.Surface;
end;
MyEdit := TEdit.Create(EditPage);
with MyEdit do
begin
SetBounds(10, 44, 350, 21);
OnChange := @MyEditOnChange;
Parent := EditPage.Surface;
end;
MyEdit1 := TEdit.Create(EditPage);
with MyEdit1 do
begin
SetBounds(10, 84, 350, 21);
OnChange := @MyEdit1OnChange;
Parent := EditPage.Surface;
end;
end;
procedure InitializeWizard();
begin
CreateEditPage();
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssPostInstall: SaveStringToFile(ExpandConstant('{app}')+'\durdom.ini', MyEdit.Text, true);
end;
case CurStep of
ssPostInstall: SaveStringToFile(ExpandConstant('{app}')+'\durdom.ini', MyEdit1.Text, true);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (CurPageID = EditPage.ID) and (MyEdit.Text = '') and (MyEdit1.Text = '')then
WizardForm.NextButton.Enabled := False;
end;
audiofeel,
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssPostInstall:
begin
SaveStringToFile(ExpandConstant('{app}')+'\durdom.ini', MyEdit.Text + #13#10, true);
SaveStringToFile(ExpandConstant('{app}')+'\durdom.ini', MyEdit1.Text, true);
end;
end;
end;
///P.S.////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ssPostInstall: это шаг установки (CurStep: TSetupStep) объявлять его дважды, по меньшей мере не имеет смысла.
//Если у вас несколько задач, выполняющихся на этапах установки, пишите так:
//
//procedure CurStepChanged(CurStep: TSetupStep);
//begin
// case CurStep of
// ssInstall:
// begin
// действие 1;
// действие 2;
// и т.д.
// end;
// ssPostInstall:
// begin
// действие 1;
// действие 2;
// и т.д.
// end;
// end;
//end;
//
//Если не понятны действия с case, пишите, как привыкли:
//procedure CurStepChanged(CurStep: TSetupStep);
//begin
//if CurStep = ssPostInstall then
//...
//
//В данном случае больше сила привычки, нежели необходимость.
Спасибо за помощь! а посмотрите я для GroupEdit я правильно сделал? »
Мне не за что, пример не мой.
Пару мелочей пропустили. Так будет правильно:
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
OutputDir=.
[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
MAX_PATH = 260;
MAX_PATH_LEN = 55;
var
PathLabel: TLabel;
function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL; external 'PathCompactPathEx{#A}@shlwapi.dll stdcall';
function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, 260);
PathCompactPathEx(Result, Input, Length, 0);
end;
procedure GroupEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath(#32 + TEdit(Sender).Text, 55);
end;
procedure InitializeWizard();
begin
PathLabel := TLabel.Create(nil);
with PathLabel do
begin
Parent:= WizardForm.SelectProgramGroupPage;
Caption := ShortPath(#32 + WizardForm.GroupEdit.Text, 55);
Transparent := True;
Font.Size := 9;
Left := WizardForm.GroupEdit.Left;
Top := WizardForm.GroupEdit.Top + Round((WizardForm.GroupEdit.Height - Height) div 2);
end;
WizardForm.GroupEdit.OnChange := @GroupEditOnChange;
WizardForm.GroupEdit.Hide;
end;
[Icons]
Name: {group}\1; Filename: {app}\fjhjk.exe; WorkingDir: {app}; Flags: createonlyiffileexists
Да хочу, но чтоби проценти возрастали при возрастании процес бара, а не получаэться. »
А откуда, по вашему, берутся эти цифры? Проценты пересчитываются с текущей позиции прогресс-бара, начиная с начальной точки и заканчивая конечной, кстати тут (http://forum.oszone.net/post-2127446-91.html) вам об этом уже говорили, это касается обоих примеров. Разница в тех примерах только в способе реализации. И не важно, какой из примеров вы будете использовать, в свой скрипт вставлять все придется руками, самому. Программы, которая прочитает наши мысли и все сделает за нас еще не придумали.
Прошу, кто панимаєт , удалите из єтого скрипта всьо лишниэ, лишить надо только процедуру отображения процентов, без процес бара(шрифт, розмещения, цвет - оставить)
#define NeedSize "5000000000"
#define NeedMem 512
#define SecondProgressBar
;#define Components
;#define records
;#define facompress
;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP
[Setup]
AppName=ISDone
AppVerName=ISDone
DefaultDirName={pf}\ISDone
DefaultGroupName=ISDone Example
OutputDir=.
OutputBaseFilename=Setup
VersionInfoCopyright=ProFrager
SolidCompression=yes
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif
[Registry]
Root: HKLM; Subkey: Software\ProFrager; ValueName: path; ValueType: String; ValueData: {app}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: Software\ProFrager; ValueName: name; ValueType: String; ValueData: Data; Flags: uninsdeletekey; Check: CheckError
[Icons]
Name: {group}\Удалить пример ISDone; Filename: {app}\unins000.exe; WorkingDir: {app}; Check: CheckError
Name: {commondesktop}\Удалить пример ISDone; Filename: {app}\unins000.exe; WorkingDir: {app}; Check: CheckError
[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++ 2005 Redist
Name: PhysXCheck; Description: Установить Nvidia PhysX
[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError
[Files]
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
#if precomp == "0.38"
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.4"
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.41"
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.42"
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#else
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#endif
#endif
#endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif
[CustomMessages]
russian.ExtractedFile=Извлекается файл:
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[UninstallDelete]
Type: filesandordirs; Name: {app}
[Code]
const
PCFonFLY=true;
notPCFonFLY=false;
var
LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
LabelPct2: TLabel;
ISDoneProgressBar2:TNewProgressBar;
#endif
MyCancelButton: TButton;
ISDoneCancel:integer;
ISDoneError:boolean;
PCFVer:double;
type
TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';
function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
#ifdef SecondProgressBar
if CurrentPct<=1000 then ISDoneProgressBar2.Position := CurrentPct;
LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
Result := ISDoneCancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
SuspendProc;
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
ResumeProc;
end;
procedure HideControls;
begin
WizardForm.FileNamelabel.Hide;
ISDoneProgressBar1.Hide;
LabelPct1.Hide;
LabelCurrFileName.Hide;
LabelTime1.Hide;
LabelTime2.Hide;
MyCancelButton.Hide;
#ifdef SecondProgressBar
ISDoneProgressBar2.Hide;
LabelPct2.Hide;
#endif
end;
procedure CreateControls;
var PBTop:integer;
begin
PBTop:=ScaleY(50);
ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar1 do begin
Parent := WizardForm.InstallingPage;
Height := WizardForm.ProgressGauge.Height;
Left := ScaleX(0);
Top := PBTop;
Width := ScaleX(365);
Max := 1000;
end;
LabelPct1 := TLabel.Create(WizardForm);
with LabelPct1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar1.Width+ScaleX(5);
Top := ISDoneProgressBar1.Top + ScaleY(2);
Width := ScaleX(80);
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width+ScaleX(30);
Left := ScaleX(0);
Top := ScaleY(30);
end;
#ifdef SecondProgressBar
PBTop:=PBTop+ScaleY(25);
ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar2 do begin
Parent := WizardForm.InstallingPage;
Left := ScaleX(0);
Top := PBTop+ScaleY(8);
Width := ISDoneProgressBar1.Width;
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
end;
LabelPct2 := TLabel.Create(WizardForm);
with LabelPct2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Left := ISDoneProgressBar2.Width+ScaleX(5);
Top := ISDoneProgressBar2.Top + ScaleY(2);
Width := ScaleX(80);
end;
#endif
LabelTime1 := TLabel.Create(WizardForm);
with LabelTime1 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := ISDoneProgressBar1.Width div 2;
Left := ScaleX(0);
Top := PBTop + ScaleY(35);
end;
LabelTime2 := TLabel.Create(WizardForm);
with LabelTime2 do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := LabelTime1.Width+ScaleX(40);
Left := ISDoneProgressBar1.Width div 2;
Top := LabelTime1.Top;
end;
LabelTime3 := TLabel.Create(WizardForm);
with LabelTime3 do begin
Parent := WizardForm.FinishedPage;
AutoSize := False;
Width := 300;
Left := 180;
Top := 200;
end;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and ISDoneError then
begin
LabelTime3.Hide;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;
function CheckError:boolean;
begin
result:= not ISDoneError;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
ISDoneCancel:=0;
// Распаковка всех необходимых файлов в папку {tmp}.
ExtractTemporaryFile('unarc.dll');
#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
#if precomp == "0.38"
ExtractTemporaryFile('precomp038.exe');
#else
#if precomp == "0.4"
ExtractTemporaryFile('precomp040.exe');
#else
#if precomp == "0.41"
ExtractTemporaryFile('precomp041.exe');
#else
#if precomp == "0.42"
ExtractTemporaryFile('precomp042.exe');
#else
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('precomp040.exe');
ExtractTemporaryFile('precomp041.exe');
ExtractTemporaryFile('precomp042.exe');
#endif
#endif
#endif
#endif
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
ExtractTemporaryFile('7z.dll');
ExtractTemporaryFile('PackZIP.exe');
#endif
ExtractTemporaryFile('English.ini');
// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //компонент 4
// .....
// см. справку
#endif
#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
repeat
// ChangeLanguage('English');
if not SrepInit('',512,0) then break;
if not PrecompInit('',128,PCFVer) then break;
if not FileSearchInit(true) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\*.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
// далее находятся закомментированые примеры различных функций распаковки (чтобы каждый раз не лазить в справку за примерами)
(*
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
if not ISRarExtract ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'), ExpandConstant('{app}\data.7z'), true) then break;
if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'), ExpandConstant('{app}\out.dat'), false, false) then break;
if not ISPackZIP ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
if not ISExec ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc') then break;
// распаковка группы файлов посредством внешнего приложения
FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
ExecError:=false;
while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
InFilePath:=ISGetName(0);
OutFilePath:=ISGetName(1);
OutFileName:=ISGetName(2);
ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
end;
ISFindFree(FindHandle1);
if ExecError then break;
*)
ISDoneError:=false;
until true;
ISDoneStop;
end;
HideControls;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
Nightwishh
09-04-2013, 18:58
И последний вопрос по поваду GroupEdit. [Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
OutputDir=.
[ Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
MAX_PATH = 260;
MAX_PATH_LEN = 55;
var
PathLabel: TLabel;
function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL; external 'PathCompactPathEx{#A}@shlwapi.dll stdcall';
function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, 260);
PathCompactPathEx(Result, Input, Length, 0);
end;
procedure GroupEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath(#32 + TEdit(Sender).Text, 55);
end;
procedure InitializeWizard();
begin
PathLabel := TLabel.Create(nil);
with PathLabel do
begin
Parent:= WizardForm.SelectProgramGroupPage;
Caption := ShortPath(#32 + WizardForm.GroupEdit.Text, 55);
Transparent := True;
Font.Size := 9;
Left := WizardForm.GroupEdit.Left;
Top := WizardForm.GroupEdit.Top + Round((WizardForm.GroupEdit.Height - Height) div 2);
end;
WizardForm.GroupEdit.OnChange := @GroupEditOnChange;
WizardForm.GroupEdit.Hide;
end;
[Icons]
Name: {group}\1; Filename: {app}\fjhjk.exe; WorkingDir: {app}; Flags: createonlyiffileexists
1)Как сделать неактивным PathLabel чекбоксом NoIconsCheck?
2)И можно ли убрать #ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif, у меня версия компилятора Ansi? Спасибо!
habib2302
09-04-2013, 19:08
подскажите.как сделать чтобы перед установкой новой версии экзешник сначало удалял старую версию,а потом начинал установку новой версии
вот скрипт
Как сделать неактивным PathLabel чекбоксом NoIconsCheck? »
Можно. Вставьте в свой скрипт:
procedure NoIconsOnClick(Sender: TObject);
begin
PathLabel.Enabled := not TCheckBox(Sender).Checked;
WizardForm.GroupBrowseButton.Enabled := PathLabel.Enabled;
end;
procedure InitializeWizard();
begin
WizardForm.NoIconsCheck.OnClick := @NoIconsOnClick;
end;
И можно ли убрать »
Могу ошибатся, но вроде это связано с обращением к API. Препроцессор вместо имени команды подставляет имя функции с суффиксом W(для unicode) или A(для однобайтовых). Пример будет безошибочно работать в обоих версиях компилятора. Убирать не нужно.
Nightwishh
09-04-2013, 20:26
saurn, Спасибо всё понял, пошёл собирать. :)
habib2302
09-04-2013, 20:52
мне кто нибудь ответит на мое сообщение (http://forum.oszone.net/post-2129176-135.html)???
insombia
09-04-2013, 22:57
habib2302 в смысле старую версию?
habib2302
09-04-2013, 23:02
insombia, ну или ранее установленную программу
я просто хочу сделать так,чтобы нельзя повторно установить программу.а если повторно установить,то программа (экзешник) удалял ранее установленную програму
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.