I'm building a msi installer using wixtool. I'm able to install that msi in any location, by browsing the directory.
I'm trying to simplify the installation steps. What I need is I want to install the msi installer in the same path where the installer exists.
For example if I have my msi installer in D:\test directory, then it should install the same in D:\test directory without asking for the path to install.
Please help, Thanks.
The Windows Installer sets the OriginalDatabase property to the path of the installation database used to launch the installation. If the installation is launched from a command line, the value depends on whether the recache package option (the -v flag) is present in the REINSTALLMODE property.
So, you can set the TARGETDIR to the value of the OriginalDatabase property
Related
I used the Wix tool in Visual Studio 2015 to generate an msi in a custom directory - not in Program Files. The software got installed alright (only for current user) but I am unable to uninstall it.
The error shown is: The specified path 'H:\Config.Msi\' is unavailable.
However, a folder with name exists at the specified path. Also, the uninstallation succeeds when I delete the contents of the folder created by the installer.
Any ideas on how I can get the software to uninstall cleanly?
The problem was that the referenced path H: was a virtual drive that caused the error. Mapping TARGETDIR to reference the correct path was a work-around. For my use case, this was sufficient.
I have generated an MSI using Wix for the deployment we used octopus. While running the msi build through octopus some files like dlls, .. are not getting updated in the respective path for the first time of deployment. If we install the same for second time then works fine all the files placed in the folder.
These are the steps I have followed:
I have created a Wix project and generated a msi build through that. Then through the octopus using .xml file I have deployed the content in the specified folder. And deployment was not successful through octopus.
You really haven't given any information to troubleshoot. Are you using major upgrades or minor upgrades? What's your command line? Have you logged the installers and read through the logs? What do they tell you?
msiexec /i example.msi /qn /l*v install.log
/qn = silent /l*v = verbose logging
My first suspect is that you aren't versioning your DLL's correctly and that Windows Installer is skipping over them. Please see:
File Versioning Rules
Default File Versioning
Replacing Existing Files
We have created an installer with wix. It is working fine on my machine. But on one of the client's machine it get installed in C:\ drive. When I checked the log file, I found this line
MSI (c) (24:28) [16:33:31:142]: PROPERTY CHANGE: Modifying ProgramFiles64Folder property. Its current value is 'C:\Program Files\'. Its new value: 'C:\'.
Do anyone have any idea about it??
We are able to find the solution. User was doing administrative installation of the product by using below command:
msiexec -a "path-to-msi" -l*v <logfilename>
As a workaround, user should use the following command:
msiexec -i "path-to-msi" -l*v <logfilename>
i am using the following command to see the logs in wix installer.
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\DFServices.log"
but this command is trying to install the msi again.
I want to execute this command from wix after finishing the installation and log file need to save in installed folder.
can any one help me on this.
You need to decide in advance if you want Windows Installer to make a log file. You also need to decide in advance where it should go. If you want it to end up in the install folder then you either need to copy it there after installation or specify the install folder in advance, too.
In Windows Installer folders are controlled by properties. You can specify such properties in the command that starts installation. The name of the property for the "install folder" depends on how the installer authoring; INSTALLFOLDER is one typical name.
So, you could do this with a command like this:
msiexec /i "D:\WixProjects\DFServicesWixSetup\DFServices\bin\Debug\DFServices.msi" /L*V "D:\path\DFServices.log" /qb INSTALLFOLDER="D:\path"
The /qb switch is reduce the UI such that the user is offered the chance to change the installer folder. It may more may not be need for your installer, depending on what dialogs its UI normally shows.
So, the first step is to figure out which property sets the install folder in your installer.
I am trying to create shortcuts to uninstalling whatever the bootstrapper has installed.
So simply i want to do the same thing as the uninstall does when going to Add and remove programs.
I found that de bootstrapper is installed in package cache{guid}[bootstrappername].exe
One of the msi packages that it installs also installs a shortcut to this bootstrapper /uninstall call.
However problem is that the GUID of the package is regenerated on every build. So i some how have to set it as
a msi property.
But i cannot figure out how to do this, seem to me that the GUID is not known during building but only after build is done?
is there another way to determine the location of the cached bootstrapper ?
If you are use Managed BA you can try this:
In your Bundle.wxs in chain with MsiPackage add MsiProperty like:
<MsiPackage SourceFile="Setup.msi">
<MsiProperty Name="UNINSTALLER_PATH" Value="[UNINSTALLER_PATH]"/>
</MsiPackage>
Somewhere in code (before call install action), you need set value for this variable like this:
Engine.StringVariables["UNINSTALLER_PATH"] = string.Format(#"{0}\{1}\{2}\{3}.exe", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache", Engine.StringVariables["WixBundleProviderKey"], ProductName);
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) – path to %systemdir%:\ProgramData
Package Cache- folder name in ProgramData where installing bundle caching
Engine.StringVariables["WixBundleProviderKey"] – name of folder (guid) created by caching bundle
ProductName – name of your bootstrapper “exe”
And finally in your Product.wxs you can create shortcut usual way, but in “Target” attribute you need pass UNINSTALLER_PATH value and “Arguments” set ="/uninstall":
<Shortcut Id="Shortcut1" Name="Uninstall" Description="Uninstall" Target="[UNINSTALLER_PATH]" Arguments="/uninstall" WorkingDirectory="Programmenufolder" />
sorry for my english :)
You can determine the location using the bundle upgradecode you define in your bundle.wxs.
Use the registry path to windows uninstall location of your bundle
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{upgradecode of your bundle}
or for 64 Bit OS
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{upgradecode of your bundle}
The value BundleCachePath contains the fullpath including your bootstrapper.exe filename to the package cache where your bundle is cached.
You can also use the value QuietUninstallString which contains the full quiet uninstall command or UninstallString to launch the uninstall in non quiet mode.