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

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

问题描述

我是JavaFX的新手,只有一些关于Ant的基本知识。目前我正在学习如何使用FX Ant任务来部署应用程序。 修改:使用< fx:deploy nativeBundles =exe../& gt; 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 \设置

"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}

请参阅 InnoSetup Constants 文档。

对于那些寻找纯Ant解决方案(没有Java FX)的人:

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

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

The InnoSetup 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天全站免登陆