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.
Related
I have a WiX installer that was working fine, but it's been a few months since I worked on it... so, I am not attempting to build the installer (on a reconfigured machine) and now it fails to build every time. I've tried to simplify everything to isolate where it's failing, but I still can't seem to figure out why. Essentially, it looks like it's failing at the pre-build process. I had a length Pre-build Event command, but I've simplified it to the bare essentials. Here's my command:
call “$(WIX)bin\heat.exe” dir "$(SolutionDir)MyProj\bin\Release" -out “$(ProjectDir)MyFiles.wxs”
The error I'm getting is:
call “C:\Program Files (x86)\WiX Toolset v3.10\bin\heat.exe” dir "C:\Users\MyName\Documents\GitHub\MyProj\bin\Release" -out “C:\Users\MyName\Documents\GitHub\MyProj\Installer\MyFiles.wxs”
The filename, directory name, or volume label syntax is incorrect.
The code appears to exit with code 1, which seems to suggest that it's failing to locate a filename or path... however, I've checked the paths that are printed in the output log and the heat.exe application does exists under the C:\Program Files (x86) directory. The directory (dir) it's trying to harvest is properly defined and the output location is as well. So, does anyone know why this is failing?
Update
What's incredibly strange is that the pre-build event command seems to fail even when I simplify the command to try to simply call the heat.exe application (with no other parameters). I tried changing my pre-build event to the following:
call “C:\Program Files (x86)\WiX Toolset v3.10\bin\heat.exe”
As you can see from the attached image, the heat.exe application is indeed located in the directory specified in the build command. Yet, I still get an error saying that the MSBuild failed and exited with code 1. If I check the output log, it says that the, "filename, directory name, or volume label syntax is incorrect". However, I can say that this installer was working properly a few months ago with no changes to the build events... so I really don't know why it wouldn't work now, except that I had to reconfigure my machine and reinstall Windows 10 recently. I downloaded and installed the latest WiX toolset, and would assume that would be everything that is needed. But, this error persists. Any ideas?
This is really dumb but I believe you need to put a \ at the end of your dir IIRC. I think I ran into the same issue at one point. The error is not particularly helpful.
call "$(WIX)bin\heat.exe" dir "$(SolutionDir)MyProj\bin\Release\" -out "$(ProjectDir)MyFiles.wxs"
(I think I was remembering backwards and you need to NOT have the trailing \ in the dir.. sorry)
Just in case you can't get the pre-build event to work, you can also call heat like this (requires editing the wixproj file)
<Target Name="BeforeBuild">
<Exec Command=""$(WIX)bin\heat.exe" dir "$(SolutionDir)MyProj\bin\Release" -out "$(ProjectDir)MyFiles.wxs""/>
</Target>
This is how I call heat in some of the installers I've authored. If this also doesn't work I'm out of ideas for why this doesn't work for you.
I know its a little old question but I've faced the issue and spent hours to notice different qoutes here: “$(WIX)bin\heat.exe”. Replace with straight ones "$(WIX)bin\heat.exe" and enjoy.
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 ...).
I am new to using WiX so this my be a dumb question. I am trying to keep the GUID generated by the harvest tool (heat.exe) consistent for files that I am packaging. Everyone seems to say that as long as the file path and sub path remain same heat.exe will generate the same GUID for a file. Unfortunately, I am not seeing that behavior. My workflow is as follows.
Copy all the deliverable files to a staging directory during my build process. Then run heat.exe in the staging directory to generate the component fragment wxs file. Before I copy the file into the staging directory I clear all my old files.
I want to add the generated wxs file into my source control so that I can achieve minor upgrades. If my understanding is correct for me to achieve that I need to have consistent GUID across my builds so that I can track them.
The command line I use for generating the wxs file is as follows:-
c:\foobar\build\>C:\win32\wix-3.7.1224.0\heat.exe dir . -cg MyCG -dr INSTALLDIR -g1 -gg -nologo -sreg -suid -t C:\foobar\src\support\packaging\wix\foo.xslt -var var.foobarSource -out c:\foobar\src\support\packaging\wix\foo.wxs
What I see that the GUID generated are different during each run. Is there was a way for me to keep GUID consistent.
You should specify -ag flag.
-ag
Auto generate component guids at compile time, e.g. set Guid="*".
As long as your file paths are the same, generated GUID's will be the same for files.
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
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