简体   繁体   English

极其简单的应用程序和文本文件,是在Windows Store上分发的最佳方法?

[英]Extremely simple app and a text file, best way to distribute on Windows Store?

I have an extremely simple application I'd like to distribute on the Windows Store. 我有一个非常简单的应用程序,想在Windows应用商店中分发。 This is the first I've looked at Store. 这是我第一次查看Store。

The entire project consists of the exe and readme.txt. 整个项目由exe和readme.txt组成。 The app has a button that opens a second window and displays the contents of the readme. 该应用程序具有一个按钮,可打开第二个窗口并显示自述文件的内容。

The exe will be packaged using Desktop App Converter (DAP). 该exe将使用Desktop App Converter(DAP)打包。 Is there a way I can add the text file to the package as part of the DAP process or post-process? 有什么方法可以将文本文件作为DAP流程或后期处理的一部分添加到包中?

I know I can put the file inside the exe as a resource, but I'd like to avoid doing that simply so the user can open it in their own text editor as well. 我知道我可以将文件作为资源放置在exe中,但我想避免这样做,以便用户也可以在自己的文本编辑器中将其打开。

Is there a way I can add the text file to the package as part of the DAP process or post-process? 有什么方法可以将文本文件作为DAP流程或后期处理的一部分添加到包中?

You could firstly use DAC tool to convert your WPF application. 您可以首先使用DAC工具转换您的WPF应用程序。 Then you could modify the packaged app by adding the text file into visual assets folder: 然后,您可以通过将文本文件添加到可视资产文件夹中来修改打包的应用:

在此处输入图片说明

Then you need to manually generate a new Package Resource Index file and repackage your app using MakeAppx tool. 然后,您需要手动生成一个新的程序包资源索引文件,并使用MakeAppx工具重新打包您的应用程序。

You could open your command tool and Change directory to the package's root folder, and then create a priconfig.xml file: 您可以打开命令工具,然后将目录更改为包的根文件夹,然后创建一个priconfig.xml文件:

makepri createconfig /cf priconfig.xml /dq en-US

Create the resources.pri file(s) by using the command 使用以下命令创建resources.pri文件

makepri new /pr <PHYSICAL_PATH_TO_FOLDER> /cf <PHYSICAL_PATH_TO_FOLDER>\\priconfig.xml

For example: makepri new /pr c:\\MYAPP /cf c:\\MYAPP\\priconfig.xml 例如: makepri new /pr c:\\MYAPP /cf c:\\MYAPP\\priconfig.xml

Finally, you need to generate a new package: 最后,您需要生成一个新包:

makeappx pack -d "C:\\VLCUWP\\VLCUWPApp\\VLCUWPApp\\PackageFiles" -p "C:\\VLCUWP\\VLCUWPApp\\VLCUWPApp\\VLCUWPApp.appx" . makeappx pack -d "C:\\VLCUWP\\VLCUWPApp\\VLCUWPApp\\PackageFiles" -p "C:\\VLCUWP\\VLCUWPApp\\VLCUWPApp\\VLCUWPApp.appx"

For more details, please refer to Create an app package with the MakeAppx.exe tool . 有关更多详细信息,请参阅使用MakeAppx.exe工具创建应用程序包

With Visual Studio 2017 Update 4 , this has become much easier now. 使用Visual Studio 2017 Update 4 ,现在变得更容易了。 You don't have to use the Desktop App Converter for projects like this anymore, you can do the packaging directly and easily in VS with the new Packaging Project type. 您不必再为此类项目使用Desktop App Converter,您可以使用新的Packaging Project类型在VS中直接轻松地进行打包。 You can just add that to your WPF source project and it will take care of packing the EXE and the text file and whatever else you want to package into the .appx package. 您可以将其添加到WPF源项目中,它将负责将EXE和文本文件以及其他任何您想打包到.appx包中的内容打包。

Here is a blog post explaining the details: https://blogs.windows.com/buildingapps/2017/10/18/visual-studio-2017-update-4-makes-easy-modernize-desktop-application-make-store-ready/ 这是一篇解释详细信息的博客文章: https : //blogs.windows.com/buildingapps/2017/10/18/visual-studio-2017-update-4-makes-easy-modernize-desktop-application-make-store -准备/

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

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