Jestem świadomy podobnych pytań wewnątrz stackoverflow:toolset Wix: utworzyć katalog w root disk (dysk systemowy lub C: ) i kopiowanie plików wewnątrz
WIX:default directory in WixUI_InstallDir,
WIX installer root directory and versioning,
Is it possible to have two root directories in WIX ,
copy file to custom dir in another partition,
How to create a directory in wix?
jednak żadna z nich nie pokazuje prostego i natychmiastowego kodu do utworzenia folderu wewnątrz folderu C: \ (nie jest to kodowanie na sztywno, ale powinno być dyskiem głównym lub dyskiem systemowym lub czymkolwiek, co można nazwać dyskiem zawierającym folder Windows) i kopiować pliki wewnątrz niego.
Innymi słowy, w jaki sposób Wix może utworzyć folder C: \ MynewDir \ example.jar?
Oto, co starałem:
<?xml version="1.0" encoding="UTF-8"?>
<!-- WiX installer MyProgram by Mark Seuffert -->
<?define ProductVersion = "13.1.2.3"?>
<?define ProductUpgradeCode = "12345678-1234-1234-1234-111111111112"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="$(var.ProductUpgradeCode)" Name="MyProgram" Version="$(var.ProductVersion)" Manufacturer="COMPANY" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" />
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="MyProgram">
<Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
<File Id="ApplicationFile1" Source="C:\Users\user\Desktop\myprogram.exe" />
</Component>
</Directory>
</Directory>
<Directory Id="ANOTHERLOCATION" FileSource="C:\MynewDir">
</Directory>
</Directory>
<DirectoryRef Id="ANOTHERLOCATION" FileSource="C:\MynewDir">
<Component Id="ApplicationFiles2" Guid="12345678-1234-1234-1235-111111111111">
<File Id="ApplicationFile2" Source="C:\Users\user\Desktop\InstallerFiles_13_4_9_3\myprogramLauncher.jar" />
<CreateFolder />
</Component>
</DirectoryRef>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
</InstallExecuteSequence>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="ApplicationFiles2" />
<ComponentRef Id="ApplicationFiles" />
</Feature>
</Product>
</Wix>
EDIT 1: Yan Sklyarenko prostu znaleźć to, czego szukasz, to jest WindowsVolume (nie wiem jak brakowało mi go wewnątrz http://msdn.microsoft.com/en-us/library/windows/desktop/aa370905%28v=vs.85%29.aspx#system_folder_properties microsoft dokumentu) .
Jak jednak zastąpić FileSource = "C: \ MynewDir" z FileSource = "[WindowsVolume] MynewDir" ??? bo podobno nawet z WINDOWSVOLUME otrzymaną objętość wybrany jest zawsze D: \ w moim komputerze, który ma więcej wolnego miejsca :(
EDIT 2 zaktualizowałem mojego kodu przy użyciu drugą próbkę Yan Sklyarenko'S (@@@@ nowapart @@@ @ identyfikuje części gdzie kod różni), ale zachowanie jest wciąż ten sam instalator wybiera dysk z większą ilością wolnego miejsca (D: \ w moim przypadku), a nie C: \ gdzie windows jest ..
<?xml version="1.0" encoding="UTF-8"?>
<!-- WiX installer MyProgram by Mark Seuffert -->
<?define ProductVersion = "13.1.2.3"?>
<?define ProductUpgradeCode = "12345678-1234-1234-1234-111111111112"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="$(var.ProductUpgradeCode)" Name="MyProgram" Version="$(var.ProductVersion)" Manufacturer="COMPANY" Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" />
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="MyProgram">
<Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
<File Id="ApplicationFile1" Source="C:\Users\user\Desktop\myprogram.exe" />
</Component>
</Directory>
</Directory>
<Directory Id="ANOTHERLOCATION" FileSource="C:\MynewDir">
@@@@[email protected]@@@<Component Id="ApplicationFiles2" Guid="12345678-1234-1234-1235-111111111111">
<File Id="ApplicationFile2" Source="C:\Users\user\Desktop\InstallerFiles_13_4_9_3\myprogramLauncher.jar" />
<CreateFolder />
</Component>
</Directory>
</Directory>
@@@@[email protected]@@@<SetDirectory Id="ANOTHERLOCATION" Value="[WINDOWSVOLUME]" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallValidate" />
</InstallExecuteSequence>
<Feature Id="DefaultFeature" Level="1">
<ComponentRef Id="ApplicationFiles2" />
<ComponentRef Id="ApplicationFiles" />
</Feature>
</Product>
</Wix>
EDYTOWANIE 3 Ostatni fragment kodu powyżej powinien działać, ale zmień obudowę WINDOWSVOLUME na WindowsVolume zgodnie z sugestią.
Nie wypróbowałem całego twojego kodu Jednak obudowa "WindowsVolume" była problemem, ponieważ prawidłowo zasugerowałeś .. Teraz mój fragment kodu działa! Dziękuję Ci – dendini