So I am using Wix to install my application, it works great and does everything that I need. The one issue I am having now is this. I am using the following command line argument in my VS 2010 Pre-build Event command:
heat.exe dir "C:\My Main Folder" -cg MyApplication -gg -scom -sreg -sfrag -dr APPLICATIONROOTDIRECTORY -var var.MyApplication -out "..\..\MyApplication.wxs"
My issue is that the .wxs file that is generated gives me the following folder structure:
<Fragment>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Directory Id="dirB19DCB4311BD6C765579FE56A2C72DF8" Name="My Main Folder">
My question is if there is a way to pass in an argument that could change the name of the "My Main Folder" directory, because as of right now I am changing it manually but this is extremely inefficant and makes it so that we cannot have an automated build process. If anyone has any suggestions or places I could look that would be great! Right now I am leveraging the "WiX: A Developer's Guid to Windows Installer XML" book to try and find a solution but am not finding anything.
Depending on exactly what you are aiming to do, I would be tempted to use -srd to suppress the generation of the root directory and then change the -dr parameter to point at the directory with the correct name.
Other than that, I think the only other simple option is probably an XSL transform, which you can use by specifying the -t parameter.
As ChrisPatrick suggested you can use the -srd to suppress the generation of the root directory and use your own with -dr.
heat.exe dir "C:\My Main Folder" -srd -dr "DIRNAMEHERE"
You can find more information here, heat documentation
Related
i am currently working with wix in combination with visual studio 2013. bud there is something i just dont seem to get working. i am building an installer (.MSI) which means i need to add files to it, of course i dont want to do it al by hand so i am trying to use heat.exe for it bud was not succesful up to this moment.
i have tried the following:
i made a system variable that points to the location of the files.
i put that system variable in the command as described in the Wix documentation:
heat dir ".\MySystemVariableName" -gg -sfrag -template:fragment -out directory.wxs
i inserted this command in the pre-build command line, also i selected suppress ICE validation.
when i build the project it returns error 9009, i couldnt figure out why or what the problem was so i followed a tutorial on youtube.
in that tutorial another command was used:
“$(WIX)bin\heat.exe” dir “$(SuperFormFilesDir)” -cg SuperFormFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var env.SuperFormFilesDir -out “$(ProjectDir)Fragments\FilesFragment.wxs”
in the video it was stripped down to this:
“$(WIX)bin\heat.exe” dir “$(MySystemVariableName)” -cg MySystemVariableName -gg -scom -sreg -sfrag -srd -out “$(ProjectDir)\FilesFragment.wxs”
when i build the project with these changes it returns two errors:
startindex is not allowed to be bigger than the lengt of the
character-array.
the command "commando..." exited with code 1.
the first error is a mystery to me and the second is an error that has a huge ammount of potential problem that could cause this error.
i am realy struggeling with it, my knowledge of Wix is almost 0 since i am using it for the first time and my program skills are by far not sufficient to solve it on my own.
link to the video for the people who are interested.
thanks in advance.
I had the same problem with a default WIX installation (v3.11 in my case)
If anyone wants to know how I fixed it, here it is.
You need to add the bin folder of your WIX installation in the path variable of your environment variables.
I have a Compressed file (Self-extracting) that was included as a ExePackage for the current BootStrapper project I'm working on.
I was asked to Unzip the package before including it in the BootStrapper, so that the end user doesn't have to unzip the file before starting the install process of that package.
Excluding the install application, there is two folders (win32 && win64) that contain 288 files each, I need to create a PayloadGroup out of these files. I started doing this by hand, but after looking at Heat element, I saw that Heat can generate Payloadgroup.
How can I harvest from the directories the Payloadgroup that is required for this package.
Doing this manually is a very long process ...
If using Visual Studio you're supposed to be able to go in your setup project's references and click on the reference in question and set Harvest to true.
If I recall this had some issues, and some online sources said it wasn't working for them, I'm not sure at the moment. Which is why I called heat from the command line in a post-build event. Something like this:
call "$(WIX)bin\heat.exe" dir "$(TargetDir)." -var var.$(ProjectName).TargetDir -dr INSTALLFOLDER -cg Binaries -gg -g1 -ag -scom -sreg -sfrag -srd -o "$(SolutionDir)Setup$(ProjectName)\$(ProjectName).Binaries.wxs"
You can even specify an XSLT transform that filters your generated wxs file. For more info check this helpful blog post
I implemented heat.exe dir -generate payloadgroup in v4.0 (https://github.com/wixtoolset/issues/issues/3470). In v3.x, the -generate option was only supported by project harvesting (heat.exe project ...).
need to add Files.wxs file in to Product.wxs file
i added the using include command(include Files.wxs)
this gives and error
Error 1 The Wix element contains an unsupported extension element 'Include'. The Wix element does not currently support extension elements. Is the Include element using the correct XML namespace?
added this for create buldevents
"$(WixToolPath)heat.exe" dir "project path" -var var.SourceDir -gg -sfrag -scom -sreg -suid -t "$(ProjectDir)TransformDirectoryToWix.xslt" -out "$(ProjectDir)Files.wxs
any way to solve this?
Something seems fishy here.
You use include for other WXI files. You don't need to include wxs files with each other.
If you want to reference element that resides in another wxs file, you set ID's and use: DirectoryRef, ComponentRef, ComponentGroupRef, etc..
Check out ComponentGroupRef: http://chriseelmaa.com/harvesting-files-with-wix-heat/
I am new to WIX and trying to create a WIX for my Web application.
I have run heat.exe as PreBuild Event of Installer setup project.
"C:\Program Files (x86)\WiX Toolset v3.7\bin\heat.exe" dir "$(Wixdest)" -cg BUDirect -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var env.Wixdest -out "C:\Workspaces\Chatra\BUFragment.wxs"
The BUfragment.wxs is created as specified above and reference structure of all dll,xml,pdb is seen in BUfragment.wxs after compile; and CAB and MSI package is created in Bin\Release folder.
But when i try to see into Cab non of the files related to Web application or TARGETDIR are not their.
What could have been gone wrong and any idea if am I missing some configuration settings?
Have you added the <ComponentGroupRef Id="BUDirect" /> created in the BUFragment.wxs into a feature?
Fragments are only included within the build when you reference one of the elements within the fragment.
I have recently converted visual studio setup projects to wix project. Everything great, except that you have to ist every file manually. Is there something similar to adding project output (VS studio setup project). I read something about HeatProject task but don't know how to use it, could not find any documentation or example of the same.First question,is it possible to add project output instead of adding files one by one if yes then how?
Heat offers same functionality like tallow, or paraffin. Paraffin will generate .wxs fragment file containing list of all files which will be deployed. Using parameters you can set which files you want and more.
Example
%1\Paraffin.exe -dir "..\..\..\..\Web\HostDir" -dirref INSTALLLOC -custom APPL ..\..\WebFragment.wxs -guids -ext .csproj -direXclude obj -multiple
We use heat.exe to harvest our app files as follows. The %FULL_PUBLISH_PATH% is the full path to the directory that we instructed msbuild to publish the webapp to.
"%WIX_TOOLS_PATH%heat.exe" dir %FULL_PUBLISH_PATH% -dr WEBAPPLOC -ke -srd -cg ComponentNameToUse -var var.publishDir -gg -out FileNameToUse.wxs