如何在参数字符串中创建具有双引号的7-zip SFX安装程序?

时间:2015-08-12 22:42:26

标签: 7zip sfx

我需要创建一个运行名为Deploy-Application.exe的文件的安装程序。 Deploy-Application.exe采用如下所示的参数:

Deploy-Application.exe -DeploymentType "Uninstall"

当我把它放在我的配置文件中时,它不起作用,因为Sfx模块认为我的参数只是

-DeploymentType 

由于双引号。 7-zip SFX模块的双引号是否有一个脱口角色?如果有,我找不到它!

这是我的配置文件:

;!@Install@!UTF-8!
Title="test"
Progress="No"
ExecuteParameters="-DeploymentType "Uninstall""
RunProgram="Deploy-Application.exe"
;!@InstallEnd@!

编辑:事实证明,Deploy-Application.exe 需要围绕参数引用。我刚刚通过cmd运行它来测试它,如下所示:

Deploy-Application.exe -DeploymentType Uninstall

它工作正常。但是,当我有一个如下所示的配置文件时:

;!@Install@!UTF-8!
Title="test"
Progress="No"
ExecuteParameters="-DeploymentType Uninstall"
RunProgram="Deploy-Application.exe"
;!@InstallEnd@!

它仍然不起作用。参数被忽略,我使用ProcessExplorer验证,并且Deploy-Application.exe在没有参数的情况下启动。

2 个答案:

答案 0 :(得分:1)

使用前锋\

逃脱它们

喜欢这样

if ((int)$xf["numFmtId"] < 164 &&
    PHPExcel_Style_NumberFormat::builtInFormatCodeIndex((int)$xf["numFmtId"]) !== false) {
    $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
}

ref

答案 1 :(得分:1)

嗯,事实证明它与引号或任何事情无关。在第100次阅读LZMA SDK附带的installer.txt文档后,我意识到&#39; ExecuteParameters&#39;不适用于&#39; RunProgram&#39;,它只适用于&#39; ExecuteFile&#39;。

以下是使用&#39;运行程序&#39;

的参数的方法
RunProgram="notepad.exe"
RunProgram="C:\\Windows\\system32\\notepad.exe"
RunProgram="%Path%\\notepad.exe"
RunProgram="fm0:nowait:7z_EN.chm"
RunProgram="\"%%T\\Reader7Rus.msi\" /qn"
RunProgram="hidcon:fm0:\"%%S\\install.cmd\" /Q"

从文档中我没有仔细阅读:

ID_String          Description 

Title              Title for messages 
BeginPrompt        Begin Prompt message 
Progress           Value can be "yes" or "no". Default value is "yes". 
RunProgram         Command for executing. Default value is "setup.exe". 
                   Substring %%T will be replaced with path to temporary 
                   folder, where files were extracted 
Directory          Directory prefix for "RunProgram". Default value is ".\\" 
ExecuteFile        Name of file for executing 
ExecuteParameters  Parameters for "ExecuteFile"