Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

WiX is a dialect of XML used to make installers for Windows. Its declarative style avoids the complexity and limitations of procedural code, providing you with everything you need to package up an entire application into a single MSI file. This book gives you a good overview of WiX's capabilities to develop your own installer packages with functionalities beyond those available in Windows Installer. In the recipes of this book, you will see ways in which WiX can cut down on your installation time and help you streamline your deployment processes. You will see how to make customized installer UIs, write custom actions, create shortcuts, and also set your application as the default for a file type.
Table of Contents (15 chapters)
14
Index

Marking a file as read only

The primary reason for making a file read only is to prevent it from being accidentally modified. This could apply to end-user license agreements, readme files, and other documents that the user might open with a text editor such as Word.

In this recipe, we'll install a text file and then set its Read-only flag.

Getting ready

To prepare for this recipe, create a new setup project and name it ReadOnlyInstaller.

How to do it…

Set the ReadOnly attribute on a File element to prevent it from being accidentally modified with the following steps:

  1. Add a File element within Component to install a file called Sample.txt:
    <ComponentGroup Id="ProductComponents" 
                    Directory="INSTALLFOLDER">
      <Component Id="cmpSampleTXT" 
                 Guid="{44BB2441-F98C-41F9-A1FE-EB732B626CF4}">
        <File Source="Sample.txt" />
      </Component>
    </ComponentGroup>
  2. Add the ReadOnly attribute...