Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用WIX的快捷方式_Wix_Exe_Shortcut - Fatal编程技术网

使用WIX的快捷方式

使用WIX的快捷方式,wix,exe,shortcut,Wix,Exe,Shortcut,我有一个安装程序,它在targetdir中创建一个文件夹“_source”,其中包含“SAMPLE.exe”和其他文件。我试图生成一个指向该exe的快捷方式,但它似乎生成/复制该exe并将其放置在目标目录中。它可以运行可执行文件,但由于源目录中需要其他文件,因此无法继续。如何指向源代码中的exe而不复制该exe <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="DesktopFolder" Sou

我有一个安装程序,它在targetdir中创建一个文件夹“_source”,其中包含“SAMPLE.exe”和其他文件。我试图生成一个指向该exe的快捷方式,但它似乎生成/复制该exe并将其放置在目标目录中。它可以运行可执行文件,但由于源目录中需要其他文件,因此无法继续。如何指向源代码中的exe而不复制该exe

<Directory Id="TARGETDIR" Name="SourceDir">
       <Directory Id="DesktopFolder" SourceName="Desktop"/>
          <Directory Id="MergeRedirectFolder">
             <Component Id="ApplicationShortcut" Guid="1D120AC7-6BAC-4F99-8611-029ED3F2EA3A">
             <File Id="MyExeFile" Source="!(wix._source)\SAMPLE.exe" KeyPath="yes">
             <Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="SAMPLE" WorkingDirectory="MergeRedirectFolder"
                 Icon="SAMPLE.exe"
                 IconIndex="0"
                 Advertise="yes" >
                 <Icon Id="SAMPLE.exe" SourceFile="!(wix._source)\icon1.ico" />
             </Shortcut>
           </File>
         </Component>
      </Directory>

如果您试图在程序文件下安装,我将从以下内容开始:

<Product ...>
...
<Feature ...>
    <ComponentGroupRef Id="ProductComponents" />
</Feature>
<Icon Id="SAMPLE.ico" SourceFile="!(wix._source)\icon1.ico" />
</Product>

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
        <Directory Id="MergeRedirectFolder" />
    </Directory>

    <Directory Id="DesktopFolder" SourceName="Desktop"/>        
</Directory>

<ComponentGroup Id="ProductComponents" Directory="MergeRedirectFolder">
    <Component Id="ApplicationShortcut" Guid="1D120AC7-6BAC-4F99-8611-029ED3F2EA3A">
        <File Id="MyExeFile" Source="!(wix._source)\SAMPLE.exe" KeyPath="yes">
            <Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="SAMPLE" WorkingDirectory="MergeRedirectFolder"
             Icon="SAMPLE.ico"
             IconIndex="0"
             Advertise="yes" />
        </File>
    </Component>
</ComponentGroup>

...

如果您试图在程序文件下安装,我将从以下内容开始:

<Product ...>
...
<Feature ...>
    <ComponentGroupRef Id="ProductComponents" />
</Feature>
<Icon Id="SAMPLE.ico" SourceFile="!(wix._source)\icon1.ico" />
</Product>

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
        <Directory Id="MergeRedirectFolder" />
    </Directory>

    <Directory Id="DesktopFolder" SourceName="Desktop"/>        
</Directory>

<ComponentGroup Id="ProductComponents" Directory="MergeRedirectFolder">
    <Component Id="ApplicationShortcut" Guid="1D120AC7-6BAC-4F99-8611-029ED3F2EA3A">
        <File Id="MyExeFile" Source="!(wix._source)\SAMPLE.exe" KeyPath="yes">
            <Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="SAMPLE" WorkingDirectory="MergeRedirectFolder"
             Icon="SAMPLE.ico"
             IconIndex="0"
             Advertise="yes" />
        </File>
    </Component>
</ComponentGroup>

...

您的桌面上有文件夹吗?看起来您正试图将其安装到桌面上的文件夹中。SAMPLE.exe安装在targetdir中的“_source”下。我想要桌面上的快捷方式,指向源文件夹中的exe。使用上面的代码,它不会在桌面上创建文件夹,它只是创建了一个快捷方式,但似乎不会指向来自_source的exe。它创建了SAMPLE.exe的一个副本,并将其放置在_source之外的targetdir中。MergeRedirectFolder是否在桌面上?看起来您正试图将其安装到桌面上的文件夹中。SAMPLE.exe安装在targetdir中的“_source”下。我想要桌面上的快捷方式,指向源文件夹中的exe。使用上面的代码,它不会在桌面上创建文件夹,它只是创建了一个快捷方式,但似乎没有指向源代码中的exe。它创建了SAMPLE.exe的副本,并将其放置在源代码之外的targetdir中。