简体   繁体   English

通过从C#VS 2010中的MS安装程序命令“ msiexec”访问URL更新C#Web服务应用程序时出错

[英]error of updating an C# web service application by accessing a URL from MS installer command “msiexec” in C# VS 2010

This question is related to my previous question. 这个问题和我以前的问题有关。

I need to publish a C# application (that has been set up in IIS 6.0 and built in VS2010) to a desktop with win7. 我需要将C#应用程序(已在IIS 6.0中设置并在VS2010中构建)发布到具有Win7的桌面上。

I have set up IIS on my desktop well. 我已经在桌面上很好地设置了IIS。 Now I can install the application on my laptop by accessing the URL 现在,我可以通过访问URL在笔记本电脑上安装该应用程序

  http://myDesktopName.domain.com/MyApp

pointing to a physical location in desktop 指向桌面中的物理位置

  e:\myPath\myApp\myAppService.svc

When I publish a new version of the web service, the application should get updated when I open it. 当发布Web服务的新版本时,应在打开应用程序时对其进行更新。

But, it gave me an error: 但是,这给了我一个错误:

**the filename,directory name, or volume label syntax is incorrect**

After searching online, I found this error is normally caused by some unacccepted chars in the link. 在线搜索后,我发现此错误通常是由链接中某些不可接受的字符引起的。 Here is the code that the msi (MS installer) needs to access and get the new version of the application. 这是msi(MS安装程序)需要访问并获取应用程序新版本的代码。

  System.Diagnostics.Process.Start("msiexec", "/favmuso \"" + myurl + "\"");

here, 这里,

myurl is http://myDesktopName.domain.com/MyApp/MyAppSetup.msi

Here, http://myDesktopName/MyApp/ is the virtual directory set in IIS 6.0 on my desktop. 在这里, http:// myDesktopName / MyApp /是我的桌面上IIS 6.0中设置的虚拟目录。 I can access and download it from IE in my laptop without any problems. 我可以从笔记本电脑上的IE访问和下载它,而不会出现任何问题。

But, when the application notified me that a new version is available for updating the old one, I clicked the pop-up ballon on the application icon and then I got the error: 但是,当应用程序通知我有一个新版本可用于更新旧版本时,我单击了应用程序图标上的弹出气球,然后出现了错误:

 Error 123. The filename, directory name, or volume label syntax is incorrect.

If I try to access it from the C# code, I got the same error. 如果尝试从C#代码访问它,则会遇到相同的错误。

Then, I did a test by running 然后,我通过运行进行了测试

 msiexec **/favmuso** http://myDesktopName.domain.com/MyApp/MyAppSetup.msi /Lv mapp_msi.log

In the log file, i found : 在日志文件中,我发现:

 MSI (s) (80:DC) [18:04:33:089]: SECREPAIR: Failed to open the   

file: http://myDesktopName.domain.com/mypath/ \\myAppSdetup (10).msi for computing its hash. 文件: http ://myDesktopName.domain.com/mypath/ \\ myAppSdetup(10).msi,用于计算其哈希值。 Error:123 错误:123

 Error 123. The filename, directory name, or volume label syntax is incorrect.

Why my applcation setup file name was changed to 为什么我的应用设置文件名更改为

\myAppSdetup (10).msi

The "/favmuso" options can be found at 可以在以下位置找到“ / favmuso”选项

 https://technet.microsoft.com/en-gb/library/cc759262%28v=ws.10%29.aspx#BKMK_Install

Any help would be appreciated. 任何帮助,将不胜感激。

thanks 谢谢

So I noticed that you've asked this question elsewhere, and everyone was focused on the /favmuso piece of it. 所以我注意到您在其他地方问过这个问题,每个人都专注于/ favmuso。

I've been recently exeriencing this issue when trying to repair MSIs with a URL source when the original application was installed by SCCM 2012. 我最近在SCCM 2012安装原始应用程序时尝试使用URL源修复MSI时遇到此问题。

The workaround I found was to add a registry value at HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\Windows\\Installer . 我发现的解决方法是在HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Policies \\ Microsoft \\ Windows \\ Installer中添加注册表值。 The value below causes the MSI to skip the problematic portion of the repair and move on. 下面的值使MSI跳过维修的有问题的部分并继续进行。

Name: SecureRepairPolicy 名称: SecureRepairPolicy

Type: REG_DWORD 类型: REG_DWORD

Value: 1 价值: 1

To be a bit safer, you look into setting the registry value to 2 and using a whitelist as described in this Microsoft article: https://support.microsoft.com/en-us/kb/2918614 . 为了更加安全起见,您考虑将注册表值设置为2并使用此Microsoft文章中所述的白名单: https : //support.microsoft.com/zh-cn/kb/2918614 (Ctrl+F "Steps to opt-out the affected programs".) (Ctrl + F“退出受影响的程序的步骤”。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM