2012-01-17 6 views
6

मैं एक स्क्रिप्ट है कि उपयोगकर्ताओं को चुनने के लिए की आवश्यकता है जो आवेदन के कुछ हिस्सों को स्थापित करने के लिए लिख रहा हूँ: केवल केवलInno सेटअप - का सही उपयोग [प्रकार], [अवयव] और [कार्य]

आवेदन, डेटाबेस इंजन, डाटा केवल, या इनमें से कोई संयोजन।

मैं जानता हूँ कि मैं इन परिभाषित करने के लिए [Components] अनुभाग का उपयोग किया जाना चाहिए, लेकिन मैं प्रकार, अवयव और कार्य के बीच परस्पर क्रिया से उलझन में हो रही हूँ - एक के लिए, मैंने सोचा [Tasks] "अतिरिक्त" प्रतिष्ठानों के लिए था, लेकिन फिर मैं कोड देखा जो स्पष्ट रूप से तीनों को जोड़ता है।

क्या कोई मुझे इन कार्यों को एक साथ कैसे करने के बारे में एक अच्छी व्याख्या के लिए इंगित कर सकता है? - मुझे यकीन है कि वहाँ एक है हूँ ...

धन्यवाद

उत्तर

12

अवयव एक या अधिक प्रकार के बने होते हैं। स्क्रिप्ट में आप घटक का उपयोग के आधार पर चयनकर्ता के रूप में अंतिम उपयोगकर्ता द्वारा चुने गए का उपयोग करेंगे। अवयवकार्य में इस्तेमाल किया जा सकता है क्योंकि प्रकार उपयोगकर्ता एक टास्क है या नहीं होगा द्वारा चुना के आधार पर निष्पादित किया जाना है।

उदाहरण के लिए:

; '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

क्या होगा यदि कुछ निश्चित फाइलों का चयन किया जाता है तो कुछ फ़ाइलें केवल तभी स्थापित की जाती हैं? क्या उन्हें अभी भी निर्दिष्ट घटक की आवश्यकता है? – Nyerguds

1

मेरे समझ है कि एक घटक एक मूल रूप से फ़ाइलों का एक सेट है है - यह एक प्रमुख क्या स्थापित किया जा सकता की 'घटक' का गठन किया। स्थापना का एक 'प्रकार' घटकों का चयन है जो इसे एक साथ स्थापित करने के लिए समझ में आता है। यहां मैं जिस तरह से @ az01 के उदाहरण को कोड दूंगा।

; 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  
संबंधित मुद्दे