我编写了一个PowerShell脚本,它创建了一个自解压缩存档(a.k.a )。使用WinRAR命令行的可执行文件。问题是VERSIONINFO元数据完全是空的(右键单击构建的*.exe文件,转到Properties,然后单击Details选项卡)。
下面是我在脚本中使用的WinRAR命令:
$WinRarInstallPath = "$Env:ProgramFiles\WinRAR\winrar"
<#
WinRAR arguments used:
a - Add files to an archive
-cfg- - Ignore default profile and environment variable
-ep1 - Exclude base folder from names
-iadm - Request administrative access for SFX archive
-iicon - Path to icon to use for installer
-r - Recurse subfolders
-sfx - Create self-extracting archive
-z - Path to archive comment file (SFX configuration file)
#>
&$WinRarInstallPath a -cfg- -ep1 -iadm -iicon"$IconPath" -r -sfx -z"$ConfigFilePath" `
"$InstallerName" "$SourceFilesPath\*" | Out-Null是否有一个WinRAR命令行开关可以让我填写版本和版权信息?如果不是,在构建SFX的*.exe文件之后,是否有什么方法来填充这些信息呢?
发布于 2019-08-02 18:13:02
我能够通过手动将VERSIONINFO文件添加到WinRAR的Default64.SFX文件的副本(在WinRAR的安装路径中找到)来解决这个问题,然后使用它构建SFX。以下是几个步骤:
Default64.SFX文件复制到硬盘的某个位置(比如桌面)。Default64.SFX步骤1中复制的文件重命名为Default64.exe。Default64.exe (您可能需要打开Visual,选择File -> Open -> ,然后单击 open 按钮右侧的箭头,然后单击Open With.)。然后在打开的Open 对话框中,选择Resource 并单击OK按钮)。Default64.exe),然后单击AddResource。在列表中选择Version,然后单击New按钮。如果有一个版本的文件夹,只需双击文件夹中的文件.Default64.exe重命名为Default64.SFX。-sfx开关中指定您修改的Default64.SFX文件的路径:&$WinRarInstallPath a -cfg- -ep1 -iadm -iicon"$IconPath" -r -sfx"C:\path\to\Default64.SFX" `
-z"$ConfigFilePath" "$InstallerName" "$SourceFilesPath\*" | Out-Nullhttps://stackoverflow.com/questions/57169474
复制相似问题