I'm using Visual Studio Installer 1.1 for deployment of applications
developed with VB6.0.
I would like to install these applications in a kind of directory strukture
which looks like this:
[ProgramFilesFolder]
CompanyDir
DirApplication1
DirApplication2
...
For each application there is a separate istallation package!
Using VSI 1.1 the "Name" field on the "Installation Folder" tab in the
project properties does not accept e.g "CompanyDir\DirApplication1". It only
accepts a simple name e.g "CompanyDir" or "DirApplication1".
Is there any workaround using VSI 1.1?
Is there any other posibility how I can get this, e.g adding/changing the
VSI-created .msi file with Orca?
Thanks in advance,
J. Martin
How are the things going?
If you have some problems to modify the installation package for
manipulating its run-time TARGETDIR via ORCA, I suggest you can try the
following approach, it presents how to install the application to another
Installed Product's Directory:
(Note: assume the installed product is the DirApplication1, and the target
installation product is DirApplication2 in your case. Also you can apply
the whole modifications to both packages, but you need to specify the
"ProductName" argument in GetLocation.vbs respectively)
Preserving the Installation Location in that installed product's
installation package:
1. Add a CA(Type:51) to specify the standard property ARPINSTALLLOCATION
with [TARGETDIR]
SetLocation 51 ARPINSTALLLOCATION [TARGETDIR] in CustomAction table
2. Insert this CA in the InstallExecuteSequence table, specify its order
as 799:
SetLocation NOT Installed 799 in InstallExecuteSequence table
In the target installation package:
1. Checked that installed product's path and specify it to the TARGETDIR
property:
Use the CA script(Immediate action:6 +
msidbCustomActionTypeFirstSequence 256) to get the Installed Product's
InstallLocation:
QueryAPP1 262 GetLocation in CustomAction table
GetLocation [Binary Data] ...read binary from the following
GetLocation.vbs file in Binary table
Insert this CA in the InstallUISequence table and the
InstallExecuteSequence table, specify its order as 700:
QueryAPP1 Not Installed 700 in InstallUISequence table
QueryAPP1 Not Installed 700 in InstallExecuteSequence table
2. Prevent the user to customize the application's folder(TARGETDIR):
Add a custom property(APP1_Installed) as the condition flag:
APP1_Installed False in Property table
Specify it to True in the GetLocation.vbs if the existing installed
product installation location found
Add a row in the ControlCondition table to prevent the user to customize
the application's install folder if APP1_Installed="True":
FolderForm FolderEdit Disable PP1_Installed="True"
***********************
GetLocation.vbs:
Option explicit
dim installer, installLocation, product
Set installer = CreateObject("WindowsInstaller.Installer")
For each product in installer.products
'APP1Name is the installed product's productname, you can find it in its
installation package's Property table
If installer.ProductInfo(product, "ProductName") = "DirApplication1" Then
installLocation = installer.ProductInfo(product, "InstallLocation")
MsgBox installLocation
If installLocation <> "" Then
Property("TARGETDIR")=installLocation
Property("APP1_Installed")="True"
End If
Exit For
End If
Next
Set installer = Nothing
Hope it helps!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! :C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
sorry for the late reply, but I had much work outside the office.
Your post was good hint, where to look/change .msi file created by VSI 1.1.
According to MSDN documentation:
MSDN Library - October 2001
Platform SDK Documentation
Setup and System Administration
Setup
Windows Installer
Using Windows Installer
How do I change the target location for a directory?
I should manipulate the Directory Table, but that did not work. I am not
familiar with Windows Installer, Table entries and those stuff.
Anyway, finally I found a very simple way to achieve my goal without digging
into the depth of Windows Installer :-)
Using VSI 1.1 I could easily build my directory structure to:
[ProgramFilesFolder]
CompanyDir
Using Orca I then added "\DirApplication1" in CustomAction Table in the
"Target" cell in the "DIR_CA_TARGETDIR" row.
The "DIR_CA_TARGETDIR" row already was created by VSI 1.1 and the "Target"
cell entry was "[ProgramFilesFolder]CompanyDir".
I tested the .msi file and the behaviour was as I wanted to be:
[ProgramFilesFolder]
CompanyDir
DirApplication1
was the default setting in the select directory dialog.
Thanks for that hint ("CustomAction" and "Type 51"). Without I would still
reading MSDN :-)
Best regards,
J. Martin
I am glad to know you have already worked out it, have a nice weekend:)