Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法卸载使用wix安装程序安装的应用程序_Wix_Windows Installer_Wix3.7 - Fatal编程技术网

无法卸载使用wix安装程序安装的应用程序

无法卸载使用wix安装程序安装的应用程序,wix,windows-installer,wix3.7,Wix,Windows Installer,Wix3.7,我已经使用wixinstaller为我的c#应用程序创建了一个安装程序 安装过程正常,但我无法卸载该应用程序。我看到下面的日志 MSI (s) (78:AC) [15:32:06:199]: Machine policy value 'Debug' is 0 MSI (s) (78:AC) [15:32:06:199]: ******* RunEngine: ******* Product: C:\wix\Installer\\bin\Debug\MyService-Debug-x

我已经使用
wix
installer为我的
c#
应用程序创建了一个安装程序

安装过程正常,但我无法卸载该应用程序。我看到下面的日志

MSI (s) (78:AC) [15:32:06:199]: Machine policy value 'Debug' is 0
MSI (s) (78:AC) [15:32:06:199]: ******* RunEngine:
       ******* Product: C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi
       ******* Action: 
       ******* CommandLine: **********
MSI (s) (78:AC) [15:32:06:207]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (78:AC) [15:32:06:326]: Note: 1: 2203 2: 
C:\Windows\Installer\inprogressinstallinfo.ipi 3: -2147287038 
MSI (s) (78:AC) [15:32:06:327]: Machine policy value 
'LimitSystemRestoreCheckpointing' is 0 
MSI (s) (78:AC) [15:32:06:327]: Note: 1: 1717 2: My Service (32bit) 
MSI (s) (78:AC) [15:32:06:327]: Note: 1: 2205 2:  3: Error 
MSI (s) (78:AC) [15:32:06:327]: Note: 1: 2228 2:  3: Error 4: SELECT 
`Message` FROM `Error` WHERE `Error` = 1717 
MSI (s) (78:AC) [15:32:06:327]: Calling SRSetRestorePoint API. 
dwRestorePtType: 1, dwEventType: 102, llSequenceNumber: 0, szDescription: 
"Removed My Service (32bit)".
MSI (s) (78:AC) [15:32:06:330]: The System Restore service is disabled. 
Returned status: 1058. GetLastError() returned: 1058
MSI (s) (78:AC) [15:32:06:332]: File will have security applied from OpCode.
MSI (s) (78:AC) [15:32:06:362]: SOFTWARE RESTRICTION POLICY: Verifying 
package --> 'C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi' against 
software restriction policy
MSI (s) (78:AC) [15:32:06:363]: Note: 1: 2262 2: DigitalSignature 3: 
-2147287038 
MSI (s) (78:AC) [15:32:06:363]: SOFTWARE RESTRICTION POLICY: 
C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi is not digitally signed
MSI (s) (78:AC) [15:32:06:365]: SOFTWARE RESTRICTION POLICY: 
C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi is permitted to run at 
the 'unrestricted' authorization level.
MSI (s) (78:AC) [15:32:06:366]: MSCOREE not loaded loading copy from 
system32
MSI (s) (78:AC) [15:32:06:374]: End dialog not enabled
MSI (s) (78:AC) [15:32:06:374]: Original package ==> 
C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi
MSI (s) (78:AC) [15:32:06:374]: Package we're running from ==> 
C:\Windows\Installer\152e2e.msi
在创建安装程序时,我从未想到过数字签名和其他一切。这和签名有关吗?完全迷路了,需要帮助

我甚至尝试过使用命令行(管理模式)运行
卸载
,但没有成功

msiexec.exe /x "C:\wix\Installer\\bin\Debug\MyService-Debug-x86.msi" /L*V "C:\work\wix.log"
上面说

已安装此产品的另一个版本。无法继续安装此版本。要配置或删除此产品的现有版本,请使用“控制面板”上的“添加/删除程序”

在卸载之前,我可能必须重新生成安装程序代码。是否可能与安装程序相关的某些“guid”已更改?在
注册表
中有什么需要检查的吗

用Wix代码更新了问题

在我添加自定义操作后,问题开始出现。自定义操作的职责是从安装程序获取参数并更新appsettings.json。但是这个卸载问题不允许我继续执行

  <Property Id="APPLICATIONLOG.PATHFORMAT"  Secure="yes"/>

  <Binary Id="CustomActionDLL" 
          SourceFile="..\..\Installer\CustomActions\bin\$(var.Configuration)\CustomAction.CA.dll" />

  <CustomAction Id="SetPropertyAppLogPathId"
                Property="SetPropertyAppLogPathProperty"
                Value="APPLICATIONLOG.PATHFORMAT=[APPLICATIONLOG.PATHFORMAT]"/>

  <CustomAction Id="SetPropertyAppLogPathProperty"
                BinaryKey="CustomActionDLL"
                DllEntry="UpdateConfigurationsAction"
                Execute="deferred"
                Return="check"
                Impersonate="no" />

  <InstallExecuteSequence>
    <Custom Action="SetPropertyAppLogPathId" Before="SetPropertyAppLogPathProperty"><![CDATA[NOT Installed]]></Custom>
    <Custom Action="SetPropertyAppLogPathProperty" After="InstallFiles"></Custom>
  </InstallExecuteSequence>
问题已解决

问题在于自定义操作。在完成正确的安装执行顺序后,它工作了

将在解决方案部分更新

交叉链接


Microsoft FixIt:在尝试其他任何操作之前,请先尝试一下,看看是否可以消除任何问题 悬挂装置。如果不成功,请进一步检查是否存在其他问题 接近

调试和日志记录:下一步根据(我建议,这是一个快速且良好的“hello debugger”会话)和修复程序包中的自定义操作

对策:最后,可能(
“添加条件”
部分)

  • 这是最简单的 我所知道的在卸载时禁止运行自定义操作的想法-如果自定义操作崩溃,您只需在需要禁止自定义操作时设置所涉及的属性即可。>
  • 我会将它用于我所有的自定义操作-事实上-这样我就可以全部抑制它们(或 可能一个接一个)-尤其是在卸载场景中,您会遇到以下情况(由于自定义操作错误而无法安装、升级或卸载)

悬挂安装:为了检测所有相关的悬挂安装(如果有),您可以使用以下方法:(枚举具有相同升级代码的所有产品)


我现在将添加这些链接,以防您发现悬挂版本:

当试图删除卸载时崩溃的MSI时,中心问题是涉及多少台计算机?如果只是一个,那么黑客攻击缓存的MSI数据库可能是可以接受的,否则您应该创建一个补丁包来修复卸载序列,然后以正常方式触发卸载


链接

  • 正在引发另一个链接:。可以为每个用户或每台机器安装

你能分享你的wix代码吗?@PavelAnikhouski更新了wix代码。请查看不确定,但您可能安装了悬挂版本。您在添加/删除程序中看到了什么?很可能自定义操作崩溃,因此卸载将回滚。有一些方法可以解决这个问题,但请先检查上面的内容。为什么在卸载过程中调用自定义安装?它应仅在安装期间执行。在执行命令行卸载时,应始终为-x参数指定已安装产品的ProductCode GUID,如
msiexec-x{ProductCode}
。程序包可能已更改,因此无法卸载。例如,您可以使用MSINV.exe查找已安装的ProductCode,或者只需从卸载注册表项中查找它:
HKLM\Software\Microsoft\Windows\CurrentVersion\uninstall