如何将文件直接安装到用户计算机上已有的文件夹中?我所阅读的所有文档只解释如何创建自定义的INSTALLDIR。
例如:c:\ProgramFiles(x86)\ExampleFolderA\ExampleFolderB\InstalledFile.exe
发布于 2014-01-09 09:04:17
您应该首先定义目录结构:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ExampleFolderAId" Name="ExampleFolderA">
<Directory Id="ExampleFolderBId" Name="ExampleFolderB" />
</Directory>
</Directory>
</Directory>请注意,上面的定义不会在安装运行时创建目录。为了真正“创建”目录,您必须将文件放在那里(使用Component元素),或者显式声明目录是空的。
就像这样:
<DirectoryRef Id="ExampleFolderAId">
<Component Id="SampleComponent" Guid="GUID-GOES-HERE">
<File Id="SampleFile" Source="C:\readme.txt" KeyPath="yes" />
</Component>
</DirectoryRef>或
<DirectoryRef Id="ExampleFolderBId">
<Component Id="EmptyFolderComponent" Guid="GUID-GOES-HERE">
<CreateFolder />
</Component>
</DirectoryRef>希望你能想到这个主意。
https://stackoverflow.com/questions/21012746
复制相似问题