简体   繁体   English

如何允许 C# UWP 应用程序管理另一个 UWP 应用程序?

[英]How to allow a C# UWP app manage another UWP app?

I want to do some things, which I feel are very simple, but I cannot do.我想做一些事情,我觉得很简单,但我做不到。 I have looked at numerous websites and StackOverflow questions.我查看了许多网站和 StackOverflow 问题。 One question has helped me a bit by pointing me in the right direction, but I feel I need more than just that.一个问题给我指明了正确的方向,对我有所帮助,但我觉得我需要的不仅仅是这些。

Here is what I want to do (basically):这是我想做的(基本上):

  • I would like to make a UWP app that can be managed by another app.我想做一个可以由另一个应用程序管理的UWP应用程序。
    • By "managed" I mean: “管理”是指:
      • Should be able to install the app.应该可以安装应用程序。
      • Should be able to uninstall the app.应该可以卸载应用程序。
      • Should be able to check for updates and update the app.应该能够检查更新并更新应用程序。
      • It should also be able to launch the app.它还应该能够启动应用程序。
    • Optional requirements:可选要求:
      • While launching the app, I would like to have it set the page of a panel to a certain page.在启动应用程序时,我想让它把面板的页面设置为某个页面。 Also fine with it clicking on the navbar and change the panel's page单击导航栏并更改面板页面也可以
        • This would be an example of my app would be like (the one with the panel/nav): Question这将是我的应用程序的一个示例(带有面板/导航的应用程序): 问题
  • I would also like an installer (something like a .exe file or .msi file) for the installing app.我还想要安装应用程序的安装程序(类似于.exe文件或.msi文件)。 Not the .appinstaller that visual studio 19 produces.不是 Visual Studio 19 生成的.appinstaller Something like Inno Setup produces.像 Inno Setup 这样的东西会产生。

Is any of this possible?这有可能吗?

If so, please give me some sample code/instructions/links.如果是这样,请给我一些示例代码/说明/链接。 I would be very thankful for any advice/points in the right direction as well!我也将非常感谢您提供正确方向的任何建议/要点!

If not, please suggest what other language/framework I should use to accomplish these tasks (Is "tasks" the right word?).如果不是,请建议我应该使用什么其他语言/框架来完成这些任务(“任务”是正确的词吗?)。 I don't mind learning anything and have unlimited time.我不介意学习任何东西并且有无限的时间。 Don't care about the learning curve either.也不在乎学习曲线。 (If I need C++, I will do it. ONLY IF I NEED IT!!!) (如果我需要 C++,我会做的。只有在我需要的时候才做!!!)

Thanks all!谢谢大家!

PS I know about WPF or WinForms. PS 我知道 WPF 或 WinForms。 I don't want to use them because of their age.我不想使用它们,因为它们的年龄。

As the Rob Caplan said, PackManager class doesn't support uwp app, it is suitable for desktop app.正如 Rob Caplan 所说,PackManager class 不支持 uwp 应用程序,它适用于桌面应用程序。 So maybe you need to create a wpf app and use Desktop bridge to package it into uwp app so that you could use this api.所以也许你需要创建一个 wpf 应用程序并使用桌面桥到 package 到 uwp 应用程序,这样你就可以使用这个 Z1A7A89AAZ72ED10564E。 In addition, you could find the sample here about installing appx package, its parent directory Windows-classic-samples/Samples/ also contains other samples you need, such as PackageManagerRemovePackage, etc, please check it.另外,你可以在这里找到安装appx package的样例,它的父目录Windows-classic-samples/Samples/还有你需要的其他样例,如PackageManagerRemovePackage等,请查看。

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

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