确定 Clickonce 应用程序在 Clickonce 缓存中的位置
我有一个通过 ClickOnce 部署的应用程序,以及一个需要访问 ClickOnce 应用程序的安装目录的单独的 .NET 控制台应用程序。通过应用程序的安装目录,我的意思是:
"C:\Documents and Settings\[用户名]\Local Settings\Apps\2.0\[obfuscatedfolder]\[obfuscatedfolder]\[obfuscatedfolder]\application.exe"
,或Windows 7:
“C:\Users\[用户名]\AppData\Local\Apps\2.0\[混淆文件夹]\[混淆文件夹]\[混淆文件夹]\application.exe"
有什么方法可以让我生成或最好在构建时确定我的应用程序的混淆文件夹名称是什么?
基本上,我希望控制台应用程序(随应用程序的每个版本一起构建和分发)了解应用程序安装的目录结构。
我知道我可以使用“Application.ExecutablePath”从 ClickOnce 应用程序中确定此位置,然后将该值保存到已知位置,但我更希望能够提前预测应用程序的安装路径...
任何想法?
I have an application deployed via ClickOnce, along with a separate .NET console application that needs access to the ClickOnce application's installation directory. By the application's installation directory, I mean:
"C:\Documents and Settings\[username]\Local Settings\Apps\2.0\[obfuscated folder]\[obfuscated folder]\[obfuscated folder]\application.exe"
, or on Windows 7:
"C:\Users\[username]\AppData\Local\Apps\2.0\[obfuscated folder]\[obfuscated folder]\[obfuscated folder]\application.exe"
Is there any way for me to generate, or preferably determine at build time, what the obfuscated folder names will be for my application?
Basically, I would like for the console application, which is built and distributed with each release of the application, to know the directory structure under which the application will be installed.
I know that I can determine this location from within the ClickOnce application using "Application.ExecutablePath", and then save the value to a known location, but I would much rather be able to predict the application's installation path in advance...
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为不可能提前知道那条路。当您更新应用程序的版本时,它也可能会发生变化。
您想知道两个应用程序可以找到对方的路径吗?如果是这样,您可以在一个应用程序中使用简单的 IP 侦听器并从另一个应用程序连接到它。您只需连接 127.0.0.1,然后向其他应用询问路径即可。
I don't think its possible to know that path in advance. It can also change when you update the version of an app too.
Do you want to know the path so that the two apps can find each other? If so you could use a simple IP listener in one app and connect to it from the other one. You can just connect on 127.0.0.1 and then ask the other app the path.