Set service's version NOT by GUI, wix - wix

How to set the service version as the installer version, using wix?
How to set it by the installer's coding, NOT by GUI.
For example : running service creates a .exe file in the bin folder.

Versioning your application files should happen before building your installer. WiX just copies files to the destination and doesn't modify them in anyway. (That would break code signing if it did.)

Related

Wix Burn - Save Installer after installation

I have a custom wix burn installer that I have made and it works well except for I can't figure out how to do one thing: save the wix burn installer exe to a location after the installation is done.
Here is my scenario:
My software can be distributed across multiple servers, but one server is the "core" server.
I plan to update the core server and then have the core server push software updates to the other server.
To have the core server distribute the update, it has to keep a copy of the Wix Burn Installer EXE somewhere for distribution. This is what I can't figure out.
Using the built in variable WixBundleOriginalSource, I can find the original installer exe. However, when I try to copy it during ApplyComplete (I don't want to save it unless it successfully installed), I get an access denied trying to copy the file (which makes sense since the burn installer is not running as an admin).
How can I accomplish this - copy the original wix burn installer exe after the installation is complete without permission issues? I get that 99.99% of the time, all file operations should happen inside an MSI, but I can't have an MSI deploy the original Wix Burn Installer, so I am stumped.
Ideas?
Thanks.
OK - here is how I worked around it. I passed the WixBundleOriginalSource to one of the MSIs and then added a CopyFile element to do the copy in the MSI...
Copy file from setup location to another location in wix on install

Wix Bootstrapper: Rules to follow for burn to be cached

I am trying to find any information how the Windows installer cache is working for Wix Bootstrappers.
For MSIs you do not follow any special rules to be sure a MSI will be cached by Windows. For Bootstrappers (Burns) it looks the same, but I had several issues trying to uninstall the package without original installer.
For me several points are not clear:
how to uninstall a product without original .exe installer?
will .exe installer be cached by default during installation?
does custom user interface affects Windows caching rules for .exe installers?
If you go into your registry and find "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall", you should be able to find a registry key corresponding to your installer package. There should be one for the bundle itself and one for each .msi installed as part of the bundle. If you find the correct key for the bundle, it will have a value called "UninstallString". This is the string you should use to manually uninstall the package via the command line.
For your second point, Windows automatically caches installed burn bundles. The same registry key you found in the step above will have another value called "BundleCachePath", which should point you to the location of the cached .exe file. This should be under "C:\ProgramData\PackageCache{GUID}", where {GUID} is the package GUID of the bundle.
I can't see why having a custom UI would change the caching location, unless you manually add a dialogue to do so.

Wix Burn Loose File Install

Copying of license files using Wix 3.10.2? We have a requirement where we need copy some license files after the installation of the webapplication to IIS. Copying of license files will be the last in the sequence. The license files will reside next to the burn (bootstrapper) setup.exe. This way we can control what license file need to be installed based on the user. I am trying to understand if there will be an issue with number of license files reside along with .exe? Is there a custom action to pick files that are not part of the msi or exe?
1) There will not be an issue with number of license files residing along with exe
2) Using the Media element without a Cabinet name you can specify that certain files will neither be inside a cab or embedded into the msi, no custom action needed. See http://wixtoolset.org/documentation/manual/v3/xsd/wix/media.html
You may need to be more precise about exactly when you want the copy to occur. Your original question says "after the installation" which implies that the install has finished and that your generated MSI is no longer running. but in a later comment you say "during the install".
If after the install is what you want, then you could add a custom executable to your Burn bundle that will do whatever you want. In many of these kinds of situations the application that needs the file just goes and gets it with help from the MSI saying where it was installed from, or by using the SourceList capabilities of Windows Installer to get the location.
If you want to copy files during the install then the CopyFile element is probably what you need. It has wildcard capability to define the files you want to copy. Your source location will be the SourceDir property and the destination will be one of your defined directories. Note that the files will not be uninstalled when the product is uninstalled.
WiX Copyfile:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/copyfile.html
I had to use native bootstrap that comes with Visual Studio SDK. With the bootstrap you can also create pre-requisite like installing .net. This worked for my requirement. Also there is a msbuild task so that you can automate it. Used setup project to create msi and VS bootstrap to create setup.exe

Wix: How to show the size of MSI packages in a burn managed UX

I have a Wix 3.6 managed bootstrapper in which the user can select individual packages to download and install. I want to show the download size of each package. How can I access the file size of each packages in the Bundle?
I guess this information is available somewhere in the Wix framework (because the file hashes are used to validate the downloaded files), but I did not find it.
I have an idea for a workaround, but it would be more implementation for me:
Have a wxs file generated programmatically that contains Variable elements containing the file size of the packages. Those variables would be read by the bootstrapper.
When your bundle is created, a BootstrapperApplicationData.xml is added to the bundle. That XML file contains a lot of metadata about the bundle and contained packages. Your bootstrapper application code can load this file by looking in the same direcotry as your bootstrapper application dll lives.
I did not found how by using the burn API, but I implemented my own workaround:
If the local file is present
query the file system
else
query the web server

publishing app in vb.net and creating setup.exe

i am publishing an app in vb.net. it's creating setup.exe and a folder called application files. i am told that setup.exe is stand alone and does not need any other files. is this right? because when i put setup.exe in a different directory it says that some files are missing.
If you're using the "Setup and Installation Package" project from within visual studio, then that's not the case. The actual setup files are the .MSI file and setup.exe is just a placeholder for the Windows Installer application.
If you're using ClickOnce, then you need the entire published directory (especially the manifest, as that tells the ClickOnce protocol where everything is at.
That said, other installer creation systems work differently.