重启后如何完成安装?

时间:2013-08-27 21:03:21

标签: visual-studio-2010 deployment windows-installer

我正在使用VS2010中的Visual Studio部署项目来安装/升级我的应用程序,而在Windows 2003及更早版本中,它似乎拒绝在尝试升级之前停止服务。因此,安装完成后需要重新启动。这是msiexec日志中的一个片段,我在旧服务下运行program.exe,我正在尝试安装program.exe作为升级的一部分:

MSI (s) (70:64) [12:00:34:448]: Note: 1: 2727 2:  
MSI (s) (70:64) [12:00:34:682]: 1 application(s) had been reported to have files in use.
Info 1603. The file C:\Program Files\company\program.exe is being held in use by the following process: Name: program, Id: 712, Window Title: '(not determined yet)'.  Close that application and retry.
MSI (c) (60:BC) [12:00:34:682]: File In Use: -program- Window could not be found.  Process ID: 712
MSI (c) (60:BC) [12:00:34:682]: No window with title could be found for FilesInUse
MSI (s) (70:64) [12:00:34:682]: Note: 1: 2727 2:  
MSI (s) (70:64) [12:00:34:682]: Doing action: InstallInitialize
Action ended 12:00:34: InstallValidate. Return value 1.

重新启动时,软件似乎已安装,但之前未使用的文件未重新安装,且尚未安装该服务。我在桌面上放置的快捷方式充当广告的快捷方式 - 双击它将强制MSI看到安装不完整并且修复成功。

但是,有些用户可能在没有重新登录的情况下进行此升级(例如,到Web服务器),我想要:

  1. 无需重启即可完成安装,或
  2. 在用户登录前自动重启并完成安装。
  3. 这是我尝试过的:

    1. 运行msiexec /i <pkg.msi> /norestart - 这没有帮助,如果我在重新启动之前尝试使用快捷方式,它会尝试修复安装并失败。
    2. 通过设置属性DISABLEADVTSHORTCUTS=1来禁用播发的快捷方式 - 这也不起作用,因为目标打开但安装仍未完成,因此无法正常运行。 msiexec /f <pkg.msi>仍可用于修复安装。
    3. RunOnce向注册表添加HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce密钥以调用修复操作以完成安装 - 这似乎没有运行,但如果我在命令行运行它,那么它是有效的我不确定这里的问题是什么。我使用安装程序添加到RunServicesOnce的字符串值为[SystemFolder]\msiexec.exe /f [ProductCode] /qn,它似乎正确评估为C:\Windows\system32\msiexec.exe /f {my code} /qn
    4. 使用Orca编辑.msi以停止服务(通过ServiceControl表)以便文件未被使用 - 这不起作用,因为它似乎不会停止服务,直到它评估是否或不是文件被保留。
    5. 我想我迷路了,我希望我错过了一些明显的东西。让我直截了当。提前谢谢!

0 个答案:

没有答案