28

I wish to add a licence agreement to my setup files (using setup project) If the user does not accept it, the setup should be cancelled.

How to do it?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Furqan Sehgal
  • 4,917
  • 33
  • 108
  • 167

1 Answers1

60

You can easily add a "License Agreement" dialog to a setup project created in Visual Studio.

To do this, follow these steps:

  1. With your setup project open in Visual Studio, right-click on the project in the Solution Explorer, point to "View", and click "User Interface".

  2. Right-click on the "Start" group, and select "Add Dialog" from the pop-up menu.

  3. In the "Add Dialog" dialog, click the "License Agreement" icon and click "OK". A license agreement form will be added to your installer under the "Start" group.

  4. Drag and drop the "License Agreement" dialog in the list to rearrange where it appears in the setup sequence.

  5. With the "License Agreement" dialog selected, use the "Properties Window" to customize its options as needed for your application. The most important thing to set here is the "LicenseFile" property, which specifies the text file that contains the license agreement you want to be displayed.

    If you cannot find the text file that contains your license agreement, you need to add it to your setup project. To do this, select the "Browse" option from the "LicenseFile" drop-down box. Then, in the dialog that appears, double-click on the location where you want your license agreement to be copied to the target machine (presumably the "Application Folder"), and then click the "Add File" button. Your license agreement should be named "license.rtf", and must be encoded as an RTF file.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 19
    One note. Don't create notepad file for license and then save it as .rtf by choosing all files option. Vb.net setup and deployment needs rtf encoding only. So open wordpad. Copy the license contents and now save the file. In word pad default extension will be rtf only. And do not forget to name it as strictly license.rtf. Now u can use this license.rtf in your application folder and set it as file for license agreement. If you do not follow these guidelines license will not show in the license agreement window. It will be blank only. – vaichidrewar May 30 '11 at 23:35
  • Microsoft word can also be used to create an RTF file. Make a document "Save As" and in the "save as type" dialog select .rtf – Mike Bovenlander Nov 29 '17 at 11:35