Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 4]
R.i.m.s.k.y.
23-02-2012, 07:33
Лександер, насколько помню вам отвечал, много строчный текст комментируется так: { большой текст, много строк } »
это работает только в секции кода, меня интересует секция файлов и реестра
Gnom_aka_Lexander
23-02-2012, 10:30
меня интересует секция файлов и реестра »
там-же я и ответил - других способов коментирования строк, кроме того, что я показывал, и ты перед этим давал - нету. Совсем нету... Вообще совсем нету. Кстати, С праздником, уважаемые коллеги :)
El Sanchez
23-02-2012, 11:39
Ошибка возникает именно из-за попытки обращения к контролу, который ещё не создан. »
Serega, совершенно верно.
дальше не знаю
Name:.......Parameters: -steam -game hl2 -appid 220 -{code:функция};......... »
Это надо делать в Code с помощью CreateShellLink, когда контролы уже существуют.
это работает только в секции кода, меня интересует секция файлов и реестра »
У Restools с этим просто - выделяешь строки и жмешь на клавишу /, в Code строки будут закомментированы двойным слэш, в остальных секциях точкой с запятой.
BlackPhoenix28
23-02-2012, 14:07
Johny777,
Можно еще спросить по реестру. Собрал скрипт в IS GameScript generator. У меня стоит Windows 7 x64, и все игрушки пишутся вот в эту ветку реестра:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\
И так как я добавляю реестр из reg - файла (вернее просто ветку реестра с моего компа) то будут ли эти игрушки после установки работать скажем на Win XP x32 или на Win 7 x32. Или надо добавлять в скрипт какую то проверку на разрядность системы. Если надо то что и куда добавить. А главное, как ? (Вариант ручками и т.д. прошу не предлагать).
[Setup]
SourceDir=.
OutputDir=Setup
AppName=The Book of Unwritten Tales
AppVerName=The Book of Unwritten Tales
AppVersion=The Book of Unwritten Tales
AppPublisher=HMN Interactive
AppCopyright=HMN Interactive
DefaultDirName={pf}\The Book of Unwritten Tales
DefaultGroupName=The Book of Unwritten Tales
AllowNoIcons=yes
InfoBeforeFile=D:\Картинки\Лицензия.rtf
OutputBaseFilename=setup
WizardImageFile=D:\Картинки\InstallLeft.bmp
WizardSmallImageFile=D:\Картинки\InstallCorner.bmp
SetupIconFile=C:\Program Files (x86)\The Book of Unwritten Tales\Book.ico
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=lzma/ultra
DiskSpanning=yes
DiskSliceSize=524288000
SlicesPerDisk=1
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
[Files]
Source: "D:\Картинки\1.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\10.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\2.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\3.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\4.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\5.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\6.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\7.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\8.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "D:\Картинки\9.jpg"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "isgsg.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "bass.dll"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\20-abspann-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\08-erzmagier_alastair-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\10-das_lied_vom_tod-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\12-unknown-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\15-unknown-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "T:\The Book of Unwritten Tales\Soundtarck\OST-The_Book_Of_Unwritten_Tales-READNFO-2011-I_KnoW\16-ivo-ik.mp3"; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: C:\Users\SASHA\Desktop\Game.reg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: "C:\Program Files (x86)\The Book of Unwritten Tales\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
[Icons]
Name: "{group}\The Book of Unwritten Tales"; Filename: "{app}\bout.exe"; WorkingDir: "{app}";
Name: "{userdesktop}\The Book of Unwritten Tales"; Filename: "{app}\bout.exe"; WorkingDir: "{app}"; Tasks: desktopicon;
Name: "{group}\{cm:UninstallProgram,The Book of Unwritten Tales}"; Filename: "{uninstallexe}"
[Run]
Description: "{cm:LaunchProgram, The Book of Unwritten Tales}"; Filename: "{app}\bout.exe"; WorkingDir: "{app}"; Flags: nowait postinstall skipifsilent unchecked
Filename: {win}\regedit.exe; Parameters: /s {tmp}\Game.reg; StatusMsg: "Вносим изменения в реестр ..."; Flags: waituntilterminated runasoriginaluser
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Code]
const
Indent=25;
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall delayload';
function ssInitialize(hParent:HWND;ssTimeShow:integer;FadeOut:boolean;StretchMode:integer;BkgColor:DWORD):boo lean; external 'ssInitialize@files:isgsg.dll stdcall delayload';
procedure ssDeInitialize; external 'ssDeInitialize@files:isgsg.dll stdcall delayload';
procedure ssAddImage(FileName:PAnsiChar); external 'ssAddImage@files:isgsg.dll stdcall delayload';
procedure ssStartShow; external 'ssStartShow@files:isgsg.dll stdcall delayload';
procedure ssStopShow; external 'ssStopShow@files:isgsg.dll stdcall delayload';
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure ShowMP3Panel(hMainFrm:HWND;StartVolume:integer;DefMP3Dir,BASSDir,MLabel:PAnsiChar;IsShowMP3Info,IsBk gFrmVisible:boolean;ShowTimeMP3Info:integer;dBottom:integer);external 'ShowMP3Panel@files:isgsg.dll stdcall';
procedure KillMP3Panel;external 'KillMP3Panel@files:isgsg.dll stdcall';
function InitializeSetup:boolean;
begin
ExtractTemporaryFile('Game.reg');
ExtractTemporaryFile('20-abspann-ik.mp3');
ExtractTemporaryFile('08-erzmagier_alastair-ik.mp3');
ExtractTemporaryFile('10-das_lied_vom_tod-ik.mp3');
ExtractTemporaryFile('12-unknown-ik.mp3');
ExtractTemporaryFile('15-unknown-ik.mp3');
ExtractTemporaryFile('16-ivo-ik.mp3');
ExtractTemporaryFile('bass.dll');
Result:=True;
end;
procedure InitializeWizard;
begin
ShowMP3Panel(WizardForm.Handle,80,ExpandConstant('{tmp}'),ExpandConstant('{tmp}'),'Repack by BlackPhoenix',True,True,7000,Indent);
ssInitialize(GetWindowLong(MainForm.Handle,-8),10,False,1,$FF000000);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then begin
ExtractTemporaryFile('1.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\1.jpg');
ExtractTemporaryFile('2.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\2.jpg');
ExtractTemporaryFile('3.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\3.jpg');
ExtractTemporaryFile('4.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\4.jpg');
ExtractTemporaryFile('5.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\5.jpg');
ExtractTemporaryFile('6.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\6.jpg');
ExtractTemporaryFile('7.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\7.jpg');
ExtractTemporaryFile('8.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\8.jpg');
ExtractTemporaryFile('9.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\9.jpg');
ExtractTemporaryFile('10.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\10.jpg');
ssStartShow;
end;
if CurStep=ssPostInstall then ssStopShow;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpInstalling then begin
WizardForm.MainPanel.Visible:=False;
WizardForm.Bevel1.Visible:=False;
WizardForm.Width:=ScaleX(395);
WizardForm.Height:=ScaleY(142);
WizardForm.Left:=ScaleX(GetSystemMetrics(0)-WizardForm.Width-Indent);
WizardForm.Top:=ScaleY(GetSystemMetrics(1)-WizardForm.Height-Indent);
WizardForm.InnerNotebook.Left:=ScaleX(10);
WizardForm.InnerNotebook.Top:=ScaleY(10);
WizardForm.InnerNotebook.Width:=ScaleX(370);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(20);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(40);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(154);
WizardForm.CancelButton.Top:=ScaleY(80);
end;
if (CurPageID=wpFinished) or (CurPageID=wpInfoAfter) then begin
if WizardForm.Width<>502 then begin
WizardForm.Visible:=False;
WizardForm.Width:=ScaleX(502);
WizardForm.Height:=ScaleY(392);
WizardForm.Left:=(GetSystemMetrics(0)-WizardForm.Width) div 2;
WizardForm.Top:=(GetSystemMetrics(1)-WizardForm.Height) div 2;
WizardForm.MainPanel.Visible:=True;
WizardForm.Bevel1.Visible:=True;
WizardForm.InnerNotebook.Left:=ScaleX(40);
WizardForm.InnerNotebook.Top:=ScaleY(72);
WizardForm.InnerNotebook.Width:=ScaleX(417);
WizardForm.Visible:=True;
end;
end;
end;
procedure DeinitializeSetup;
begin
KillMP3Panel;
ssDeInitialize;
end;
Gnom_aka_Lexander
23-02-2012, 14:22
BlackPhoenix28, Просто удаляй из пути подпапку Wow6432Node. Тоесть вместо
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\и так далее,
нужно HKEY_LOCAL_MACHINE\SOFTWARE\и так далее.
х32-х64 инно определяет сама, и в х64 автоматом подставит подпапку Wow6432Node в путь.
Если у тебя вдруг будет нужда внести запись без этой подпапки в х64 системе, нужно указать х64-корень.
HKLM64\SOFTWARE\
только не забыть проверку сделать - Check: IsWin64, посколько в х32 системах будет ошибка и нужно исключить такую запись из обработки установщиком.
Johny777
23-02-2012, 16:45
Это надо делать в Code с помощью CreateShellLink, когда контролы уже существуют. »
спасибо за подсказку
вот сделал,
параметры добавляются
всё работает!
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
SolidCompression=yes
Compression=lzma/ultra
PrivilegesRequired=none
OutputDir=.
[_code]
{ RedesignWizardFormBegin } // Íå óäàëÿòü ýòó ñòðîêó!
// Íå èçìåíÿòü ýòó ñåêöèþ. Îíà ñîçäàíà àâòîìàòè÷åñêè.
var
Icon_hl2: TNewCheckBox;
parameters_hl2: TNewEdit;
s1,s2:String;
procedure parameters1OnClick(Sender: TObject); forward;
procedure RedesignWizardForm;
begin
{ Icon_hl2 }
Icon_hl2 := TNewCheckBox.Create(WizardForm);
with Icon_hl2 do
begin
Name := 'Icon_hl2';
Parent := WizardForm.WelcomePage;
Left := ScaleX(200);
Top := ScaleY(208);
Width := ScaleX(161);
Height := ScaleY(17);
Caption := 'create icon for Half-Life 2';
OnClick := @parameters1OnClick;
end;
{ parameters_hl2 }
parameters_hl2 := TNewEdit.Create(WizardForm);
with parameters_hl2 do
begin
Name := 'parameters_hl2';
Parent := WizardForm.WelcomePage;
Left := ScaleX(368);
Top := ScaleY(208);
Width := ScaleX(121);
Height := ScaleY(21);
Text := ' ';
end;
Icon_hl2.TabOrder := 2;
parameters_hl2.TabOrder := 3;
{ ReservationBegin }
// Âû ìîæåòå äîáàâèòü âàø êîä çäåñü.
{ ReservationEnd }
end;
// Íå èçìåíÿòü ýòó ñåêöèþ. Îíà ñîçäàíà àâòîìàòè÷åñêè.
{ RedesignWizardFormEnd } // Íå óäàëÿòü ýòó ñòðîêó!
procedure InitializeWizard();
begin
RedesignWizardForm;
end;
function CreateIconHL2: Boolean;
begin
Result:=Icon_hl2.Checked;
end;
procedure parameters1OnClick(Sender: TObject);
begin
if Icon_hl2.Checked = false then
begin
parameters_hl2.Enabled:= false;
parameters_hl2.visible:= false;
end
else
begin
parameters_hl2.Enabled:= true;
parameters_hl2.visible:= true;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
s2:=parameters_hl2.Text;
s1:=ExpandConstant('-steam -game hl2 -appid 220');
if CurStep = ssPostInstall then
begin
if Icon_hl2.Checked then
CreateShellLink(ExpandConstant('{commondesktop}\Half-Life 2.lnk'), '',
ExpandConstant('{app}\common\half-life 2\hl2.exe'),s1 + s2, ExpandConstant('{app}\common\half-life 2'), ExpandConstant('{app}\common\half-life 2\hl2.ico'), 0, SW_SHOWNORMAL);
/////////////////////////////// ÿðëûê íà ðàáî÷åì ñòîëå //////////////////////////////////////// ê ôàéëó òàêîìó-òî /////////////////// ïàðàìåòðû çàïóñêà /////////////////////// ðàáî÷àÿ ïàïêà //////////////////////////////// ôàéë çíà÷êà ///// 0 ýòî èíäåê èêîíêè ////////
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpWelcome then
begin
parameters_hl2.Hide
end;
end;
[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D003010F601000054504630F10B5457697A617264466F726D0A57697A61726 4466F726D0C436C69656E744865696768740368010B436C69656E74576964746803F101134F6E436F6E73747261696E65645 26573697A650712706172616D6574657273314F6E436C69636B0C4578706C696369744C65667402000B4578706C696369745 46F7002000D4578706C6963697457696474680301020E4578706C69636974486569676874038E010D506978656C735065724 96E636802600A54657874486569676874020D00F10C544E65774E6F7465626F6F6B0D4F757465724E6F7465626F6F6B00F11 0544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650D4578706C69636974576964746803F1010E4578706 C69636974486569676874033901000C544E6577436865636B426F780849636F6E5F686C32044C65667403C80003546F7003D 00005576964746803A1000648656967687402110743617074696F6E061B6372656174652069636F6E20666F722048616C662 D4C6966652032085461624F726465720202074F6E436C69636B0712706172616D6574657273314F6E436C69636B000008544 E6577456469740E706172616D65746572735F686C32044C65667403700103546F7003D000055769647468027906486569676 8740215085461624F72646572020304546578740602603F0000000000
у меня вопрос
как привязать эту функцию к кастомному чекбоксу (раньше у меня на была привязана к задаче Task чарез Check)
function Task_DirectX:boolean; /// DirectX search
var
sz:Integer;
s:string;
begin
Result:=True;
begin
If (FileSearch('DXSETUP.exe', ExpandConstant('{src}\Redist\DirectX10'))='') then
Result:=False
end;
end;
например к этому http://forum.ru-board.com/topic.cgi?forum=5&topic=30413&start=2562&limit=1&m=1#1
и если во внешней папке нет директа, то и чекбокса нет
Johny777, как то криво, но работает :wow:
If not (FileSearch('DXSETUP.exe', ExpandConstant('{src}\Redist\DirectX10'))='') then begin
Icon_hl2 := TNewCheckBox.Create(WizardForm);
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
SolidCompression=yes
Compression=lzma/ultra
PrivilegesRequired=none
OutputDir=.
[Languages]
Name: Russian; MessagesFile: compiler:Languages\Russian.isl;
[_Code]
var
QuickLaunchIcon: TCheckBox;
function MakeQuickLaunchIcon: Boolean;
begin
Result:=QuickLaunchIcon.Checked;
end;
procedure InitializeWizard();
begin
If FileExists(ExpandConstant('{src}\Redist\DirectX10\DXSETUP.exe')) then
begin
QuickLaunchIcon := TCheckBox.Create(WizardForm);
with QuickLaunchIcon do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Создать значок в Панели быстрого запуска';
Left := ScaleX(0);
// Left := WizardForm.DirEdit.Top + 100;
Top := WizardForm.DirEdit.Top + 117;
Width := ScaleX(300);
Height := ScaleY(15);
TabOrder := 0;
Checked := False;
end;
end;
end;
R.i.m.s.k.y.
24-02-2012, 15:06
Johny777, FileExists использовать религия индусская запрещает?
If (not FileExists(ExpandConstant('{src}\Redist\DirectX10\DXSETUP.exe'))) then
begin
Icon_hl2 := TNewCheckBox.Create(WizardForm);
...
R.i.m.s.k.y., чуток подправил :)
If FileExists(ExpandConstant('{src}\Redist\DirectX10\DXSETUP.exe')) then
begin
Icon_hl2 := TNewCheckBox.Create(WizardForm);
...
Давно Инно не занимался, и к стыду своему забыл, что есть функция "Файл существует" :blush:
R.i.m.s.k.y.
24-02-2012, 15:48
nik1967, Johny777
ну это вам виднее, to not or not to be a not
Devils Night
24-02-2012, 16:25
Немного сложный вопрос, интересует вот что:
В сетап имеется
[Setup]
AppName=Имя программы
DefaultDirName={pf}\Папка программы
DefaultGroupName=Папка в меню пуск
и есть компоненты
[Components]
Name: A; Description: Программа 1
Name: B; Description: Программа 2
как сделать так, чтобы например выбираю компонент Программа 1, то при установке, то что в AppName, в DefaultDirName и в DefaultGroupName, название Имя программы, папка в PF Папка программы и папка в пуске Папка в меню пуск заменялось на Программа 1, если выбираю компонент Программа 2, то Имя программы, Папка программы и папка в пуск Папка в меню пуск заменялось на Программа 2, возможно ли такое?
R.i.m.s.k.y.
24-02-2012, 16:31
Devils Night
AppName - это опознаватель программы которую ты ставишь для системы
DefaultGroupName и DefaultDirName объявляются раньше страницы компонентов
Так что никак
Если бы передо мной стояла такая задача, я бы сделал 3 раздельных инсталлера: для Программа 1, для Программа 2 и третий со списком компонентов из "Программа 1, Программа 2" и выбранную прогу ставил втихую
Johny777
24-02-2012, 20:06
R.i.m.s.k.y., nik1967,
спасибо
вот так всё супер
проверил
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
SolidCompression=yes
Compression=lzma/ultra
PrivilegesRequired=none
OutputDir=.
[Languages]
Name: Russian; MessagesFile: compiler:Languages\Russian.isl;
[Run]
Filename: {src}\Redist\DirectX10\DXSETUP.exe; Parameters: /silent; WorkingDir: {src}\Redist\DirectX10; StatusMsg: óñòàíîâêà äèðåêòà; Flags: skipifdoesntexist waituntilterminated; Check: MakeQuickLaunchIcon
[,Code]
var
QuickLaunchIcon: TCheckBox;
function MakeQuickLaunchIcon: Boolean;
begin
Result:=QuickLaunchIcon.Checked;
end;
procedure InitializeWizard();
begin
If FileExists(ExpandConstant('{src}\Redist\DirectX10\DXSETUP.exe')) then
begin
QuickLaunchIcon := TCheckBox.Create(WizardForm);
with QuickLaunchIcon do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Ñîçäàòü çíà÷îê â Ïàíåëè áûñòðîãî çàïóñêà';
Left := ScaleX(0);
// Left := WizardForm.DirEdit.Top + 100;
Top := WizardForm.DirEdit.Top + 117;
Width := ScaleX(300);
Height := ScaleY(15);
TabOrder := 0;
Checked := False;
end;
end;
end;
дальше по аналогии сделаю но с учётом своих названий чекбоксов
Devils Night,
как вариант можно сделать авторан состоящий из одной страницы с двумя переключателями, который после себя запускает одну из 2-х из внешней папки или копирует из самого себя в tmp
у обеих программ сделать полуодинаковые
DefaultDirName={reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1,InstallLocation|{pf}\program1}
DefaultDirName={reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1,InstallLocation|{pf}\program2}
и одинаковые
AppId=p12
AppId=p12
AppName=program1,2 - тоже одинаковые, но скрыть их на странице приветствия например и заменить на свои наименования
а в секции одной [InstallDelete] вписать всё, что нужно удалть от другой и наоборот (ярлыки, файлы в (app) итд)
____________________________________________
скажите пожалуйста
если один файл относится к многим чекбоксам, то нужно писать так?
[Files]
.....; Check: 1 and 2 and 3
или так
.....; Check: 1 or 2 or 3
Devils Night
25-02-2012, 14:37
Так что никак »Плохо.
и третий со списком компонентов из "Программа 1, Программа 2 »Две программмы в одну программу не вариант.
как вариант можно сделать авторан »Только и остаётся, это как раз вариант.
с двумя переключателями, который после себя запускает одну из 2-х из внешней папки »Что то я не догнал.
В моём случае скорее подошло бы так:
[Setup]
AppName=AutoRUN
VersionInfoDescription=AutoRUN
VersionInfoProductName=AutoRUN
AppVerName=AutoRUN
VersionInfoProductVersion=1.0.0.0
VersionInfoVersion=1.0.0.0
VersionInfoCompany=john
VersionInfoCopyright=Copyright © John
CreateAppDir=no
OutputDir=.
OutputBaseFilename=Autorun
;SetupIconFile=Icon.ico
[Languages]
Name: Russian; MessagesFile: compiler:Default.isl
[Files]
Source: 1.bmp; Flags: dontcopy
[Messages]
SetupAppTitle=AutoRUN
[ Code]
const
BM_CLICK = $00F5;
var
AutoRun: TSetupForm;
img1: TBitmapImage;
PlayButton, InstallButton, UninstallButton, ExitButton: TButton;
AppPath,UninsPath: string;
ResultCode: Integer;
procedure CurPageChanged(CurPageID: Integer);
begin
If CurPageID=wpWelcome then
SendMessage(WizardForm.NextButton.Handle, BM_CLICK, 0, 0);
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False
Cancel:=True
end;
procedure InstallButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
Exec(ExpandConstant('{src}\Setup.exe'),'','',SW_SHOW,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure ExitButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure UninstallButtonClick(Sender: TObject);
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
UninsPath:=RemoveQuotes(UninsPath)
Exec(UninsPath,'','',SW_SHOWNORMAL,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end
end;
procedure CreateAutoRun;
begin
//AutoRun
AutoRun := CreateCustomForm;
with AutoRun do begin
Left := 498;
Top := 75;
Width := 495;
Height := 200;
BorderIcons := [];
BorderStyle:=bsToolWindow //(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Position := poScreenCenter;
Caption:='AutoRUN'
end;
//img
img1 := TBitmapImage.Create(AutoRun);
ExtractTemporaryFile('1.bmp');
with img1 do begin
Parent := AutoRun;
Left := 0;
Stretch:= true;
Top := 0;
Width := Autorun.Width;
Height := Autorun.Height;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
end;
//InstallButton
InstallButton:= TButton.Create(AutoRun);
with InstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 80;
Width := 150;
Height := 22;
Caption:= 'Установить';
Cursor:= crHand;
OnClick := @InstallButtonClick;
end;
//UninstallButton
UninstallButton:= TButton.Create(AutoRun);
with UninstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 110;
Width := 150;
Height := 22;
Caption:= 'Удалить';
Cursor:= crHand;
OnClick := @UninstallButtonClick;
end;
//ExitButton
ExitButton:= TButton.Create(AutoRun);
with ExitButton do begin
Parent:= AutoRun;
Left := 300;
Top := 140;
Width := 150;
Height := 22;
Caption:= 'Выход';
Cursor:= crHand;
OnClick := @ExitButtonClick;
end;
if not RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=true;
UninstallButton.Enabled:=false;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=false;
UninstallButton.Enabled:=true;
end;
AutoRun.ShowModal;
end;
procedure InitializeWizard;
begin
CreateAutoRun;
end;
+
[ Code]var
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure RedesignWizardForm;
begin
RadioButton1 := TRadioButton.Create(WizardForm);
with RadioButton1 do
begin
Name := 'Button1';
Parent := WizardForm.SelectTasksPage;
Left := 40;
Top := 80;
Width := 113;
Height := 17;
end;
RadioButton2 := TRadioButton.Create(WizardForm);
with RadioButton2 do
begin
Name := 'Button2';
Parent := WizardForm.SelectTasksPage;
Left := 40;
Top := 110;
Width := 113;
Height := 17;
end;
RadioButton3 := TRadioButton.Create(WizardForm);
with RadioButton3 do
begin
Name := 'Button3';
Parent := WizardForm.SelectTasksPage;
Left := 40;
Top := 140;
Width := 113;
Height := 17;
end;
RadioButton1.TabOrder := 2;
RadioButton2.TabOrder := 3;
RadioButton3.TabOrder := 4;
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
end;но чтоб каждый RadioButton выбирался как исключительным (не всё вместе), но чтоб все 3 были привязаны к одной кнопки установить, а вот как это сделать я незнаю.
Johny777
25-02-2012, 18:58
Devils Night,
вот "автозапуск"
ищет во внешней папке program
setup_1.exe
setup_2.exe
setup_3.exe
если одного из них нет, то нет переключателя
; Скрипт создан с помощью
; IS GameScript Generator by South
; специально для www.csmania.ru
#define MyAppName "Autorun"
[Setup]
SourceDir=.
OutputDir=Setup
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppName}
CreateAppDir=false
OutputBaseFilename={#MyAppName}
Uninstallable=false
//SetupIconFile=hl2.ico
ShowLanguageDialog=auto
LanguageDetectionMethod=uilanguage
UsePreviousLanguage=no
DisableProgramGroupPage=yes
DisableWelcomePage=yes
DisableDirPage=true
DisableFinishedPage=yes
[Languages]
Name: Russian; MessagesFile: compiler:Languages\Russian.isl;
Name: English; MessagesFile: compiler:Languages\English.isl;
[Messages]
Russian.SetupWindowTitle=%1
Russian.WizardReady=что установить?
Russian.ReadyLabel2b=
[CustomMessages]
Russian.go=Установить
English.go=Install
Russian.exit=Закрыть
English.exit=Close
[run]
Filename: {src}\program\setup_1.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: X;
Filename: {src}\program\setup_2.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Y;
Filename: {src}\program\setup_2.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Z;
[----Code]
var
install_1: TNewRadioButton;
install_2: TNewRadioButton;
install_3: TNewRadioButton;
function X: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
Result:=install_1.Checked;
end;
function Y: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
Result:=install_2.Checked;
end;
function Z: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
Result:=install_3.Checked;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:=True;
end;
procedure InitializeWizard();
begin
WizardForm.InnerPage.Color := clInfoBk;
WizardForm.Color := clActiveCaption;
WizardForm.MainPanel.Color := clActiveCaption;
WizardForm.WizardSmallBitmapImage.Visible := False;
WizardForm.BorderStyle := bsToolWindow;
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
begin
install_1 := TNewRadioButton.Create(WizardForm);
with install_1 do
begin
Name := 'install_1';
Parent := WizardForm.ReadyPage;
Left := ScaleX(16);
Top := ScaleY(24);
Width := ScaleX(113);
Height := ScaleY(17);
Caption := 'program 1';
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
begin
install_2 := TNewRadioButton.Create(WizardForm);
with install_2 do
begin
Name := 'install_2';
Parent := WizardForm.ReadyPage;
Left := ScaleX(80);
Top := ScaleY(64);
Width := ScaleX(113);
Height := ScaleY(17);
Caption := 'program 2';
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
begin
install_3 := TNewRadioButton.Create(WizardForm);
with install_3 do
begin
Name := 'install_3';
Parent := WizardForm.ReadyPage;
Left := ScaleX(136);
Top := ScaleY(112);
Width := ScaleX(113);
Height := ScaleY(17);
Caption := 'program 3';
end;
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpReady then
begin
WizardForm.PageDescriptionLabel.Hide;
WizardForm.NextButton.Caption:= ExpandConstant('{cm:go}');
WizardForm.CancelButton.Caption:= ExpandConstant('{cm:exit}');
end;
end;
Johny777
25-02-2012, 19:41
не успел удалить првый и ты его же и взял
я переделал
в первом ошибки были
сейчас протестировал
всё работает
попробуй!
(пост выше)
или вот архивом
http://rghost.ru/36704123
Devils Night
25-02-2012, 21:10
попробуй! »Всё конечно круто, но, где надпись "что установить? " идёт полоска, да и сама надпись ненужны, а так же внизу кнопки "Установить", "Закрыть", полоска тоже не нужна. Нужен фон картинка, желательно в PNG.
Что не так, как сделать?
[Setup]
AppName=AutoRUN
VersionInfoDescription=AutoRUN
VersionInfoProductName=AutoRUN
AppVerName=AutoRUN
VersionInfoProductVersion=1.0.0.0
VersionInfoVersion=1.0.0.0
VersionInfoCompany=john
VersionInfoCopyright=Copyright © John
CreateAppDir=no
OutputDir=.
OutputBaseFilename=Autorun
;SetupIconFile=Icon.ico
[Languages]
Name: Russian; MessagesFile: compiler:Default.isl
[Run]
Filename: {src}\program\setup_1.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: X;
Filename: {src}\program\setup_2.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Y;
Filename: {src}\program\setup_3.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Z;
[Files]
Source: 1.bmp; Flags: dontcopy
[Messages]
SetupAppTitle=AutoRUN
[ Code]
const
BM_CLICK = $00F5;
var
AutoRun: TSetupForm;
img1: TBitmapImage;
PlayButton, InstallButton, UninstallButton, ExitButton: TButton;
AppPath,UninsPath: string;
ResultCode: Integer;
procedure CurPageChanged(CurPageID: Integer);
begin
If CurPageID=wpWelcome then
// if CurPageID=wpReady then //
// begin
// WizardForm.PageDescriptionLabel.Hide;
// WizardForm.NextButton.Caption:= ExpandConstant('{cm:go}');
// WizardForm.CancelButton.Caption:= ExpandConstant('{cm:exit}');
// end;
SendMessage(WizardForm.NextButton.Handle, BM_CLICK, 0, 0);
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False
Cancel:=True
end;
procedure InstallButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
Exec(ExpandConstant('{src}\Setup.exe'),'','',SW_SHOW,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure ExitButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure UninstallButtonClick(Sender: TObject);
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
UninsPath:=RemoveQuotes(UninsPath)
Exec(UninsPath,'','',SW_SHOWNORMAL,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end
end;
procedure CreateAutoRun;
begin
//AutoRun
AutoRun := CreateCustomForm;
with AutoRun do begin
Left := 498;
Top := 75;
Width := 495;
Height := 200;
BorderIcons := [];
BorderStyle:=bsToolWindow //(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Position := poScreenCenter;
Caption:='AutoRUN'
end;
//img
img1 := TBitmapImage.Create(AutoRun);
ExtractTemporaryFile('1.bmp');
with img1 do begin
Parent := AutoRun;
Left := 0;
Stretch:= true;
Top := 0;
Width := Autorun.Width;
Height := Autorun.Height;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
end;
//InstallButton
InstallButton:= TButton.Create(AutoRun);
with InstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 80;
Width := 150;
Height := 22;
Caption:= 'Install';
Cursor:= crHand;
OnClick := @InstallButtonClick;
end;
//UninstallButton
UninstallButton:= TButton.Create(AutoRun);
with UninstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 110;
Width := 150;
Height := 22;
Caption:= 'Удалить';
Cursor:= crHand;
OnClick := @UninstallButtonClick;
end;
//ExitButton
ExitButton:= TButton.Create(AutoRun);
with ExitButton do begin
Parent:= AutoRun;
Left := 300;
Top := 140;
Width := 150;
Height := 22;
Caption:= 'Выход';
Cursor:= crHand;
OnClick := @ExitButtonClick;
end;
if not RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=true;
UninstallButton.Enabled:=false;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=false;
UninstallButton.Enabled:=true;
end;
AutoRun.ShowModal;
end;
var
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
function X: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
Result:=RadioButton1.Checked;
end;
function Y: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
Result:=RadioButton2.Checked;
end;
function Z: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
Result:=RadioButton3.Checked;
end;
//**********************Закоментировал дубль*****************************
//procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
//begin
//Confirm:=False;
//Cancel:=True;
//end;
//**********************Закоментировал дубль*****************************
procedure InitializeWizard();
begin
WizardForm.InnerPage.Color := clInfoBk;
WizardForm.Color := clActiveCaption;
WizardForm.MainPanel.Color := clActiveCaption;
WizardForm.WizardSmallBitmapImage.Visible := False;
WizardForm.BorderStyle := bsToolWindow;
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
begin
RadioButton1 := TRadioButton.Create(WizardForm);
with RadioButton1 do
begin
Name := 'RadioButton1';
Parent := WizardForm.ReadyPage;
Left := 40;
Top := 80;
Width := 113;
Height := 17;
Caption := 'program 1';
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
begin
RadioButton2 := TRadioButton.Create(WizardForm);
with RadioButton2 do
begin
Name := 'RadioButton2';
Parent := WizardForm.ReadyPage;
Left := 40;
Top := 110;
Width := 113;
Height := 17;
Caption := 'program 2';
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
begin
RadioButton3 := TRadioButton.Create(WizardForm);
with RadioButton3 do
begin
Name := 'RadioButton3';
Parent := WizardForm.ReadyPage;
Left := 40;
Top := 140;
Width := 113;
Height := 17;
Caption := 'program 3';
end;
end;
CreateAutoRun;
end;
Нужен авторан на основе:
[Setup]
AppName=AutoRUN
VersionInfoDescription=AutoRUN
VersionInfoProductName=AutoRUN
AppVerName=AutoRUN
VersionInfoProductVersion=1.0.0.0
VersionInfoVersion=1.0.0.0
VersionInfoCompany=john
VersionInfoCopyright=Copyright © John
CreateAppDir=no
OutputDir=.
OutputBaseFilename=Autorun
;SetupIconFile=Icon.ico
[Languages]
Name: Russian; MessagesFile: compiler:Default.isl
[Files]
Source: 1.bmp; Flags: dontcopy
[Messages]
SetupAppTitle=AutoRUN
[ Code]
const
BM_CLICK = $00F5;
var
AutoRun: TSetupForm;
img1: TBitmapImage;
PlayButton, InstallButton, UninstallButton, ExitButton: TButton;
AppPath,UninsPath: string;
ResultCode: Integer;
procedure CurPageChanged(CurPageID: Integer);
begin
If CurPageID=wpWelcome then
SendMessage(WizardForm.NextButton.Handle, BM_CLICK, 0, 0);
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False
Cancel:=True
end;
procedure InstallButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
Exec(ExpandConstant('{src}\Setup.exe'),'','',SW_SHOW,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure ExitButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;
procedure UninstallButtonClick(Sender: TObject);
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
UninsPath:=RemoveQuotes(UninsPath)
Exec(UninsPath,'','',SW_SHOWNORMAL,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end
end;
procedure CreateAutoRun;
begin
//AutoRun
AutoRun := CreateCustomForm;
with AutoRun do begin
Left := 498;
Top := 75;
Width := 495;
Height := 200;
BorderIcons := [];
BorderStyle:=bsToolWindow //(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Position := poScreenCenter;
Caption:='AutoRUN'
end;
//img
img1 := TBitmapImage.Create(AutoRun);
ExtractTemporaryFile('1.bmp');
with img1 do begin
Parent := AutoRun;
Left := 0;
Stretch:= true;
Top := 0;
Width := Autorun.Width;
Height := Autorun.Height;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
end;
//InstallButton
InstallButton:= TButton.Create(AutoRun);
with InstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 80;
Width := 150;
Height := 22;
Caption:= 'Установить';
Cursor:= crHand;
OnClick := @InstallButtonClick;
end;
//UninstallButton
UninstallButton:= TButton.Create(AutoRun);
with UninstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 110;
Width := 150;
Height := 22;
Caption:= 'Удалить';
Cursor:= crHand;
OnClick := @UninstallButtonClick;
end;
//ExitButton
ExitButton:= TButton.Create(AutoRun);
with ExitButton do begin
Parent:= AutoRun;
Left := 300;
Top := 140;
Width := 150;
Height := 22;
Caption:= 'Выход';
Cursor:= crHand;
OnClick := @ExitButtonClick;
end;
if not RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=true;
UninstallButton.Enabled:=false;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=false;
UninstallButton.Enabled:=true;
end;
AutoRun.ShowModal;
end;
procedure InitializeWizard;
begin
CreateAutoRun;
end;но с RadioButton.
Johny777
25-02-2012, 21:32
Devils Night,
в дизайнере открой
на странице Ready сдвинь влево на 1000 пикселей что не нужно или visible= false
картинку можешь встаить bmp там же
пнг это через ботву, которую я ни разу не использовал
можно бмп в фотошопе полупрозрачным сделать
...или позже сам доделаю
ненужны, а так же внизу кнопки "Установить", "Закрыть", »
ладно кнопка "закрыть", но без "установить" с тремя переключателями как им пользоваться? o_O
Devils Night
25-02-2012, 21:43
в дизайнере открой
на странице Ready сдвинь влево на 1000 пикселей что не нужно или visible= false »Да причём здесь инсталл, когда хочу с автораном из справки разобраться?!
нужно не из авторана в инсталятор функции добавить, а в авторан, в котором уже почти всё присутствует кроме RadioButton.
ладно кнопка "закрыть", но без "установить" с тремя переключателями как им пользоваться? »Я вообще то не про кнопки, а про обрамление вокруг них.
Johny777
26-02-2012, 02:28
Я вообще то не про кнопки, а про обрамление вокруг них. »
используй скин (добавил)
добавил всплывающие подсказки
добавил константы названий и всплывающих подсказок/описаний переключателей
не зная как сделать чекбоксы и их названия прозрачными разместил их все на панели
вот код
; Скрипт создан с помощью
; IS GameScript Generator by South
; специально для www.csmania.ru
#define MyAppName "Autorun"
[Setup]
SourceDir=.
OutputDir=Setup
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppName}
CreateAppDir=false
OutputBaseFilename={#MyAppName}
Uninstallable=false
//SetupIconFile=hl2.ico
ShowLanguageDialog=auto
LanguageDetectionMethod=uilanguage
UsePreviousLanguage=no
DisableProgramGroupPage=yes
DisableWelcomePage=yes
DisableDirPage=true
DisableFinishedPage=yes
[Files]
DestName: "WizardForm.Image.bmp"; Source: "Image.bmp"; Flags: dontcopy solidbreak
Source: ISSkin.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: skin.cjstyles; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
[Languages]
Name: Russian; MessagesFile: compiler:Languages\Russian.isl;
Name: English; MessagesFile: compiler:Languages\English.isl;
[Messages]
Russian.SetupWindowTitle=%1
WizardReady=
ReadyLabel2b=
[CustomMessages]
Russian.go=Установить
English.go=Install
Russian.exit=Закрыть
English.exit=Close
Russian.desc1=описание первой программы
English.desc1=
Russian.desc2=описание второй программы
English.desc3=
Russian.desc3=описание третьей программы
English.desc3=
Russian.p1=название первой программы
English.p1=
Russian.p2=название второй программы
English.p2=
Russian.p3=название третьей программы
English.p3=
[run]
Filename: {src}\program\setup_1.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: X;
Filename: {src}\program\setup_2.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Y;
Filename: {src}\program\setup_2.exe; WorkingDir: {src}\program; Flags: skipifdoesntexist nowait; Check: Z;
[.......Code]
var
install_1: TNewRadioButton;
install_2: TNewRadioButton;
install_3: TNewRadioButton;
Initialize:Boolean;
Image: TBitmapImage;
Panel1: TPanel;
procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall';
procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
function InitializeSetup:boolean;
begin
Initialize:=False;
ExtractTemporaryFile('skin.cjstyles');
LoadSkin(ExpandConstant('{tmp}')+'\skin.cjstyles', '');
Result:=True;
Result:=True;
end;
function X: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
Result:=install_1.Checked;
end;
function Y: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
Result:=install_2.Checked;
end;
function Z: Boolean;
begin
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
Result:=install_3.Checked;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
Cancel:=True;
end;
procedure InitializeWizard();
begin
WizardForm.CancelButton.BringToFront;
WizardForm.NextButton.BringToFront;
WizardForm.CancelButton.Left := ScaleX(120);
WizardForm.CancelButton.Top := ScaleY(30);
WizardForm.NextButton.Left := ScaleX(20);
WizardForm.NextButton.Top := ScaleY(30);
WizardForm.BorderStyle := bsToolWindow;
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.ClientHeight := ScaleY(539);
WizardForm.ClientWidth := ScaleX(719);
Panel1 := TPanel.Create(WizardForm);
with Panel1 do
begin
Name := 'Panel1';
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(60);
Width := ScaleX(180);
Height := ScaleY(90);
BevelOuter := bvLowered;
Caption := '';
end;
Image := TBitmapImage.Create(WizardForm);
with Image do
begin
Name := 'Image';
Parent := WizardForm;
Left := ScaleX(0);
Top := ScaleY(0);
Width := ScaleX(719);
Height := ScaleY(539);
ExtractTemporaryFile('WizardForm.Image.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.Image.bmp'));
end;
If FileExists(ExpandConstant('{src}\program\setup_1.exe')) then
begin
install_1 := TNewRadioButton.Create(WizardForm);
with install_1 do
begin
Name := 'install_1';
Parent := Panel1;
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(190);
Height := ScaleY(17);
Caption := ExpandConstant('{cm:p1}');
Hint := ExpandConstant('{cm:desc1}');
ShowHint := True;
Checked:= True;
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_2.exe')) then
begin
install_2 := TNewRadioButton.Create(WizardForm);
with install_2 do
begin
Name := 'install_2';
Parent := Panel1;
Left := ScaleX(10);
Top := ScaleY(35);
Width := ScaleX(190);
Height := ScaleY(17);
Caption := ExpandConstant('{cm:p2}');
Hint := ExpandConstant('{cm:desc2}');
ShowHint := True;
Checked:= True;
end;
end;
If FileExists(ExpandConstant('{src}\program\setup_3.exe')) then
begin
install_3 := TNewRadioButton.Create(WizardForm);
with install_3 do
begin
Name := 'install_3';
Parent := Panel1;
Left := ScaleX(10);
Top := ScaleY(60);
Width := ScaleX(190);
Height := ScaleY(17);
Caption := ExpandConstant('{cm:p3}');
Hint := ExpandConstant('{cm:desc3}');
ShowHint := True;
Checked:= True;
end;
end;
Initialize:=True;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpReady then
begin
WizardForm.PageDescriptionLabel.Hide;
WizardForm.NextButton.Caption:= ExpandConstant('{cm:go}');
WizardForm.CancelButton.Caption:= ExpandConstant('{cm:exit}');
end;
end;
procedure DeinitializeSetup;
begin
if Initialize then
begin
ShowWindow(WizardForm.Handle,0);
UnloadSkin();
end;
end;
или архив с картинкой :), библиотекой и скином
http://rghost.ru/36712056
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.