提取后的SFX运行文件取决于操作系统位数

编程入门 行业动态 更新时间:2024-10-28 08:25:13
本文介绍了提取后的SFX运行文件取决于操作系统位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要创建自解压存档,一旦解压缩,它们会根据操作系统的位数运行不同的可执行文件.

到目前为止,我已经通过使用WinRAR和BAT文件来完成此操作,但是在主应用程序窗口之前的命令提示符"窗口的快速闪烁看起来很可疑.

因此,我正在寻找一种更好的选择,但尚未找到.

解决方案

您可以在C/C ++/C#中编写32位GUI应用程序,而不会打开例如用确定的窗口href ="msdn.microsoft/en-us/library/tb2sfw2z.aspx" rel ="nofollow noreferrer"> getenv_s 或 getenv (如果存在变量ProgramFiles(x86)(仅在64位Windows上),并在随后启动相应的主应用程序.该可执行文件被压缩到SFX存档中,并由SFX存档执行.

或者您编写自己的SFX模块.可以从 RARLAB 下载用于解压缩RAR存档的资源.

或者您编写Windows脚本来确定Windows的位宽并启动适当的主应用程序,然后由SFX存档使用 wscript.exe ,它不会像其对应的 cscript.exe .

或者您创建一个只能在64位Windows上运行的64位SFX和一个可以在32位和64位Windows上运行的32位SFX,并提供下载功能.大多数使用64位Windows的用户很可能会下载64位版本.

I need to create self-extracting archives that, once extracted, run different executables depending on the bitness of the Operating System.

Until now, I have done this by use of WinRAR and BAT files but the quick flash of the Command Prompt window prior to the main application's window looks suspicious.

So, I'm looking for a better option but have yet to find one.

解决方案

You could code a 32-bit GUI application in C/C++/C# not opening a window which for example determines with getenv_s or getenv if variable ProgramFiles(x86) exists (only on 64-bit Windows) and starts next the appropriate main application. This executable is compressed into the SFX archive and executed by the SFX archive.

Or you code your own SFX module. The sources for unpacking a RAR archive can be downloaded from RARLAB.

Or you code a Windows script for determining bit width of Windows and starting the appropriate main application and execute this script by the SFX archive with wscript.exe which does not open a console window like its counterpart cscript.exe.

Or you create a 64-bit SFX which can be run only on 64-bit Windows and a 32-bit SFX which can be run on 32-bit and also 64-bit Windows and offer both for download. Most users of 64-bit Windows will most likely download the 64-bit version.

更多推荐

提取后的SFX运行文件取决于操作系统位数

本文发布于:2023-11-12 19:31:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582330.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位数   操作系统   文件   SFX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!