在目标机器上安装后执行 VBscript

executing VBscript after installation on target machine

我正在尝试 运行 一个可执行的 VBscript (.EXE) 在所有文件都放在目标机器上之后。正在使用的安装程序是在 Visual Studio 2013 年使用 WIX 工具集制作的。我尝试了几个来自不同来源的例子,比如 technet 和这个网站。但是 none 可以帮助我,因为其中很多 articles/post 都是 2008 年左右的,似乎不再适用了。

目前我正在使用这段代码来尝试实现我的目标:

     <Fragment>
    <CustomAction
      Id="RunInstallScript"
      Directory="INSTALLFOLDER"
      ExeCommand="[INSTALLFOLDER]Installation script.exe"
      Execute="commit"
      Return="ignore"
    />
    <InstallExecuteSequence>
    <Custom Action="RunInstallScript" Before="InstallFinalize" />
  </InstallExecuteSequence>
  </Fragment>

尽管编译器没有发现任何错误并且编译得很好,但代码无法正常工作。需要执行的文件放在安装文件夹中,所以文件是存在的。只剩下在安装时执行一次and/or卸载

为了弄明白我已经搜索了很长时间的信息,但是我就是不能让它按照我想要的方式工作。 如果这个问题得到解决,我最终将拥有一个功能齐全的安装程序,我可以部署它来简化控制面板的设置。

欢迎所有帮助和建议。

提前致谢,

我知道问题出在哪里了。 似乎自定义操作的声明和调用需要与添加文件功能在同一个片段中。 所以它看起来像这样:

    <Fragment>

    <ComponentGroup Id="script" Directory="INSTALLFOLDER">
      <Component Id="InstallationScript" Guid="{AFA49EED-4F2C-42B4-B7EC-D3B7896C970C}">
        <File Id="InstallationScript" KeyPath="yes" Source="C:\Users\fjansen\Documents\Visual Studio 2013\Projects\Wix test\Installation script\bin\Debug\InstallationScript.exe" />
      </Component>
    </ComponentGroup>

    <CustomAction
      Id="InstallScript"
      Directory="INSTALLFOLDER"
      ExeCommand="[INSTALLFOLDER]InstallationScript.exe"
      Execute="commit"
      Return="check">
    </CustomAction>
    <InstallExecuteSequence>
      <Custom Action="InstallScript" Before="InstallFinalize" />
    </InstallExecuteSequence>

  </Fragment>

最后只是一个小错误,很难找到问题所在。我希望这个例子能帮助人们解决同样的问题,并为他们节省大量时间来找出问题所在。