安装程序-VS 2015中的安装项目 [英] installer- Setup project in VS 2015

查看:58
本文介绍了安装程序-VS 2015中的安装项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在VS2015中开发窗口应用程序(例如计算器).我已经为此应用程序创建了一个安装文件,该文件将在PC中安装该应用程序.我们是否可以在安装项目中编写代码(例如添加新的.cs文件或类似的内容),因为我正在尝试创建针对每台PC的自己的产品密钥(自定义密钥)?同样,该代码应在首次在台式机上安装产品时运行,要求用户提供产品密钥.安装完窗口应用程序后,应该只执行在主项目(计算器,而不是安装程序项目)中编写的任何代码.

I am working on a window application (Ex. a calculator) in VS2015. I had created a setup file for this application which will install the application in PC. Can we write code inside the setup project (like adding a new .cs file or something like that) because I am trying to create my own product key (custom key) specific to every PC? Also, that code should run while installing the product very first time on desktop asking for the product key to the user. Once the window application gets installed, whatever code written inside the main project (calculator, not in setup project) should only get executed.

如果有人可以提出其他建议,以便应用程序仅在安装时要求自定义产品.

If anyone could suggest some other way so that the application should ask for custom product only during the time of installation.

推荐答案

应用程序,首次启动 :许多部署人员倾向于建议在应用程序本身中提供许可-首次发射.原因很多,下面是尝试的解释: 具有Windows应用程序在线注册的安装程序 .

Application, First Launch: Many deployment guys tend to recommend putting licensing in the application itself - on first launch. There are many reasons, and here is an attempted explanation: Installer with Online Registration for Windows Application.

自定义操作 :自定义操作用于在MSI设置中执行异常或专有的操作.由于MSI和 部分).从根本上说,自定义操作很复杂,存在 sequencing- conditioning- 假冒问题 和整体 可调试性差 .

Custom Actions: Custom actions are used to do unusual or proprietary stuff in an MSI setups. Custom actions are legendary for being very difficult to get right and reliable due to the overall complexity of MSI and the complexity of deployment overall (section "The Complexity of Deployment"). Essentially custom actions are complex with sequencing-, conditioning- and impersonation issues and overall poor debugability.

底线 :在应用程序启动代码中实现逻辑时,您会处在熟悉的境地,没有模拟或调试困难.开发起来容易得多.调试和维护容易得多.

Bottom Line: When you implement logic in your application launch code you are in familiar territory with no impersonation or debugging difficulties to deal with. Much easier to develop. Much easier to debug and maintain.

每用户许可 :挑战在于您的应用程序必须写入HKCU或用户配置文件-除非运行时具有管理员权限.我更喜欢按用户进行许可,从而可能使许可随用户漫游.或使用在线许可方法,并通过电线一次性设置许可.例如,通过登录应用程序的方式.您登录在线服务,所有许可就是其中的一部分.

Per-User Licensing: The challenge is that your application must write to HKCU or the user profile - unless it runs elevated with admin rights. I prefer licensing to be done per-user, potentially allowing the license to roam with the user. Or to use an online licensing approach with licensing set up once over the wire. For example by a login approach to the application. You log into an online service and all licensing is part of that.

P.S:可以将ACL更改应用于HKLM,从而允许未提升的应用程序将许可证密钥写入HKLM.可能,不是建议.

P.S: It is possible to apply ACL changes to HKLM allowing a non-elevated application to write a license key to HKLM. Possible, not a recommendation.

这篇关于安装程序-VS 2015中的安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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