I am using automated build and installer project to create msi file in TFS 2008. There I need to create a big folder structure having thousands of file and having size of hundreds of MB on user machine when user installs using MSI file. Using TFS installer project, if I add individual file then my installer.vdproj becomes really big and unmaintainable.
So is there a good way to handle these bunch of files as single unit? I can think of compression mechanism for now, which has two parts: -
How to compress the files into a cab file(in MSBulid process may be)? It seems the makecab command only takes one file at a time?
How to modify installer project so that cab file is part of MSI and on user's machine the cab file is uncompressed to create the folder structure? can I have cab file as well as MSI (so that cab file is not part of MSI) ? rest of the dlls go into MSI.
Thanks
Tools from the Windows Install SDK such as MSIFILER.EXE can be easily scripted to load a whole directory of files (for example) into the MSI's file store or the CAB.
In your case, you would want to configure the script to be run as a post-build event, so that first you build the setup project's MSI then the script modifies it.
You are correct that makecab.exe only takes one file at a time. You can use a CMD shell FOR-loop to add them one-by-one (e.g. FOR /F %%file IN ('dir /b /s') DO makecab %%file output.cab). Personally, I prefer archive tools like 7-zip which are also scriptable from the command line.
There are several methods to add the files to the Windows Installer package (e.g. WiImport.vbs, MAKEMSI, or manually)...
..but maybe you don't want to do that. I think it might be better to just include the archive (zip, cab, whatever) and create a custom action in the setup project to extract it during the install.
Related
Here is what I am dealing with. I have a WIX project, that outputs a MSI file. This works like a charm.
I got a new requirement, that I need to analyse in order to figure out how to approach it. As the new requirement is, I need to get as output, a ZIP file, that contains the files and folders as described in the WIX project...
I searched for the "ZIP" keyword on the official documentation, but did not have any luck in finding something helpful...Maybe some of you guys have an idea?
Obviously, I could use other tools to perform this, like maven and the maven assembly plugin, but that would cause maintenance issues, as there would be 2 different projects, 2 different technologies, and since the files and directories structure is quite big, this could cause issues like one developer modifying a project, and forgetting about the other..
So yeah...difficult question...any input would be welcomed :)
Thx
Administrative Installation: Windows Installer / MSI features a built-in capability to extract all files and make a "network installation point" (a network location where installation can be kicked off from to install on all workstations on the network - ensures all source files are available for repair operations and patching). This is called an administrative installation - in plain terms a glorified file extraction mechanism.
Given the availability of the administrative installation, is a ZIP file really necessary? I suppose you could zip up the extracted admin image? Note that any files that need to go to system, shared or userprofile folders may cause issues and prevent successful launching of your application from the extraction folder (obvious, just mentioning).
Command Line: Try it, from a cmd.exe command prompt (see above link for more details):
msiexec.exe /a MySetup.msi
You could set the Compressed="no" attribute of the Package element to create an uncompressed layout. The result could be easily zipped (excluding the *.msi file) by running any of the freely available command-line zippers (e. g. 7za.exe of 7-zip).
Note:
File elements can override the Compressed attribute of the package.
I would like to create a script that will update files in the (default) install location with files from the source location where needed, based on the .wxs files that I have. I need to get this info from the wxs files, because the installation dir structure differs from the source location dir structure.
This would speed up my development cycle by not requiring a complete MSI uninstall/install when I have only recompiled one DLL for instance.
Is there functionality available in the Wix toolset that can give me a list of corresponding source and destination paths or would I have to implement everything including parsing of the Wix XML files myself?
I did not see anything relevant in the List of Tools section of the Wix documentation.
Alternative Approach: I would suggest using the commercial file and directory syncing and comparison tool Beyond Compare to copy files to the destination directory with ease if this is just for QA. I guess you can use post build steps too, but Beyond Compare is very nice and reliable. It has the features you need for just about anything related to comparison of files and folders (not affiliated). You can let the application just sit there and you can do a full comparison on the fly whenever needed. Essential software for deployment people. Alternatives exist of course (list).
I’m writing an MSI for using WiX 3.0 and I’m trying to figure out how to make it include all but some files from a directory without having to manually specify each and every attribute. Similar to a dynamic pickup in installshield.
An old installer I’m looking at for reference (which uses WiX 2.0) does the following:
A makefile to call a script that will copy all the necessary files to a separate directory structure that emulates how the final product should be installed.
another script to insert the attributes for each of the files in this temp folder to a partially completed wxs file.
WiX runs
I want to avoid this step and was wondering if there were some commands or pre-processor directives to achieve this WiX itself?
Also the 1st step above spits out some generated files (from a tool) which is then included into the wxs file. Is there a way I can emulate that as well?
You need to specify each file.
However, you can use Heat.exe to automatically generate a wxs file you can include as part of your build process.
I cheaped out with a non-solution, and zipped up the directory and it's files in the build script. The advantage of your current method is that MSI is aware of the files and they could potentially be key files (and thus patched/upgraded and/or repaired).
I'd look into saschabeaumont's suggestion about using heat. clearly a better solution
I've just started looking at wix again now that it looks like installer projects are going to be deprecated from VisualStudio. We have a third party application that is "install via xcopy", which makes it hard for us to track in terms of versioning so we'd like to create an msi for it. There are several hundred files that are part of the installation.
I'd like to use heat to create the list of files for the installer, but I've heard that it's not good to use heat to create the wxs file more than once with autoguids because then your installer will have issues.
I was wondering if in wix 3.6, there was a command line parameter to heat which would take a previously generated wxs file as the source for guids? I want heat to autogenerate guids for any new files, but use the previous output of heat as a database for existing files.
If you use the -ag flag this will set the guids to be generated at compile time and as long as the path doesn't change the compiler will keep the same guid for each component. Rather than use a command-line to do the harvesting it is better to edit the *.wixproj file and add a HeatDirectory element.
Our application is distributed as a zip file, with a small bat/shell script that the user runs after extracting the archive to install the application. This zip file is currently created via mavens assembly plugin.
The zip file we distribute contains a lib folder with an executable jar, as well as all the files we need as part off the deployment off the actual application.
What we want is a self extracting zip-file that executes that contained bat file after the zip file has been extracted. And this should be created as a part off the build process.
I have read creating-a-self-extracting-zip-archive-on-a-linux-box, and can do that. But I don't see anywhere how to also execute a bat file within the extracted archive when it's done.
I have found winzip self-extractor, but I would prefer something that can be run on any platform. The build server and some developers use linux. I also found some VB code which leads me to believe that there might be some autorun properties on zip files.
Did you consider using IzPack (and the IzPack Maven Plugin) to generate a cross-platform installer?
The previous replier suggested lzpack, it's documentation contains the following pointer:
""The 7-Zip project (see http://www.7-zip.org/) provides a so-called SFX for installers, i.e., an image that can be use to create self-extracting Windows executables. Once its content has been extracted, such a self-extracting executable can launch an executable or a file. In the later case, it is assumed that there exists an association between a file extension and a software component.""
7-zip is cross platform, although I haven't tried whether you can build sfx files for windows on linux.
The 7zip manpage says you can do this.
EXAMPLE 2
7z a -sfx archive.exe dir1
add all files from directory "dir1" to SFX archive
archive.exe (Remark : SFX archive MUST end with
".exe")
While it's a bit late:
We just released a Maven plugin that can do this (docs at https://zephyr.sunshower.io/site/). It's free, open-source, and permissively licensed.
We bundle a JRE with our application using this plugin, then launch an IzPack installer with that JRE. It also supports code-signing, which we expect to have documented within the week.