Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Inno setup 根据Inno设置中的用户输入更改AppName_Inno Setup - Fatal编程技术网

Inno setup 根据Inno设置中的用户输入更改AppName

Inno setup 根据Inno设置中的用户输入更改AppName,inno-setup,Inno Setup,我的设置中有一个自定义页面,要求用户输入标识符。我的要求是,如果用户输入标识符,则应用程序名称应更改为包含标识符 我的设置部分看起来像 #define AppName 'SMARTsoft Name and Address Import' [Setup] AppName={#AppName} 自定义页面创建为:- function CreateDataPage(PreviousPageId: Integer): Integer; var Page: TWizardPage; begi

我的设置中有一个自定义页面,要求用户输入标识符。我的要求是,如果用户输入标识符,则应用程序名称应更改为包含标识符

我的设置部分看起来像

#define AppName 'SMARTsoft Name and Address Import'

[Setup]
AppName={#AppName}
自定义页面创建为:-

function CreateDataPage(PreviousPageId: Integer): Integer;
var
    Page: TWizardPage;
begin
    Page :=CreateCustomPage(PreviousPageId,'Additional Identifier for the Interface',
    'Provide any extra information/identifier you will be using');

    FirstLabel :=TLabel.Create(Page);
    with FirstLabel do
        begin
            Parent :=Page.Surface;
            Caption :='Identifier';
            Left :=ScaleX(56);
            Top :=ScaleY(36);
            Width :=ScaleX(70);
            Height :=ScaleY(17);
        end;   

    txtIndentifier :=TEdit.Create(Page);
    with txtIndentifier do
    begin
        Parent :=Page.Surface;
        Left :=ScaleX(136);
        Top :=ScaleY(36);
        Width :=ScaleX(51);
        Height :=ScaleY(25);
        TabOrder :=3;
        Text :='';
        MaxLength := 5;
    end;

    with Page do
    begin
        OnNextButtonClick :=@Check;
    end;

    Result :=Page.ID;

end;
现在我想检查用户是否在控件TXTDindicator中给定了值,然后更改AppName。我在“下一步”按钮上为其添加了以下功能:-

function Check(Page: TWizardPage): Boolean;
begin
    Result :=True;
    MsgBox('In Authentication', mbError, MB_OK);          
    if txtIndentifier.Text <> ''  then
      begin
        ***<<here I want to update the App Name>>***
        ***something like - {#AppName} := ExpandConstant('{#AppName}') + ' (' + txtIndentifier.Text + ')';***

      end  
end;
函数检查(页面:TWizardPage):布尔值;
开始
结果:=真;
MsgBox('在身份验证中',mbError,MB_OK);
如果TXTDindicator.Text为“”,则
开始
******
***类似于-{AppName}:=ExpandConstant({{AppName}')+'(“+txtdindicator.Text+”)***
结束
结束;
请帮忙


谢谢

我想这应该。谢谢你的回复。但是当我跟踪链接时,我得到了以下编译时错误。当AppId包含常量时,UsePreviousLanguage必须设置为“否”。对不起,我还没有尝试过该代码。问题是
AppName
指令是在向导启动时计算的,所以请忘记该代码。
AppName
值用于各种用途。其中一些可能通过一些努力改变运行时,有些则不能。那么,你真正想要改变的(功能)是什么?From:
AppName
显示在整个安装程序和卸载程序的窗口标题、向导页面和对话框中。此指令的值也用作
AppId
VersionInfo
的默认值,和
VersionInfoProductName
指令(如果未指定)。我想更改AppName,以便可以在AppName中添加用户输入值。这样,用户将能够多次使用相同的安装文件,以不同的AppName多次安装程序。