0

I have two MSI installers,BasicInstaller.msi and updateInstaller.msi.As name suggests,the updateInstaller.msi is a updated version(with some new files added) of basic installer.I have installed Basic installer in UI mode where i have mentioned the installation path as "D:/MSIApp".

I am installing the updateInstaller.msi in silent mode using msiexec.cmd(this goes into a bat file) that overwrites the files and registry entries created by BasicInstaller.msi. I am able to install it using the below command

msiexec /i updateInstaller.msi /qn TARGETDIR=D:/MSIApp

Now,i am looking for logic where in the installated path of basicInstaller is picked up and updateInstaller is installed at the same location.In short,i want to avoid TARGERDIR switch hard coding.

If i don't specify TARGETDIR in the msiexec,the updateInstaller is installed at the default "C:/programfiles/..." location.

Could some one help me with the possible solution options.Any help appreciated.

Arshad
  • 1
  • You need to pro-grammatically find out the previous target directory from the project registry into regedit. For that you need to create the registry for your project so when ever new update come first search into registry and then update. – Saroop Trivedi Apr 30 '13 at 06:03
  • http://stackoverflow.com/questions/5029377/reference-directory-install-path-in-registry-value-using-wix – Saroop Trivedi Apr 30 '13 at 06:05

1 Answers1

1

This is usually accomplished by having the installer lay down an InstallPath (or similarly named) registry entry. Subsequent installers can read the entry and use it as their installation path.

See this page for an example.

Kevin Richardson
  • 3,592
  • 22
  • 14
  • Assuming the OP understands that renaming an MSI requires a Major Upgrade and that this is what he has implemented. (Versus just literally creating another MSI.) – Christopher Painter Apr 30 '13 at 14:28