بسم الله الرحمن الرحيم
برنامج inno شهير في تحزيم البرامج أيا كان لغتها المكتوبة بها ولست اليوم بصدد شرح ما هو معلوم واضح من طرائق التحزيم وإنما القصد شيئا خاصا لم أجد من تعرض له في المنتديات العربية فأحببت أن أغنيها بشيء مما توصلت إليه بعد البحث والتجربة
المطلوب هو تحزيم برنامجين الأول هو الرئيسي والثاني سيرفر لإدارة قواعد البيانات وليكن مثلا firebird
ونريد أن نظهر للمستخدم نافذة نخيره فيها بين تسطيب البرنامج مع السيرفر أم تسطيب البرنامج وحده اي بصفة عميل ...فإن اختار الأول انطلق تنصيب السيرفر وإن اختار الثاني تجاوز تصطيب السيرفر
العمل
هو هذا السكريبت ( بعضه منقول وبعضه الآخر من تصميمي لذلك فأنت لن تجده بهذا الشكل إلا في هذا المنتدى)
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "GestSHB"
#define MyAppVersion "1.1.5"
#define MyAppPublisher "SHBSOFT"
#define MyAppURL "http://www.shbsoft-fr.blogspot.com"
#define MyAppExeName "gestshb.exe"
[ code ]
var
FullRadioButton: TNewRadioButton;
PartRadioButton: TNewRadioButton;
i:integer;
procedure InitializeWizard;
var
CustomPage: TWizardPage;
ResultCode: integer;
begin
CustomPage := CreateCustomPage(wpWelcome, 'Installation type', '');
FullRadioButton := TNewRadioButton.Create(WizardForm);
FullRadioButton.Parent := CustomPage.Surface;
FullRadioButton.Checked := True;
FullRadioButton.Top := 16;
FullRadioButton.Width := CustomPage.SurfaceWidth;
FullRadioButton.Font.Style := [fsBold];
FullRadioButton.Font.Size := 9;
FullRadioButton.Caption := 'Seveur'
PartRadioButton := TNewRadioButton.Create(WizardForm);
PartRadioButton.Parent := CustomPage.Surface;
PartRadioButton.Top := 80;
PartRadioButton.Width := CustomPage.SurfaceWidth;
PartRadioButton.Font.Style := [fsBold];
PartRadioButton.Font.Size := 9;
PartRadioButton.Caption := 'Client'
end;
//===================================
procedure CurPageChanged(CurPageID: Integer);
var ResultCode: integer;
begin
i:=i+1;
begin
if (i=3) and (FullRadioButton.Checked) then
begin
Exec(ExpandConstant('Firebird.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) ;
end
end
//result:=true;
end;
//===================================
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{45A5A8E9-5741-4F70-8C09-0FB160D257AF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=GestSHB.1.1.5
Compression=lzma
SolidCompression=yes
[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: "C:\Users\ahmed\Desktop\gestion\gestshb.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\ahmed\Desktop\temporaire\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchiconستجد المثال في المدونة
