Wix installation and deployment tutorials get administrator privileges

Source: Internet
Author: User

When an application is running, it will inevitably read and write files and generate new data. However, files under program files cannot be changed at will. Files under win7 will be rejected if they do not have permissions. I have two methods: one is to move the data path to the program data directory, and the other is to grant permissions to the file.

Programdata

<Directory Id="CommonAppDataFolder">        <Directory Id="YourFolder" Name="YourFolder">         <Directory Id=‘dirC9846820F5B48BC9EAD9F647E841B025‘ Name=‘DemoProject‘ >              <Directory Id=‘dirF6068DAA29DBB05A7EAD1E3B5A48BBEE‘ Name=‘Data‘ />              <Directory Id=‘dir10737BF4DF605200AA7B844D908DAED9‘ Name=‘GraphicPages‘ />              <Directory Id=‘dir16D2B386B2034B9488996466AAAE0B57‘ Name=‘History‘ />              <Directory Id=‘dirBE8545AE7AB0276E15898AAE7ACFBD7A‘ Name=‘Resource‘ />            </Directory>        </Directory>      </Directory>

Of course, your application path must support this method.

 

Get folder Read and Write Permissions

 

 <DirectoryRef Id=‘dirB59C44B238E764B86C6DFC0A8045E3FA‘ >      <Component Id=‘cmpB59C44B238E764B86C6DFC0A8045E3FA‘ Guid=‘BDAA4089-F7C0-42E8-928E-B81901938FCD‘ KeyPath=‘yes‘ >               <CreateFolder Directory="dirB59C44B238E764B86C6DFC0A8045E3FA">           <Permission User="SYSTEM" GenericAll="yes"/>           <Permission User="EveryOne" GenericAll="yes"  GenericRead="yes" Read="yes" ReadAttributes="yes"  GenericExecute="yes" TakeOwnership ="yes"  GenericWrite ="yes"    WriteAttributes="yes" ReadPermission ="yes"   ChangePermission="yes" />           <Permission User="Users" Domain="[LOCAL_MACHINE_NAME]"  GenericRead="yes" Read="yes" ReadAttributes="yes"  GenericExecute="yes" TakeOwnership ="yes"  GenericWrite ="yes"    WriteAttributes="yes" ReadPermission ="yes"   ChangePermission="yes"/>                  </CreateFolder>      </Component>    </DirectoryRef>

This requires the application of wixutilextension. dll, Wix namespace should also be added: xmlns: util = "http://schemas.microsoft.com/wix/UtilExtension">

At the beginning, if no everyone is added, it cannot be saved. If yes, it is OK. The installation icon has an additional sign.

There should be better methods or ideas. If you pass by, please enlighten me.

 

Wix installation and deployment tutorials get administrator privileges

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.