0

So I keep getting multiple errors thrown in trying to use wixV4 as a stand-alone command line tool.

I’m coming at this having written a .exe in something OTHER than Visual Studio and for the life of me I can’t see why folders don’t show up. Can v4 even use a single .wxs to create a project?

Dead simple example, I want to make an .msi out of the following:

C:\program files\TestApp\TestSubDir\testfile.exe

Can a single .wxs even do this?

<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
 
<Package Name="TestApp" Manufacturer="TestManufacturer" UpgradeCode="A2145143-CC15-4F74-B282-1E7346A6550A"
Version="1.0.0" >
<MajorUpgrade DowngradeErrorMessage="A newer version is installed" AllowSameVersionUpgrades="yes"/>
 
                 <StandardDirectory Id="ProgramFilesFolder">
                          <Directory Id="InstallFolder" Name="TestApp"/>
                 </StandardDirectory>
                
                 <Directory Id="ContentFolder" FileSource="C:\source\MSIbuilds\Content" Name="Content" />
                 <Directory Id="AnotherFolder" Name="AnotherTestFolder" />
        
 
         <Feature Id="Main">
                  
                  <Component Directory="InstallFolder">
                          <File Source="TestApp32.txt" />
                 </Component>
                  
                  <Component Directory="AnotherFolder" Guid="3C4A9718-A55A-4539-B16C-4DB82D8C3AC0" >
                          <File Source="Testfile.txt" />
                  </Component>
                
         </Feature>
        
 
</Package>
 
 
        
</Wix>
  • WHAT errors show up? You haven't described what the problem is. – Tim Roberts Apr 06 '23 at 05:29
  • Your `` is unclosed. – Tim Roberts Apr 06 '23 at 05:30
  • Well, that’s the whole thing, no errors thrown. I fixed the xml in my original post(it was hastily referenced from my original xml). You can take the code as is and throw wix command line build tool at it all day, and it builds without failures. But no subdirectories ever get created.. Either referencing them by FileSource attribute “c:\ source\…” or just using the Directory tag gets me nowhere. What am I doing wrong? – anony mouse Apr 06 '23 at 15:04
  • You should try using the "heat" tool to generate the basic structure. Use `-sfrag` and `-suid` to suppress extra tags. https://wixtoolset.org/docs/v3/overview/heat/ – Tim Roberts Apr 06 '23 at 17:25
  • 1
    That’s for v3, which doesn’t at all apply to v4. Anything done on v3 will basically break in v4 – anony mouse Apr 06 '23 at 17:38
  • Fair point. Is there a reason you need to use V4, which is only about three days old? – Tim Roberts Apr 06 '23 at 17:42
  • 1
    Well, not technically but v4 is months old now. Also build tools for v4 are simplified. (No Lux or candle or plasma or sunburn or heatstroke or whatever billion light-themed tools in the chain to use anymore). It’s great… when it works. :( – anony mouse Apr 06 '23 at 17:47

1 Answers1

1

To create subdirectories, make them children of the parent directory:

<StandardDirectory Id="ProgramFilesFolder">
  <Directory Id="InstallFolder" Name="My App">
    <Directory Id="InstallSubFolder" Name="My App Subfolder" />
  </Directory>
</StandardDirectory>
Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • That was it Bob! Thank you, I was closing the installFolder tag too early so the subdir was not nested. Thanks again! – anony mouse Apr 06 '23 at 18:34