ClickOnce - 应用安装,然后第二天应用参考被破坏 [英] ClickOnce - App installs, then next day app reference is broken

查看:87
本文介绍了ClickOnce - 应用安装,然后第二天应用参考被破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用ClickOnce部署的应用程序。它适用于99%的用户,但我的两个用户遇到了问题。他们安装应用程序,它工作得很好(在发布安装模式期间"应用程序可以离线使用
井(从"开始"菜单启动)。然后第二天当他们重新登录时,图标(这是该应用程序的应用程序引用不是快捷方式而不是安装文件)更改为Windows默认图标,当单击它来运行应用程序时,它会改为再次安装它。$ / b>

当我查看在他们的计算机上保存应用程序的文件结构时,我在本地设置位置看到许多随机命名的文件夹,当我只希望看到一个。换句话说,在这个位置:


C:\Documents and Settings \< WindowsUserName> \ Local Settings\Apps\2.0


我期待看到一个名为Data的文件夹和另一个带有随机生成名称的文件夹。但我看到的是数据文件夹,而不是许多随机生成的名称文件夹。数据文件夹中还有很多文件夹。退出他们的用户名或重新启动计算机忘记安装了任何ClickOnce应用程序的位置(用户有另一个我们发布的ClickOnce应用程序,它已经发布了也失去了它的连接。) 这让我觉得b $ b认为这是用户机器的问题,但我不知道哪种设置等可以做到这一点。


我已经确定他们有我的应用程序编译到.Net 3.5的最新更新。 


除此之外,我不知道接下来要检查什么。用户使用XP并且是他们计算机上的管理员。有谁知道我接下来可以检查什么,或者什么可能导致这个问题? 我正在尝试更多地了解应用程序参考文件如何知道保存应用程序的不同组件的
,因为这似乎是我的用户遇到问题。 任何建议将不胜感激。 

解决方案

嗨kschuler


 


以下是其他社区成员在其他讨论中的一些理解。你可以参考它。我认为这些信息可以让你清楚你的问题。


 


这是因为那些快捷方式不是普通的快捷方式 - 它们会导致验证与快捷方式相关的功能,并且可能导致
a修复。


 


主输出可能与此无关,因为它是一些文件,而不仅仅是配置文件,因此除非你进入MSI文件并找到config
,否则你不能使用该技术文件的组件,加上你想配置文件是可选的,我猜,但你基本上是试图禁用修复。


 


在我看来,你可以设计这个应用程序,以便配置文件中有一个设置可用于所有可能性。然后你不必担心丢失配置文件,只需设置$ b其中的$ b使你的应用程序执行相同的操作,就像它丢失一样。修复  ,但是无法停止
用户右键单击在你的MSI文件(或去添加/删除程序)和选择修复,这将重新安装丢失的文件
。最好设计一些适用于  的东西修复  而不是尝试
来打败它  因为  修复  无法完全阻止,如果您的应用需要修复
从未发生过,那么您的应用设计就会被破坏。


 


它是   a   Windows Installer的内置功能由多个入口点触发,快捷方式就是其中之一。  它是
自动版本的右键单击=>修复MSI文件,或来自添加/删除程序。  如果有人选择修复,文件也将重新安装,因此通常更容易使用它而不是试图打败它。


 


图标没有指向exe,因为它实际上并不是图标所在的位置。它位于MSI文件的二进制表中,该链接描述了Windows如何获取它。 
该链接允许Windows获取图标,即使exe不在,并且Windows Installer的某些功能需要该功能。


 


默认情况下,快捷方式是广告快捷方式 - 它们不直接指向目标。它们的编码包含功能名称,ProductCode guid和组件代码guid。
如果搜索这个论坛适用于
DISABLEADVTSHORTCUTS
你会发现如何禁用它们。


 


========================================== ==========================================


对于一个文件,在所有情况下都适用的方法是将该文件的组件guid设置为null:


 


http://msdn2.microsoft.com/en-us/library/ aa368007.aspx


 


其中所说的"如果此列为空....."。


 


user.config文件的确切路径也可以解释如下:


<个人资料目录> \<公司名称> \< App名称> _<证据类型> _< Evidence Hash> \\ \\< Version> \ user.config


<证据类型>和< Evidence Hash> - 从app域派生的信息证据,以提供适当的应用程序域和程序集隔离。


http://msdn.microsoft.com/en-us/library/ms379611.aspx


 


如果有任何疑虑,请随时告诉我。


 


祝你有愉快的一天!


I have an application that deploys with ClickOnce. It works for 99% of my users, but two of my users are having trouble with it. They install the application and it works just fine (During publish install mode is "The application is available offline as well (launchable from Start menu). Then the next day when they log back in, the icon (which is the application reference not a shortcut and not a setup file) to the app is changed to the windows default icon, and when it's clicked to run the app it instead asks to install it again.

When I look at the file structure where the app is saved on their machines, I'm seeing many randomly named folders in the local settings location, when I only expect to see one. In other words, at this location:

C:\Documents and Settings\<WindowsUserName>\Local Settings\Apps\2.0

I'm expecting to see a folder called Data, and another folder with a randomly generated name. But instead I see the Data Folder and than many randomly generated name folders. There are also many folders inside the Data folder.

It's almost like after logging out of their user name or rebooting the computer forgot where it had installed any of the ClickOnce Applications (The users have another ClickOnce app that we publish and it has lost it's connection too).  This makes me think it's an issue with the user's machine, but I have no idea what kind of settings, etc. could do this.

I have made sure they have the latest updates for .Net 3.5 which my app is compiled to. 

Beyond that I have no idea what to check on next. The users use XP and are admins on their machine. Does anyone know what I can check on next, or what could cause this issue?  I'm trying to figure out more about how the application reference file knows where the different components of the application are kept, since it seems like that is what my user is having a problem with.  Any advice would be appreciated. 

解决方案

Hi kschuler,

 

The following is some understanding from the other community members in the others discussions. And you can reference it. And I think this information can let you clear about your question.

 

It's because those shortcuts are not ordinary shortcuts - they cause validation of the feature associated with shortcut, and that can result in a repair.

 

Primary output is probably irrelevant here because it's some number of files, not just the config file, so you can't use that technique unless you go into the MSI file and find the config file's component, plus you want the config file to be optional I guess, but you basically are trying to disable the repair.

 

It seems to me that you could design this app so that there is a setting in the config file for all the possibilities. Then you're not worrying about a missing config file, just a setting inside it that makes your app do the same thing as if it was missing.Repair can be prevented to a certain extent with DISABLEADVTSHORTCUTS, but you can't stop the user right-clicking on your MSI file (or going to Add/remove Programs) and choosing repair, and that will reinstall the missing file. It's better to design something that works with repair instead of trying to defeat it because repair cannot be absolutely prevented and if your app required repair to never happen then your app design is broken.

 

It's a built-in feature of Windows Installer triggered by a number of entrypoints, shortcuts being one of them.  It's an automatic version of right-click=>Repair on the MSI file, or from Add/Remove Programs.  If somebody chooses that repair the files will also reinstall, so it's usually easier to live with this rather than try to defeat it.

 

The icon doesn't point to the exe because that's not actually where the icon is. It's in the Binary table of the MSI file, and that link describes how Windows can get it.  That link allows Windows to get hold of the icon even if the exe isn't around, and there are some features of Windows Installer that require that capability.

 

By default, shortcuts are advertised shortcuts - they don't point directly to the target. They have an encoding that contains the feature name, ProductCode guid and Component Code guid. If you search this forum for DISABLEADVTSHORTCUTS you'll find how to disable them.

 

====================================================================================

For just one file, the method that works in all cases is to set the component guid to null for that file:

 

http://msdn2.microsoft.com/en-us/library/aa368007.aspx

 

where it says "If this column is null.....".

 

The exact path of the user.config files can also be explained like this:

<Profile Directory>\<Company Name>\<App Name>_<Evidence Type>_<Evidence Hash>\<Version>\user.config

<Evidence Type> and <Evidence Hash> - information derived from the app domain evidence to provide proper app domain and assembly isolation.

http://msdn.microsoft.com/en-us/library/ms379611.aspx

 

If there's any concern, please feel free to let me know.

 

Have a nice day!


这篇关于ClickOnce - 应用安装,然后第二天应用参考被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆