1
我想提供幾種不同的安裝類型,對我的安裝程序執行不同的操作:如果選擇「ApplicationServer」類型,則只執行部分代碼。如果選擇客戶端類型,則只執行這部分過程。Inno Setup根據安裝類型運行代碼
我試圖包括一個被調用的函數內的代碼2「塊」
[Types]
Name: "application"; Description: "{cm:ApplicationServer}"
Name: "client"; Description: "{cm:Client}"
[CustomMessages]
ApplicationServer=Application Server:
Client=Client:
如果選擇的第一選擇,我想執行由若干程序,常數,變量運行的特定代碼SQL腳本的序列,而如果選擇第二我需要執行一些其他東西進入代碼區,像這樣:
[Code]
function ApplicationServer(blabla)
begin:
{ <!This part only to run for ApplicationServer type!> }
{ following constants and variables for the ADO Connection + SQL script run }
const
myconstant1=blabla;
var
myvar1=blabla;
{ here all the procedure to define and manage an ADO Connection to run a sql script }
{ procedure 1 }
{ procedure 2 }
end
function Client(blabla)
begin:
{ <!This part only to run for Client type!> }
{ following constants and variables only for performing some stuffs on top of client }
const
myconstant2=blabla;
var
myvar2=blabla;
{ procedure 3 }
{ procedure 4 }
end
有管理的代碼的特定部分,根據類型運行方式的安裝運行?
謝謝。
感謝您的建議! [code]部分中定義的常量和變量僅用於運行sql腳本(即,僅用於「應用程序服務器」類型)。因此,在您建議的腳本之前,可能需要將它們全部定義爲全局。 什麼是不明確,因爲我沒有抓住很多例子是如何使用上面提到的WizardSetupType函數。 您能否提供更多關於此的更多細節? – Luca
我的不好:我忘記了。我道歉。 – Luca
到目前爲止,我通過將另一部分代碼嵌入到另一個inno腳本中找到了一種替代方法:只要應用程序類型在主腳本上運行,就會調用此方法。再次感謝您的建議馬丁 – Luca