2012-01-17 9 views
6

:Inno Setup - doğru kullanımı [Türleri], [Components] ve [Görevler] Ben uygulamanın parçaları yüklemeyi tercih kullanıcıların gerektiren bir senaryo yazıyorum

Uygulama sadece, veri tabanı Motor sadece, Data sadece veya bunların herhangi bir kombinasyonu.

Ben bu tanımlamaya [Components] bölümünü kullanarak gerektiğini biliyorum ama Türleri, Bileşenlerinin ve Görevler arasında etkileşimin karıştı yok am - biri için, ben [Tasks] "ekstra" yüklemeleri için olduğunu düşündüm, ama sonra kod gördüm Bu açıkça üç bağlar.

Bunların nasıl birlikte çalıştıklarına dair iyi bir açıklamaya işaret eden var mı? - Ben ... bir tane var eminim

Teşekkür

cevap

12

Bileşenler bir veya birden fazla Türleri yapılmıştır. Komut dosyasında son kullanıcı tarafından seçilen Bileşenleri seçiciyi Tür'a göre seçersiniz. Bir Görev ya olmaz kullanıcı tarafından seçilen Türleri bağlı yürütülecek çünkü BileşenleriGörevler kullanılabilir. Örneğin

:

; 'Types': What get displayed during the setup 
[Types] 
Name: "full";  Description: "Full installation"; 
Name: "app";  Description: "Fapplication only"; 
Name: "dbengine"; Description: "Database engine only"; 
Name: "data";  Description: "Data only"; 

; Components are used inside the script and can be composed of a set of 'Types' 
[Components] 
Name: "full";  Description: "Full installation"; Types: full app dbengine app 
Name: "app";  Description: "Fapplication only"; Types: app 
Name: "dbengine"; Description: "Database engine only";Types: dbengine 
Name: "data";  Description: "Data only";   Types: data 

; Defines which files are setup, based on the differents components 
[Files] 
Source: "MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: full app 
Source: "ADll.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: full app 
Source: "Engine.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: full dbengine 
Source: "data_0";  DestDir: "{app}"; Flags: ignoreversion; Components: full data 
Source: "data_1";  DestDir: "{app}"; Flags: ignoreversion; Components: full data 

; In the same fashion, a task can be set for a specific component 
[Tasks] 
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Components: full app 
+0

Belirli dosyalar yalnızca belirli bir görev seçildiğinde yüklenirse ne olur? O zaman hala belirtilen Bileşenlere ihtiyaçları var mı? – Nyerguds

1

Benim anlayış bir Bileşen dosyaları bir temelde bir dizi olmasıdır - bu monte edilebilir ne kadar önemli 'bileşeni' oluşturmaktadır. Bir 'yükleme' türü, birlikte yüklemek için anlamlı olan bileşenlerden bir seçenektir. İşte ben @ az01'in örneğini kodlama şeklim.

; Lists types of installations - the user is presented 
; with a list containing these Descriptions: 
[Types] 
Name: "full";  Description: "Full installation"; 
Name: "app-only"; Description: "Application only"; 
Name: "engine-only"; Description: "Database engine only"; 
Name: "data-only"; Description: "Data only"; 

; This lists the installable components of the product and 
; specifies which type of install they are included in 
[Components] 
Name: "app";  Description: "Application";  Types: full app-only 
Name: "engine"; Description: "Database engine"; Types: full engine-only 
Name: "data";  Description: "Data";   Types: full data-only 

; each file is assigned to one component, unless it is shared between 
; components, in which case maybe it should go in a 'shared' component. 
[Files] 
Source: "MyApp.exe"; DestDir: "{app}"; Flags:; Components: app 
Source: "ADll.dll"; DestDir: "{app}"; Flags:; Components: app 
Source: "Engine.dll"; DestDir: "{app}"; Flags:; Components: engine 
Source: "data_0";  DestDir: "{app}"; Flags: ignoreversion; Components: data 
Source: "data_1";  DestDir: "{app}"; Flags: ignoreversion; Components: data  
İlgili konular