我编写了一个 PowerShell 脚本,它使用WinRAR 命令行创建一个自解压存档(又名 SFX)可执行文件。问题是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 是否有命令行开关可以让我填写版本和版权信息?*.exe
如果没有,在构建SFX 文件后是否有某种方法可以填写该信息?