Ok, but please help me in on doing that....
We decided to use includes because we have huge directory tree and some parts of the tree are in the main wxs file, and some are in the included xmls. We need to refer to the folders from the xmls to the wxs (for example at shortcut creation). And it is possible that in two different xml files we use the same directory.

Maybe undersandable if i show you a sample.
I'm sure that there can be lot of problems with the design, but we are not fully familiar with all parts of the wix. :( Still learning. Please tell me all problems that you find.

First of all.
We have different xmls for ComponentRefs and different for the Folders/Components. We needed this to be able to manage the files easily by scripts. We have more different users on the target PC, and we have to be able to install different shortcuts and permissions for the users.
You can find some sample code below.
Sorry for the long post, but i can not make is shorter. I'm waiting for all helps and comments.

Thanks in advance
Tamas

The main wxs looks like this:
<Feature Id="Complete" Title="Full progam" Description="The complete program release." Display="expand" ConfigurableDirectory="TARGETDIR" Level="1">
   <ComponentRef Id="COMPONENT_DRIVER1"/>
   <?include ..\packagefiles\comprefs\anotherDriver_comprefs.xml?>
 <Feature Id="HOSTFiles" Title="HostFiles" Level="1">
     <?include ..\packagefiles\comprefs\HOST_head.xml?>
 </Feature>
 <Feature Id="Manpower" Title="Manpower" Level="0">
   <Condition Level="1">POWER="MAN"</Condition>
     <?include ..\packagefiles\comprefs\manpower_comprefs.xml?>
 </Feature>
</Feature>
<Property Id="TARGETDIR" Value="c:\"/>
<Directory Id="TARGETDIR" Name="SourceDir">
   <Directory Id="Win" Name="WINDOWS">
       <Directory Id="system32" Name="System32">
           <?include ..\packagefiles\anotherDriver.xml?>
           <Component Id="COMPONENT_DRIVER1" Guid="...">
<File Id="driver1dll" Name="driver1.dll" Source="SourceDir\..." DiskId="1" Vital="yes"/>
           </Component>
           </Directory>
       </Directory>
   </Directory>
<Directory Id="docAndSetting" Name="docs" LongName="Documents And Settings">
       <Directory Id="User1Dir" Name="User1">
<Directory Id="User1StartMenu" Name="startmen" LongName="Start Menu">
               <Directory Id="User1Programs" Name="Programs">
                   <Directory Id="User1Tools" Name="Tools">
                   </Directory>
               </Directory>
           </Directory>
       </Directory>
       <Directory Id="User2Dir" Name="User2">
           <Directory Id="User2Desktop" Name="Desktop">
           </Directory>
<Directory Id="User2StartMenu" Name="startmen" LongName="Start Menu">
               <Directory Id="User2Programs" Name="Programs">
                   <Directory Id="User2Startup" Name="Startup">
                       <Component Id="COMPONENT_User2Startup" Guid="...">
<File Id="Scheduler" Name="SCHEDU~1.BAT" LongName="Scheduler.bat" src="SourceDir\.." DiskId="1" Vital="yes"/> <File Id="poller" Name="poller.bat" LongName="poller.bat" src="SourceDir\.." DiskId="1" Vital="yes"/>
                       </Component>
                   </Directory>
               </Directory>
           </Directory>
       </Directory>
   </Directory>
   <Directory Id="ProgramFilesFolder" Name="PFiles"><!-- Program Files-->
       <?include ..\packagefiles\HOST.xml?>
       <?include ..\packagefiles\manpower.xml?>
   </Directory><!-- Program Files-->
</Directory>
<UI>
   <?include Dialogs.wxs?>
   <?include Errors.wxs?>
   <InstallUISequence>
       <Show Dialog="FatalError" OnExit="error"/>
       <Show Dialog="UserExit" OnExit="cancel"/>
       <Show Dialog="ExitDialog" OnExit="success"/>
       <Show Dialog="StartDlg" Before="LaunchConditions"/>
   </InstallUISequence>
</UI>


*HOST.xml:*
<Include>
   <Directory Id="Company" Name="Compy" LongName="Our Company">
       <Component Id="Comp1" DiskId="1" Guid="...">
           <File Id="file1" Name="file1.exe" Source="SourceDir\....exe"/>
<File Id="file2" Name="file2.exe" LongName="file2.exe" Source="..."/> <Registry Id="InstalledReg" Action="write" Root="HKLM" Key="..." KeyPath="no" Name="Installed" Value="Installed" Type="string"/> <Shortcut Id="ShortCut01" Directory="User1Tools" Name="Tool1.lnk" LongName="Good Tool.lnk" Target="c:\Program Files\Internet Explorer\iexplore.exe" WorkingDirectory="c:\Program Files\Internet Explorer" />
           <CreateFolder Directory="Company">
               <Permission User="USER1" GenericAll="yes"/>
               <Permission User="USER2" GenericAll="yes"/>
           </CreateFolder>
       </Component>
       <Directory Id="CompanySub" Name="Compy2" LongName="Subfolder">
       <Component Id="COMP2" Guid="...">
                   <CreateFolder/>
                   <RemoveFile Id="DelFiles2" Name="*" On="uninstall"/>
                   <RemoveFolder Id="DelFolder2" On="uninstall"/>
<File Id="FILE3" Name="USER~2.EXE" LongName="Userblabla.exe" src="SourceDir\..." DiskId="1" Vital="yes"/> <File Id="FILE4" Name="User~3.EXE" LongName="Userlonganemee.exe" src="SourceDir\..." DiskId="1" Vital="yes"> <Shortcut Id="ShortCut04" Directory="User2Startup" Name="Tool5.lnk" LongName="Good Tool5.lnk" WorkingDirectory="CompanySub"> </File> </Component> </Directory> </Directory>
   <Component Id="COM_registry" Guid="...">
<Registry Id="Reg_9" Action="write" Root="HKCR" Key="htmlfile\shell" KeyPath="no"/> <Registry Id="Reg_10" Action="write" Root="HKLM" Key="..." KeyPath="no"/> <Registry Id="Reg_11" Action="write" Root="HKLM" Key="SOFTWARE\..." KeyPath="no" Name="File" Value="comments.txt" Type="string"/>
   </Component>
</Include>

*HOST_head.xml:*
<Include>
   <ComponentRef Id="Comp1"/>
   <ComponentRef Id="COMP2"/>
   <ComponentRef Id="COM_registry"/>
</Include>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to