- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在 InnoSetup 中我运行这段代码:
J32 := ShellExec('', 'java', '-d32 -version', '', SW_HIDE, ewWaitUntilTerminated, ec);
J64 := ShellExec('', 'java', '-d64 -version', '', SW_HIDE, ewWaitUntilTerminated, ec);
J32
和J64
都是True
。
在命令行中:
> java -d32 -version
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
> echo %errorlevel%
1
> java -d64 -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
> echo %errorlevel%
0
为什么 ShellExec()
忽略 Params
?
我还尝试了 Exec()
:
// this way
J32 := Exec('java', '-d32 -version', '', SW_HIDE, ewWaitUntilTerminated, ec);
// and this way
J32 := Exec('>', 'java -d32 -version', '', SW_HIDE, ewWaitUntilTerminated, ec);
它们都返回 True
和 ec = 1
,尽管我有一个 64 位 java。
似乎 Exec
和 ShellExec
返回 True
因为它们成功运行 java
,但它们不跟踪 java
返回的错误代码。
最佳答案
Inno Setup 帮助说明:
http://www.jrsoftware.org/ishelp/index.php?topic=setup_architecturesinstallin64bitmode
The System32 path returned by the {sys} constant maps to the 64-bit System directory by default when used in the [Dirs], [Files], [InstallDelete], [Run], [UninstallDelete], and [UninstallRun] sections. This is because Setup/Uninstall temporarily disables WOW64 file system redirection [external link] when files/directories are accessed by those sections. Elsewhere, System32 and {sys} map to the 32-bit System directory, as is normal in a 32-bit process.
所以在 [Code] 部分的 64 位模式下,所有内容都是 32 位的。它将执行 32 位 Java,c:\Windows\System32 指向 WOW64 文件夹,即 32 位版本的 System32。
这个答案展示了如何在注册表中检查 Java:
Need help on Inno Setup script - issue in check the jre install
按照该答案,以下代码似乎可以检查是否安装了 64 位 Java 1.7+:
[Code]
function JavaIsMissing(): Boolean;
var
javaVersionOutput: AnsiString;
begin
result := not RegQueryStringValue(HKLM64, 'Software\JavaSoft\Java Runtime Environment',
'CurrentVersion', javaVersionOutput);
if not result then
result := CompareStr(javaVersionOutput, '1.7') < 0;
end;
[Run]
Filename: "{tmp}\{#JavaInstaller}"; StatusMsg: "Java Runtime Enviroment not installed on your system. Installing..."; Check: JavaIsMissing
关于java - InnoSetup : Detect if Java is 32-bit or 64-bit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8027816/
是否可以在没有 bit.dev 帐户的情况下将 bit 设置为本地服务器以进行内部处理? 我知道您可能没有相同的功能 -- bit's FAQ page说“与 Bit CLI 不同,bit.dev 服
我是一名计算机科学学生,学习如何用 C 语言编程。我有 3 个文件和一个 Makefile。我有 logic.c logic.h main.c logic.c 的顶部是: #include "log
我有一个特殊的无符号长整型(32 位),我需要一点一点地转换它的字节序 - 我的长整型表示将多个内容混合在一起形成一个二进制文件。 我该怎么做? 最佳答案 字节顺序是一个字级概念,其中字节要么以最高有
我有许多 iOS Xcode 项目都使用同一个子项目。这个子项目构建一个静态库,然后链接到主项目。到目前为止,这个子项目和所有主项目都是 32 位的。 我想构建一个支持 64 位的新项目,因此将架构设
我创建了一个使用 SIMD 执行 64 位 * 64 位到 128 位的函数。目前我已经使用 SSE2(实际上是 SSE4.1)实现了它。这意味着它同时处理两个 64b*64b 到 128b 的产品。
想知道是否有人对我如何对二进制数执行以下操作有一些了解: 转换 01+0 -> 10+1 (+ as in regular expressions, one or more) 01 ->
代码如下: unsigned int v; // word value to compute the parity of v ^= v >> 16; v ^= v >> 8; v ^= v >> 4
我正在尝试在(测试版)Trackmania 2 游戏中制作脚本。(这是 JavaScript、HTML、C 和...其他我在最糟糕的噩梦中无法想象的东西的丑陋混合)。 脚本引擎似乎不知道“and”或“
这个问题在这里已经有了答案: How do AX, AH, AL map onto EAX? (6 个回答) 去年关闭。 所以,假设我正在使用寄存器 %rax和 %rdi . 作为一个基本的例子,让我
我是编程新手,来自非CS背景(没有正式学位)。我主要使用C#编写Winforms。 我对32位和64位感到困惑...。我的意思是,听说过32位OS,32位处理器以及基于程序的最大内存。它如何影响程序的
“清除整数的第 6 位”的最佳方法是什么? 而且,您的解决方案平台是否独立? (32 位或 64 位整数等)。如果没有,您能否提供一个独立于平台的解决方案? 更新: 我们不知道该位在给出时是已设置还是
我刚刚在交错一些 float 时发现了一些狡猾的问题。我简化了问题并尝试了一些测试 #include #include std::vector v; // global instance unio
我不想用这个来骚扰你,但我在互联网上的任何地方都找不到对“位填充”到底是什么的详细解释,也没有找到与位填充相关的线程的任何答案在 StackOverflow 上。 我还在 ISO 9899-1990
我有点卡住了,因为我找不到任何涵盖缓存“数据”部分的内容,我用谷歌搜索的所有内容都涉及 99.9% 的缓存寻址。我被问到的问题是这样措辞的 Contrast the difference betwee
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
是否有人通过运行/附加到 64 位应用程序成功调试 64 位 dll?我有应用程序和 dll 的 Delphi 代码。我可以调试 32 位和 64 位应用程序。我还可以通过使用 Run -> Para
我有一些使用 native 组件的库,这些库是使用 NDK 为 32 位 Arm 架构构建的。 现在我们在现代设备上有 64 位处理器,所以我想知道这些库是否可以工作。在我的情况下,我没有本地库的源代
这是我上一个问题的延伸 - How to securely and efficiently store SSN in a database? 这个想法是,我想要安全地散列社会安全号码,然后插入到列中,
我很尴尬地说,我的数学技能很弱,而且我是一名自豪的计算机科学专业。我正在上课,这真是太令人难以承受了。这是我家庭作业的一部分,但是,在理解这一部分之前我无法继续。我类的每个人都在努力编写某种方法来完成
在 InnoSetup 中我运行这段代码: J32 := ShellExec('', 'java', '-d32 -version', '', SW_HIDE, ewWaitUntilTerminat
我是一名优秀的程序员,十分优秀!