我们如何创建不需要管理员权限的安装程序? [英] How do we create an installer than doesn't require administrator permissions?

查看:93
本文介绍了我们如何创建不需要管理员权限的安装程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio创建安装程序/MSI时,是否可以为不需要管理员权限的简单应用程序进行安装?如果在Windows XP下无法实现,那么在Vista下可以实现吗?

When creating a setup/MSI with Visual Studio is it possible to make a setup for a simple application that doesn't require administrator permissions to install? If its not possible under Windows XP is it possible under Vista?

例如,一个简单的图像处理应用程序允许您将照片粘贴在背景上.我相信安装到Program Files文件夹需要管理员权限吗?我们可以代替安装在\ AppData文件夹中吗?

For example a simple image manipulation application that allows you to paste photos on top of backgrounds. I believe installing to the Program Files folder requires administrator permissions? Can we install in the \AppData folder instead?

目标是创建一个应用程序,该应用程序将为不是本地计算机上的Administrators组成员的用户安装,并且不会在Vista上显示UAC提示.

The objective is to create an application which will install for users who are not members of the administrators group on the local machine and will not show the UAC prompt on Vista.

我相信这种方法的局限性在于,如果它为当前用户安装在app数据文件夹下,其他用户将无法运行它.

I believe a limitation this method would be that if it installs under the app data folder for the current user other users couldn't run it.

您能否在常规setup.exe类型的安装程序中将点击安装打包?您可能会问我们为什么要这样做-原因是我们有一个安装程序,该安装程序会进行先决条件检查并安装所需的任何内容(例如.NET),然后下载并执行MSI.即使这是唯一显示的内容,我们也想显示一个正常的安装程序启动屏幕.我们不介意该应用程序只能由一个用户(安装该应用程序的用户)查看.

Can you package a click once install in a normal setup.exe type installer? You may ask why we want this - the reason is we have an installer that does a prereq check and installs anything required (such as .NET) and we then downloads and executes the MSI. We would like to display a normal installer start screen too even if that's the only thing displayed. We don't mind if the app can only be seen by one user (the user it's installed for).

推荐答案

ClickOnce是解决此问题的好方法.如果转到项目属性">发布",则可以为此设置设置.特别要注意安装模式和设置":

ClickOnce is a good solution to this problem. If you go to Project Properties > Publish, you can setup settings for this. In particular, "Install Mode and Settings" is good to look at:

  • 该应用程序仅可在线使用-这实际上是一个运行一次"应用程序
  • 该应用程序也可以脱机使用(从开始"菜单中启动)-这会将应用程序安装在PC上

您实际上不必使用ClickOnce Web部署工具.如果执行Build> Publish,然后压缩publish \文件夹的内容,则可以有效地将其作为安装程序分发.为了使其更加流畅,请从自动运行setup.exe文件的文件夹中创建一个自解压存档.

You don't actually have to use the ClickOnce web deployment stuff. If you do a Build > Publish, and then zip up the contents of the publish\ folder, you can effectively distribute that as an installer. To make it even smoother, create a self-extracting archive from the folder that automatically runs the setup.exe file.

即使以这种方式安装,如果您选择使用它,则在线更新仍适用于该应用程序.您所要做的就是将ClickOnce文件置于在线状态,并将URL置于项目的发布属性"页面中.

Even if you install this way, if you opt to use it, the online update will still work for the application. All you have to do is put the ClickOnce files online, and put the URL in the project's Publish properties page.

这篇关于我们如何创建不需要管理员权限的安装程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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