MSi安装错误

时间:2014-10-22 08:01:45

标签: wix

使用Wix创建了MSI。当我尝试安装它时,我收到以下错误。 “安装程序没有足够的权限访问此目录c:\ programfiles \ AppTest。安装无法继续以管理员身份登录或与系统管理员联系”。 我经历了一些类似的帖子,但它没有帮助我。请参阅我的代码。

<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='AppTest' Id='*'enter code here
    UpgradeCode='{05E35D34-E7F6-4CED-BF86-B1747AE92E07}'
    Language='1033' Codepage='1252'
    Version='2.0.0.1'
    Manufacturer='LabView Inc' >

      <Package Id='*'
        Languages='1033'
        SummaryCodepage='1252'
        AdminImage='no'
        InstallerVersion='200'
        InstallPrivileges='elevated'
        Compressed='yes'
        ReadOnly='yes'
        ShortNames='yes'
        Comments='AppTest Installer Package'
        Description='AppTest Installer Package'
        Manufacturer='LabView Inc' />

        <Media Id='1' Cabinet='AppTest.cab' EmbedCab='yes' />

        <!--Directory structure-->
        <Directory Id='TARGETDIR' Name='SourceDir'>
            <Directory Id='ProgramFilesFolder'>
                <Directory Id="APPLICATIONROOTDIRECTORY" Name="AppTest"/>
            </Directory>
        </Directory>

    <!-- Adding Components-->

    <DirectoryRef Id="TARGETDIR">
        <Component Id="AppTest.dll" Guid="3947344C-8116-48FB-9F8A-080EA7D1ABAD">
        <File Id="AppTest.dll" Source="$(sys.CURRENTDIR)files\AppTest.dll" KeyPath="yes" Checksum="yes"/>
            <File Id="msvcp80.dll" Source="$(sys.CURRENTDIR)files\msvcp80.dll" />
            <File Id="atl80.dll" Source="$(sys.CURRENTDIR)files\atl80.dll"  />
            <File Id="msvcr80.dll" Source="$(sys.CURRENTDIR)files\msvcr80.dll"  />
            <File Id="Microsoft.VC80.ATL.manifes" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.ATL.manifest" />
            <File Id="Microsoft.VC80.CRT.manifest" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.CRT.manifest"  />
            <File Id="AppTest.inf" ReadOnly="yes" Source="$(sys.CURRENTDIR)files\AppTest.inf" />
        </Component>
    </DirectoryRef>


    <Feature Id="AppTestFeature" Title="AppTest" Level="1">
        <ComponentRef Id="AppTest.dll" />

    </Feature>


</Product>

1 个答案:

答案 0 :(得分:0)

您应该删除<CreateFolder Directory='AppTest' />并将代码更改为:

<DirectoryRef Id="APPLICATIONROOTDIRECTORY"> <!-- main folder ur app -->
        <Component Id="AppTest.dll" Guid="3947344C-8116-48FB-9F8A-080EA7D1ABAD">
            <File Id="AppTest.dll" Source="$(sys.CURRENTDIR)files\AppTest.dll" KeyPath="yes" Checksum="yes"/>
            <File Id="msvcp80.dll" Source="$(sys.CURRENTDIR)files\msvcp80.dll" />
            <File Id="atl80.dll" Source="$(sys.CURRENTDIR)files\atl80.dll"  />
            <File Id="msvcr80.dll" Source="$(sys.CURRENTDIR)files\msvcr80.dll"  />
            <File Id="Microsoft.VC80.ATL.manifes" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.ATL.manifest" />
            <File Id="Microsoft.VC80.CRT.manifest" Source="$(sys.CURRENTDIR)files\Microsoft.VC80.CRT.manifest"  />
            <File Id="AppTest.inf" ReadOnly="yes" Source="$(sys.CURRENTDIR)files\AppTest.inf" />
        </Component>
    </DirectoryRef>