Search code examples
visual-studiowixwindows-installer

How to disable edit on a .msi file properties?


I'm completely new to Wix tools so I have no idea how to change this. I used Wix Toolset from a Visual Studio 2017 Extension to build a .msi file out of my C# project. The msi file is generated but the problem is I can change the properties of the file (Such as Title, Comments, Authors, etc.). The manufacturer attribute does not appear on details too. I have looked at the documentation and tried like adding 'ReadOnly' attribute on the Package element but it does nothing.

How do I disable edit on the msi file properties?

Product.wxs (Product element):

<Product Id="*" Name="Program Name" Language="1033" Version="!(bind.FileVersion.ProgramDLL)" Manufacturer="Company Name" UpgradeCode="random GUID">
    <Package InstallerVersion="200" Description="$(var.ProductName) Setup" Comments="$(var.ProductName) is a product of Company Name" Manufacturer="Company Name" Compressed="yes" InstallScope="perMachine" />

<MediaTemplate EmbedCab="yes"/>

<UIRef Id="WixUI_Minimal"/>
<WixVariable Id="WixUILicenseRtf" Value="Programname.License.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="Banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Welcome.bmp" />
<Icon Id="icon.ico" SourceFile="icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade AllowSameVersionUpgrades='yes' Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of $(var.ProductName) is already installed. Setup will now exit." />

<Property Id='INSTALLFOLDER'>
  <RegistrySearch Id='R_InstallDir' Root='HKLM' Key='SOFTWARE\Program\ProgramName' Name='InstallDir' Type='raw' />
</Property>

<Condition Message="Install Folder of Program Name not found">INSTALLFOLDER</Condition>

    <Feature Id="ProductFeature" Title="Program_Setup" Level="1">
        <ComponentRef Id="Cmp" />
  <ComponentRef Id="License" />
        <ComponentRef Id="DokuXSD" />
    </Feature>
</Product>

Solution

  • Corporate Advantages of MSI: A key aspect of MSI - possibly one of the most important things that has given it corporate approval and use - is the fact that MSI is an open format. There are several other such key corporate advantages for MSI centering around transparency, customizability, reliable silent running and remote management.

    The Open MSI File Format: I have this answer from before on the subject: How to protect MSI against modification. I am not sure if it is a 100% match to what you are asking, but maybe give it a quick read.

    MST - Transforms: MSI (Windows Installer) has a feature called transforms (*.mst files) which is a built-in way to modify your MSI using an external file to do so - hence allowing corporate adaptation of your MSI without changing the actual MSI. In other words: users are intended to be able to customize your MSI for corporate use (using a dedicated, additional file).

    In Summary: Don't worry that the fields can be changed, but consider signing your MSI with your own certificate to prevent your release files being tampered with in transit to your customer. Also: crucially do check your setup for malware and maybe update your license agreement to include a phrase that the setup was malware checked at the time of release, and that it is malware free "to the best of your knowledge". The legalese here is not my expertise. Do check well as signing a setup that contains malware is proof positive that you delivered the malware :-) (until people hack signatures successfully too).


    Links: