如何创建自定义WPF安装向导 [英] how to create a custom WPF setup wizard

查看:144
本文介绍了如何创建自定义WPF安装向导的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了我的第一个wpf应用程序,没什么花哨的,但是我想通过添加一个设置使它看起来很酷,我在互联网上研究了一些免费实用程序来执行此操作,但是由于它是一个wpf应用程序,所以我安装程序遵循这些原则...我知道如何创建自定义wpf安装程序向导吗?

解决方案

在构建WPF安装程序时,您无需解决.Net引导程序的问题-如果客户端没有.Net,则您的安装程序将无法正常工作. /p>

解决该问题后,您的设置将需要做几件事:

  • 请求管理员提升权限以访问某些文件和注册表位置
  • 部署%ProgramFiles%\
  • 中的所有必需文件
  • 在HKLM \ Software \ Microsoft \ Windows \ CurrentVersion \ Uninstall中创建适当的条目(如果您的应用程序是针对x86显式编译的,则需要在64位计算机上的Wow6432Node中进行此操作)
  • 在所有程序"中创建快捷方式\
  • 根据应用程序提供的功能,执行其他操作,例如COM注册,文件关联等

其中大多数是Windows Installer(MSI)免费提供的.您确实应该使用 WiX 之类的东西来构建常规安装程序,即使它不会像WPF那样令人眼花y乱.会.

如果您真的想花哨的话,实际上可以构建由MSI引擎驱动的自定义WPF UI,但是这样做的开销可能不值得.

更新:如果您仍然决定构建WPF UI安装程序,那么以下几个链接会有所帮助:

i've built my first wpf application, nothing fancy, but i wanna make it look cool by adding a setup, ive researched in the internet about some free utilites to do it, but since its a wpf app, i wat the setup to go along those lines... any idea how i can create a custom wpf setup wizard?

解决方案

When building a WPF setup, you neet to solve the problem of .Net bootstrapping - if the client does not have .Net, your setup will not work.

Once you solve that, your setup will need to do couple of things:

  • request admin elevation to access certain file and registry locations
  • deploy all necessary files in %ProgramFiles%\
  • create proper entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall (if your application is compiled explicitly for x86, you'll need to do it in the Wow6432Node on 64-bit machines)
  • create a shortcut in All Programs\
  • do additional stuff like COM registration, file association and so on depending on what features your app provides

Most of these are provided for free by Windows Installer (MSI). You should really use something like WiX to build regular installer, even though it's not going to be as snazzy as WPF can be.

If you really want to be fancy, you could actually build custom WPF UI that's driven by the MSI engine, but the overhead of doing this is probably not worth it.

Update: Here are couple of links that can help if you still decide to build a WPF UI Setup:

这篇关于如何创建自定义WPF安装向导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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