InstallShield 之String Table /property /path變數

來源:互聯網
上載者:User

仔細瞭解了下,InstallShield這幾種定義的變數的用法:
1.String Tables裡的變數:
Installation Information->General Information->String Tables 在設定的語言中:如Chinese(Simplified)  添加變數TestStr 並設定值。在Script中使用方法:
eg.

STRING tempStr;
BEGIN
     tempStr=@TestStr;
MessageBox(tempStr,INFORMATION);
END;

2.Property:
Behavior and Logic->Property Manager 添加變數如SoloProperty.在Script中使用文法:
eg.

function OnBegin()     
STRING tempStr,tempStr2;  
   STRING svUsername[256];
    NUMBER nBuffer;
begin
    nBuffer = 256;
    MsiGetProperty(ISMSI_HANDLE, "SoloProperty", svUsername, nBuffer);
    MessageBox("SoloProperty Value is = " + svUsername, INFORMATION); 
    Exit;
end;

A useful function like this,:-):
Code:

prototype STRING GetValue(STRING);
prototype VOID SetValue(STRING, STRING);

function STRING GetValue(szName)
    STRING szResult;
    NUMBER nLength;
    NUMBER nRetVal;
begin
    nLength = 1024;
    nRetVal = MsiGetProperty(ISMSI_HANDLE, szName, szResult, nLength);
    if(nRetVal != ERROR_SUCCESS) then
        MessageBox("Error retrieving value for: " + szName, WARNING);
    endif;
    return szResult;
end;             

function VOID SetValue(szName, szValue)
    NUMBER nRetVal;
begin
    nRetVal = MsiSetProperty(ISMSI_HANDLE, szName, szValue);
    if(nRetVal != ERROR_SUCCESS) then
        MessageBox("Error setting value for: " + szName, WARNING);
    endif;
end;

useage Code:

svMyValue = GetValue("SOME_PROPERTY");
SetValue("SOME_OTHER_PROPERTY", svMyValue);

3. Path variables:
Media->Path Variables
找到這句話:

Path variables used to represent source paths are not available at run time, only at build time.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.