如何限制 Windows UWP 应用只能安装在设备内存上

How to restrict a Windows UWP App to be installable only on Device memory

Windows Phone 用户可以 select 将应用程序安装到 设备 SD 的默认位置存储设置中的卡片

假设我的应用程序在 Windows 商店中并且用户尝试安装我的应用程序。

情况 1: 用户 phone 中没有任何 SD 卡。所以一切都交给了设备。完美的!这对我有用。

情况2:用户有SD卡,但App安装位置被用户设置为设备。这也适用于我。

情况3:用户有SD卡,App安装位置设置为SD卡。这就是问题所在存在!

出于某种原因,我希望我的应用程序只能安装在设备的内存上,而不是 SD 卡上。

问题: 是否可以在 Package.appxManifest 中添加一些内容,以便 Windows 商店通知用户我的 App只能安装在设备的内存中,不能安装在SD卡上。是否可以将我的应用程序安装限制在设备内存中?

我浏览了很多链接,但其中 none 讨论了这个特定用例。

感谢帮助!

在打包选项中有一个选项可以防止在外部存储器上安装,但我不记得具体是在哪个选项卡中,也不记得它是如何调用的。

希望对您有所帮助。

编辑

找到了。您只需在清单选项的“应用程序”选项卡中选中“防止在 SD 卡上安装”选项即可。

有关详细信息,请参阅 this tutorial

现在专门在将包上传到商店的过程中完成。

App Declarations

Customers can install this app to alternate drives or removable storage. This box is checked by default, to allow customers to install your app to removable storage media such as an SD card, or to a non-system volume drive such as an external drive. If you want to prevent your app from being installed to alternate drives or removable storage, uncheck this box. Note that there is no option to restrict installation so that an app can only be installed to removable storage media. Note For Windows Phone 8.1, this was previously indicated via StoreManifest.xml.