热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Clickonce要求签署许可协议-ClickonceaskforaLicenseagreement

IsitpossibletobuildaClickOncedeployment,foraWinFormapplication,toaskfortheusertoa

Is it possible to build a ClickOnce deployment, for a Win Form application, to ask for the user to agree to a License Agreement before continuing?

是否可以为Win Form应用程序构建ClickOnce部署,以便在继续之前要求用户同意许可协议?

5 个解决方案

#1


Answer from MSDN by User Heath8041:

用户Heath8041从MSDN回答:

Sneaky Way to get an EULA displayed for your clickonce application in VS2005

Sneaky方法在VS2005中为您的clickonce应用程序显示EULA

Here's a round about way to get your clickonce applications to install with an End user license agreement. Basically you build a redistributable component that can be seen in your prerequsites dialog box under the publish window. This allows a nice way to have all your apps reuse the same agreement, if you want. It's very easy, you need only to create three files ("eula.txt", "product.xml", and "package.xml") and two folders in this case ("EULApackage", and "en"). I documented everything below on how I set mine up. it works great. the only thing you'll have to change is the Name of the component and of course you'll need your own end user licence agreement saved as eula.txt. The component needs to be put in the following path: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages in this folder you should see some sub folders for other redistributable components. First make a new sub directory for your component. I called mine EULApackage. in this new folder you need the following. -A file called product.xml and a sub folder called "en" (for english) you can do various things with the product.xml file, but here's the way mine looks

以下是关于使用最终用户许可协议安装clickonce应用程序的方法。基本上,您构建了一个可再发行组件,可以在发布窗口下的prerequsites对话框中看到。如果您愿意,这可以让您的所有应用重用相同的协议。这很简单,你只需创建三个文件(“eula.txt”,“product.xml”和“package.xml”)和两个文件夹(“EULApackage”和“en”)。我在下面记录了我如何设置我的一切。它很棒。您唯一需要更改的是组件的名称,当然您需要将自己的最终用户许可协议保​​存为eula.txt。该组件需要放在以下路径中:C:\ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ BootStrapper \ Packages在此文件夹中,您应该看到其他可再发行组件的一些子文件夹。首先为组件创建一个新的子目录。我打电话给我的EULApackage。在这个新文件夹中,您需要以下内容。 - 一个名为product.xml的文件和一个名为“en”的子文件夹(英文版),你可以使用product.xml文件做各种事情,但这是我看起来的方式




  
  
    
  


  
    

       
         
       

    
  

*in this case the file eula.txt was the text file that was my license agreement. Note that it's not an rtf file. Rtf won't display propertly using this method.

*在这种情况下,文件eula.txt是我的许可协议的文本文件。请注意,它不是rtf文件。 Rtf不会使用此方法显示属性。

Now inside my "en" subfolder i put the eula.txt file and another xml file called package.xml, again this xml file can be used to do all kinds of stuff

现在在我的“en”子文件夹中,我将eula.txt文件和另一个名为package.xml的xml文件放在一起,再次将此xml文件用于执行各种操作

heres the contents of my version*

继承我的版本内容*

 



    
        
    

  
  
    Texas Instruments End User License Agreement
    en

    User Failed to Accept Texas Instruments End User License Agreement.
    A fatal error occurred during the installation of ELUA Component Execution
    You do not have the permissions required to install this application.  Please contact your administrator.
      

Note: whatever you put in the DisplayName field is what your user will see when he's confronted with the eula text If you have all this put together correctly and in the right folders, the next time you start up VS2005 and go to your publish tab -> prerequisites you should see the DisplayName field. Just check this as a prerequisite for you app. when the user clicks install on the publish.htm file it'll present the user with the conents of your eula.txt file inside of a standard license acceptance dialog box. if the choose accept your stuff installs, if they decline then it exits rather nicely and nothing is installed on their systems. If you mess up the formatting for either of the two files or if you leave out the "en" sub folder then the component won't show up in the prerequisites dialog (when publishing)

注意:您在DisplayName字段中放置的内容是您的用户在面对eula文本时会看到的内容如果您将所有这些放在正确的文件夹中并在正确的文件夹中,则下次启动VS2005并转到发布选项卡时 - >先决条件,您应该看到DisplayName字段。只需将此作为您应用的先决条件。当用户单击publish.htm文件上的install时,它将向用户显示标准许可证接受对话框中的eula.txt文件的标记。如果选择接受你的东西安装,如果他们下降然后它退出相当不错,他们的系统上没有安装任何东西。如果您弄乱了两个文件中的任何一个的格式,或者如果省略“en”子文件夹,则组件将不会显示在先决条件对话框中(发布时)

Additional notes: although this works great it is a round about method and their are ways around the eula, such as if your publish.htm file allows them to run the application directly (I guess without the bootstrapper starting)but if they click the install button it will run. This also has the benifits of not running every time you publish an update to your clickonce application. They have to run the boot strapper to get the eula to show up (by clicking the install button on publish.htm) I figured out this method by looking at some of the other redistributable components that were already in the path C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages. You can look in those other components product.xml and package.xml files to see what cool things they've done with them. Good luck

附加说明:虽然这很好用但它是一个圆形的方法,它们是eula的方法,例如,如果你的publish.htm文件允许它们直接运行应用程序(我猜没有启动引导程序),但如果他们点击安装按钮它会运行。每次向clickonce应用程序发布更新时,这也具有不运行的优点。他们必须运行引导过滤器以显示eula(通过单击publish.htm上的安装按钮)我通过查看已经在路径C:\ Program Files中的一些其他可再发行组件来找出这个方法\ Microsoft Visual Studio 8 \ SDK \ v2.0 \ BootStrapper \ Packages。您可以查看其他组件的product.xml和package.xml文件,看看他们用它们做了什么很酷的事情。祝好运

#2


For anyone who is trying to do this it will work... I am using Visual Studio 2008 and liek Coppermill said, the location is "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\"

对于任何试图这样做的人来说,它都可以工作......我正在使用Visual Studio 2008和谎言Coppermill说,位置是“C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bootstrapper \ Packages \”

I also had to add a couple other things to the product.xml:

我还必须在product.xml中添加其他一些东西:




  
  
    
  


  
      
       
    
         
       

    
  

I also had to create a "Do nothing" executable otherwise the elcu.txt would open up in notepad. Anyway, good luck...

我还必须创建一个“什么都不做”的可执行文件,否则elcu.txt会在记事本中打开。祝你好运......

#3


I don't think there is.

我不认为有。

If you deploy your click-once app from a webpage, you could have the user accept the agreement there before installing the app. The effect will be the same.

如果您从网页部署一次性点击应用,则可以让用户在安装应用之前接受协议。效果是一样的。

#4


If we use Visual Studio 2010 then we had add it in "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages" folder. It works now.

如果我们使用Visual Studio 2010,那么我们将其添加到“C:\ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ Bootstrapper \ Packages”文件夹中。它现在有效。

#5


I am posting this as a reply to Yuki Izumi's post. Instead of using a batch file, I added an empty vbs file and modified the product.xml to

我发帖这是对Yuki Izumi的帖子的回复。我没有使用批处理文件,而是添加了一个空的vbs文件并将product.xml修改为


This is another way to prevent the eula.txt from opening up on clicking Accept. I also tried with an rtf file. That displayed properly (VS 2015).

这是防止eula.txt在单击Accept时打开的另一种方法。我也试过一个rtf文件。显示得当(VS 2015)。


推荐阅读
author-avatar
Karson2012
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有