如何将参数从 Java FX Ant 任务传递到 Inno Setup? [英] How to pass parameters from Java FX Ant task to Inno Setup?

查看:28
本文介绍了如何将参数从 Java FX Ant 任务传递到 Inno Setup?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 JavaFX 的新手,只对 Ant 有一些基本的了解.目前我正在学习如何使用 FX Ant 任务来部署应用程序.通过使用 <fx:deploy nativeBundles="exe" ../> Ant 自动使用 Inno Setup 创建带有 .exe 的安装文件 扩展.

I am new to JavaFX and only have some basic knowledge about Ant. At the moment I am learning how to use the FX Ant tasks to deploy an application. By using <fx:deploy nativeBundles="exe" ../> Ant automaticly uses Inno Setup to create a setup file with the .exe extension.

由于我们公司有一些附属公司,所以我们的大部分应用程序都需要为每个公司部署一次.这是因为创建了一些 Windows 注册表项,它们应该如下所示(不是我的想法,管理层希望它像这样!):

Since our company has some affiliated companies, most of our applications need to be deployed once for each of them. This is because some Windows Registry entries are created and they should look like this (not my idea, the management wants it to be like this!):

HKCU\Software\附属公司名称\AppName\Settings"

"HKCU\Software\affiliated company name\AppName\Settings"

现在我想知道,是否可以将参数从我的 build.xml 传递到 .iss 以动态插入粗体部分.

Now I would like to know, if it's possible to pass a parameter from my build.xml to the .iss to insert the bold part dynamically.

我发现了这个 问题,从哪里通过建议使用 /DMyParameterName=MyValue 到 Inno Setup 编译器 (ISC),但我不知道如何从 build.xml 执行此操作,因为我找不到直接致电 ISC.

I found this question , where passing /DMyParameterName=MyValue to the Inno Setup compiler (ISC) is suggested, but I don't know how to do this from the build.xml since I can't find any direct call to the ISC.

我希望你能理解我的问题(英语不是我的母语).如果您需要更多信息来帮助我,请随时询问,我会尽快添加它们.

I hope you can understand my problem (English isn't my native language). If you need more information to be able to help me please feel free to ask, I will try to add them as fast as possible.

推荐答案

Java FX 不允许您向 ISCC.exe 传递任何额外的参数.

The Java FX does not allow you to pass any additional arguments to ISCC.exe.

至少根据 OpenJFX 源代码:

At least according to OpenJFX source code:

//run candle
ProcessBuilder pb = new ProcessBuilder(
        TOOL_INNO_SETUP_COMPILER_EXECUTABLE.fetchFrom(params),
        "/o"+outdir.getAbsolutePath(),
        getConfig_ExeProjectFile(params).getAbsolutePath());
pb = pb.directory(EXE_IMAGE_DIR.fetchFrom(params));
IOUtils.exec(pb, VERBOSE.fetchFrom(params));

<小时>

您可以设置环境变量而不是参数并使用以下语法使用它:


You might do with setting an environment variable instead of parameter and consume it using this syntax:

{%VARNAME}

请参阅 Inno 设置常量 文档.

对于那些正在寻找纯 Ant 解决方案(无 Java FX)的人:

For those looking for a pure Ant solution (no Java FX):

Inno Setup 编译器 (ISCC.exe) 是一个普通的控制台可执行文件.

The Inno Setup compiler (ISCC.exe) is a normal console executable.

您使用基本的Exec Ant 任务运行编译器::>

You run the compiler using a basic Exec Ant task:

<project>
  <exec executable="ISCC.exe">
    <arg value="Example1.iss"/>
    <arg value="/DMyParameterName=MyValue"/>
  </exec>
</project>

这篇关于如何将参数从 Java FX Ant 任务传递到 Inno Setup?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆