简体   繁体   English

无 UI 的 SFX(自解压)文件提取

[英]SFX (Self-extracted) file extract without UI

The problem is the next: I get a SFX file what I want to extract, but I don't want to open it and select the installation path, I just want to install it to a defined path (add by argument or smth).问题是下一个:我得到了一个我想要提取的 SFX 文件,但我不想打开它,select 是安装路径,我只想将它安装到定义的路径(通过参数或smth添加)。

I use C# language and I've tried many ways to extract that file, but I can't find the solution.我使用 C# 语言,我尝试了很多方法来提取该文件,但我找不到解决方案。

I tried the followings:我尝试了以下方法:

  • Rename the SFX.exe file to.rar and.zip, after that with System.Comparsion package, I tried to extract将SFX.exe文件重命名为.rar和.zip,之后用System.Comparsion package,我试着解压
  • Run the SFX file with arguments (it works in silent mode, just I can't add custom path to it)使用 arguments 运行 SFX 文件(它在静默模式下工作,只是我无法为其添加自定义路径)
  • Tried to extract the.exe file itself with RAR nuGet package (like NURar)尝试使用 RAR nuGet package(如 NURar)提取 .exe 文件本身

If you have any ideas please let me know.如果您有任何想法,请告诉我。 Thanks for the help guys.谢谢你们的帮助。

At least I used UnRAR.exe file with arguments to extract the SFX file.至少我使用了带有 arguments 的 UnRAR.exe 文件来提取 SFX 文件。 Thanks to Mofi for the answer!感谢莫菲的回答!

The process what I use for extract data if anyone need:如果有人需要,我用于提取数据的过程:

UnRAR.exe x -o+ "sfxpath" "extractpath"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM