/build/static/layout/Breadcrumb_cap_w.png

How to change the installation directory for msi dynamically

Hi Folks,

I'm new to WPS. My requirement is like this. I have an .msi. I should change the INSTALLDIR to C:\test on desktops and to D:\test on servers. So I have registered one enviornment system variable like SoftDir=C:\test in desktops and SoftDir=D:\test in servers. So i want to set the INSTALLDIR in tables of WPS according to this SoftDir. Is there any way in WPS or ORCA to set the variable for ex: set sample=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\SoftDir(key)……sample should fetch the value of softdir key (C:\test or D:\test) in the registry....So that i can use sample in place of INSTALLDIRECTORY......Hope you understand my problem. Appreciate your help. Thanking you.

0 Comments   [ + ] Show comments

Answers (3)

Posted by: MSIPackager 14 years ago
3rd Degree Black Belt
0
Well I guess you could do it that way if you wanted - seems rather over-engineered and having to create environment variables on all workstations and servers (in my opinion) is messy. Better to keep everything internal to the MSI - there are a couple of easy options for starters:

1) If you need to keep a single MSI for both environments (or don't want a seperate transform / command line for servers) there is a standard property MsiNTProductType which you can use to detect the OS type then you could set the INSTALLDIR value accordingly or
2) Assuming the standard INSTALLDIR path is already C:\Test - you could just create an MST for the server installations which sets the INSTALLDIR to D:\Test

Your way is possible but you'd have fiddle around a lot more to get it working - the above 2 options are straight forward and you won't need to do anything outside of the package.

Hope this helps,
Rob.
Posted by: sridhar22_85 14 years ago
Yellow Belt
0
Hi Rob,

Thanks for your advice. For desktops i'm sure SoftDir is C:\test...but server i'm not sure whether it is D:\test or E:\test....In this case how can i proceed with the package....Please suggest...

Thanks
Sridhar. A
Posted by: MSIPackager 14 years ago
3rd Degree Black Belt
0
Easiest solution is to create a server specific transform, add and entry in the property table INSTALLDIR = D:\Test (or E:\Test) and install via the following command line:

msiexec /i your.msi transforms=yourtransformname.mst /qb (or whatever switched you require)

You will get a validation error in the MST but don't worry about it.

Cheers,
Rob.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ