根据用户输入更改 AppID 和 AppName

发布于 2024-08-16 17:27:39 字数 358 浏览 5 评论 0原文

我想在同一系统上多次安装同一应用程序,例如两个用户使用两个不同的 Web 服务(每个都有自己的)。

  1. 在我的设置脚本中,我想根据用户的输入更改 AppIDAppName (例如我的默认 AppName="Service App"如果用户输入了“One”, 应更改为 AppName="Service App One"

  2. 以上更改应反映在“选择开始菜单文件夹”页面中。

  3. 如何捕获“选择开始菜单文件夹”和“选择目标位置”向导页面的下一步单击事件?这是验证用户输入所必需的。

I want to install the same application multiple times on the same system, for example for two user using two different web services (each one has their own).

  1. In in my setup script I want to change the AppID and AppName based on input from the user (for example my default AppName="Service App" should be changed to AppName="Service App One" if the user has entered "One").

  2. Above changes should be reflected in the "Select Start Menu Folder" page.

  3. How can the Next click events for the "Select Start Menu Folder" and the "Select Destination Location" wizard pages be caught? This is required to validate the user input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

め可乐爱微笑 2024-08-23 17:27:39
  1. AppID 可以包含 {code...} 常量(请参阅 Inno Setup 文档),因此您可以自由添加自定义向导页面来输入附加字符串这是AppID的一部分。我认为对 AppName 执行此操作没有意义,因为根据文档,它仅用于向导中的显示目的。

  2. 您应该在“选择目标位置”页面之前插入自定义输入页面,并尝试对 DefaultDirName 使用 {code...} 常量,使用 您应该在“选择目标位置”页面之前

  3. 请参阅用于添加向导页面和 NextButtonClick 处理程序的 CodeDlg.iss 示例脚本。

  1. AppID can include {code...} constants (see the Inno Setup documentation), so you are free to add a custom wizard page to enter the additional string that is part of the AppID. I don't think it makes sense to do this for AppName, as according to the documentation it is used for display purposes in the wizard only.

  2. You should insert your custom input page before the "Select Destination Location" page and try to use a {code...} constant for DefaultDirName too, using the value the user entered before.

  3. See the CodeDlg.iss sample script for adding wizard pages and the NextButtonClick handler.

吖咩 2024-08-23 17:27:39

这不是你问题的完整答案,但我想无论如何我都会展示它。如果您喜欢脚本,您可以将其作为起点。

在我的脚本中,我希望版权年份 (AppCopyright) 反映当前年份(构建脚本时)。

我使用以下代码:

AppCopyright=2003-{code:TodayAsYYYY} © E.De.L.Com bvba

注意 {code:FunctionName}

在脚本末尾的 [code] 部分中,我有以下例程:

function TodayAsYYYY(param:string) : string;
begin
    Result := GetDateTimeString('yyyy', #0, #0);
end;

function TodayAsYYYYMMDD(param:string) : string;
begin
   Result := GetDateTimeString('yyyymmdd', #0, #0);
end;

正如我所说,这不是一个完整的答案。但我一年可能会使用 InnoSetup 1、2 周,所以我无法再帮助你了。无论如何,希望它能有所帮助。

It's not a conplete answer to your question, but I thought I'd show it anyway. If you are into scripts you can maybe take it as a starting point.

In my scripts I want the copyright year (AppCopyright) to reflect the current year (when the script is build).

I use the following code:

AppCopyright=2003-{code:TodayAsYYYY} © E.De.L.Com bvba

Notice the {code:FunctionName}

In the [code] section at the end of the script I have the following routine:

function TodayAsYYYY(param:string) : string;
begin
    Result := GetDateTimeString('yyyy', #0, #0);
end;

function TodayAsYYYYMMDD(param:string) : string;
begin
   Result := GetDateTimeString('yyyymmdd', #0, #0);
end;

As I said, it's not a complete answer. But I use InnoSetup maybe 1, 2 weeks a year, so I can't help you any more. Hope it helps, anyway.

泡沫很甜 2024-08-23 17:27:39

您好,感谢您在经过一番努力后回复我,我找到了自己问题的答案,然后意识到我可能没有正确地提出问题。

所需的输出是在开始菜单下有两个单独安装的应用程序及其自己的卸载程序,并且认为更改 Appid 和 Appname 就可以解决问题。

这是我

#define MyAppName "My Application"

[Setup]
DefaultDirName={pf}\Application\MyApp
DefaultGroupName={#MyAppName}

在上面所做的两个必需的编辑,这可以在自定义页面中使用以下

WizardForm.DirEdit.Text := 'for DefaultDirName' (Select Destination Location")
WizardForm.GroupEdit.Text:= 'DefaultGroupName'

WizardGroupValue 用于读取“选择开始菜单”的值

以访问内置向导中的下一个事件我使用了以下内容

//Validate Select Start Menu and Destination values
function NextButtonClick(CurPageID: Integer): Boolean;
var
  ResultCode: Integer;

begin
  case CurPageID of
    wpSelectDir:
      begin
        //Do validation

      end;
    wpSelectProgramGroup:
      begin
        //Do validation

      end;
  end;

  Result := True;
end;

Hi thanks for replying after some struggle I found answers to my own question and then realised maybe I was not asking the question correctly.

The output required was having two separate installed application with their own uninstaller under the start menu and thought Changing Appid and Appname will do the trick.

Here's what I did

#define MyAppName "My Application"

[Setup]
DefaultDirName={pf}\Application\MyApp
DefaultGroupName={#MyAppName}

above two required editing which was possible in the custom pages using following

WizardForm.DirEdit.Text := 'for DefaultDirName' (Select Destination Location")
WizardForm.GroupEdit.Text:= 'DefaultGroupName'

WizardGroupValue is used for reading values of "Select Start Menu"

for accessing the next event on in built wizard I used the following

//Validate Select Start Menu and Destination values
function NextButtonClick(CurPageID: Integer): Boolean;
var
  ResultCode: Integer;

begin
  case CurPageID of
    wpSelectDir:
      begin
        //Do validation

      end;
    wpSelectProgramGroup:
      begin
        //Do validation

      end;
  end;

  Result := True;
end;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文