Wix安装包权限问题

Wix在安装完成之后,如果遇到非管理员用户(域用户或Win7+系统,UAC权限问题等),修改配置文件(setting.ini)文件时,会遇到文件权限为只读,无法修改问题:

解决方案有两种:

首先添加UtilExtension的dll引用,并在Product.wxs文件头出添加如下代码:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

1、给文件夹添加权限

<ComponentGroup Id="MainComponentsGrp" Directory="INSTALLFOLDER">
    <Component Id="CMP_Permission" Guid="{DC0D5A83-06FE-4351-9063-F3596EC644BC}">
        <CreateFolder>
          <util:PermissionEx User="Users" GenericAll="yes"/>
        </CreateFolder>
    </Component>
    <Component Id="CMP_LibraryForSnifferdll" Guid="{2C609842-7F2A-44E5-9A5E-50ED034B1825}">
        <File Id="LibraryForSnifferdll" Source="$(var.Sniffer.TargetDir)/LibraryForSniffer.dll" KeyPath="yes"/>
    </Component>
    <Component Id="CMP_Settingconfig" Guid="{1997601A-3FEA-400E-9A82-18100723A647}">
        <File Id="Settingconfig" Source="$(var.Sniffer.TargetDir)/Setting.config" KeyPath="yes"/>
    </Component>
    <Component 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值