English 中文(简体)
是否可以把批量档案作为Wix的双元件类型?
原标题:Is it possible to have a batch file as a binary element type in Wix?

这里我

<Binary Id="B.RenameFiles" SourceFile="RenameFiles.bat"/>
<CustomAction Id="CA.RenameFiles" BinaryKey="B.RenameFiles"
              ExeCommand="RenameFiles.bat" Execute="immediate" Return= ignore />

<InstallExecuteSequence>
    <Custom Action="CA.RenameFiles" Before="InstallValidate"></Custom>
</InstallExecuteSequence>

这只字不出工作,在“完成这一装置所需要的方案”中发现错误。 如果有可能,或者只有双亲才能使用,那么我不会真正相信。

此时这样做的方式是安装批号,然后从那里操作,但如果我可以将其用作双筒,而不是在当地机器上安装,那将是 ne的。

Thanks Neil

最佳回答

Windows Installer习俗行动无法直接发射BAT文档。 你们需要一种习惯行动,使用ShellExecute发射你的BAT。

因此,你可以把最佳可得技术作为一种宾特习俗行动。

问题回答

与Cosmin一样,你不能从双亲执行最佳环保做法,然而,在安装期间,在“CMD.exe /C”的帮助下,你可以(几乎)在安装期间随时发射这种技术,甚至可以隐蔽(没有细微的窗户),也就是说,如果有人ffer,可以使用:

<CustomAction Id="Set_CA_HiddenBAT" Property="CA_HiddenBAT" Value="&quot;cmd.exe&quot; /c &quot;[DirectoryWhereBatFileInstalled]Your.bat&quot;" />
<CustomAction Id="CA_HiddenBAT" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="yes" />

或者如果你想要看到:

<CustomAction Id="CA_LaunchBAT" Directory="DirectoryWhereToExecute" ExeCommand="CMD.exe /c &quot;[DirectoryWhereBatFileInstalled]Your.bat&quot;" Return="ignore" />

注:留待补 • CA_LaunchBAT, 在InstallFiles采取行动后,将WixUtilExtension添加到你身上。

<LinkerAdditionalOptions>-ext WixUtilExtension</LinkerAdditionalOptions>
<CompilerAdditionalOptions>-ext WixUtilExtension</CompilerAdditionalOptions>

在“InstallFile”行动之前,还有启动“BAT”的办法,但这是trick的,让我知道你是否需要。





相关问题
Correct place to install demostration projects?

With the new Windows 7 restrictions (well, new to Windows Vista anyways), we can no longer install demo projects to %ProgramFilesFolder%OurApplicationdemo since restricted users will not be able to ...

msi install program as startup

is it possible to install a program as a start up program using MSI installer?

Web Setup Project - Repair to overwrite files

I have a web setup project that creates an MSI. After first installation, my web site has some config files that can be modify manually. When triggering that MSI again, I am offered to repair the ...

Visual Studio Setup Projects: Cleartype

I use a Visual Studio Setup project to create an installer for some assemblies. However, the fonts the installer uses are always aliased, and don t appear to be the Windows standard. (source: ...

Implementing Update functionality

I want to implement the Update functionality for one of my .NET application. I saw that the Advanced Installer contains this functionality. Anybody recommends Advanced Installer for updating my ...

VS 2005 Setup - HKCU

I am trying to fix an existing application that uses a Visual Studio 2005 setup project. We are requiring it to work on limited user accounts for XP, our app is written in C# for .Net 2.0. It writes ...

热门标签