zoukankan      html  css  js  c++  java
  • InstallShield 之String Table /property /path变量

    仔细了解了下,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(
    STRINGSTRING);

    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.
  • 相关阅读:
    maven常用命令介绍(持续更新)
    JQ笔记
    AspNetPager学习使用2
    AspNetPager学习使用1
    VS2012添加ADO实体数据模型
    手动拍摄0008
    程序自动拍摄0007
    曝光补偿0006
    白平衡0005
    感光度0004
  • 原文地址:https://www.cnblogs.com/solo/p/921202.html
Copyright © 2011-2022 走看看