Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Pls Help: MM VBS CA and Session Obj Interface


3 replies to this topic

colby

colby
  • Full Members
  • 37 posts

Posted 06 February 2003 - 23:05

I am having all kinds of trouble trying to figure out how a VBScript merge
module CA interfaces with the currently running installation containing the
merge module.

In a VBScript CA inside my merge module I am attempting to use the
TargetPath(folder) Property of the Session Object as described below. (I am
creating a text file and writing the information to the file only for
testing purposes at the moment.)
When I run the install containing the merge module, the text file only
contains "Path=". What am I doing wrong here?

'=========================================
dim objFSO, objFile, strDir, strPath

set objFSO = CreateObject("Scripting.FileSystemObject")
set objFile = objFSO.CreateTextFile(".\FileName.txt", True)


strDir = "DirName.MM_ID"
strPath = Session.TargetPath(strDir)

objFile.WriteLine("Path=" & strPath)
objFile.close
'=========================================

hambone

hambone
  • Members
  • 206 posts

Posted 07 February 2003 - 15:37

the TargetPath property of the session object requires that the directory you are looking for is a primary key in the Directory table.

do you have the DirName.MM_ID folder in the directory table and do the two match as far as case is concerned ?

when you are doing this, has the app. already installed the components that use this path already installed for the user ?

colby

colby
  • Full Members
  • 37 posts

Posted 07 February 2003 - 19:26

Yes on both counts.  The primary key in the Directory Table is "MY_FOLDER_NAME.9BD8627F_76D1_4FE1_ADAC_1998779661EA".  This matches EXACTLY (case included) to the string value passed to Session.TargetPath(strValue).

Furthermore, the custom action sequence is called just after InstallFinalize.

The custom action is set up as a type "1046" which is VBScript installed with product (22) + Synchronous, check exit code (0) + queued for execution at scheduled point in scsript (1024) with the scheduled point being 1951 immediately after InstallFiles which is set to 1950.

I added code to report the error messages and this is what I got:

err.number= "-2147467259"
err.description= "TargetPath,Folder"
err.source= "Msi API Error
err.HelpContext= "9712"
err.HelpFile= "Msi.chm"

I can't seem to find any information on this in the SDK documenation.

hambone

hambone
  • Members
  • 206 posts

Posted 07 February 2003 - 19:56

there is a ms article "Step-by-Step Guide to Creating Windows Installer Packages and Repackaging Software for the Windows Installer" that indicates that this error ( it does seem to be a generic error code relating to a lot of different root causes ) can be caused by permissions problems...

specifically "...if you receive this error message, select the file and turn off Auto Register.".  i know we are not working with files here but directories, but are the permissions okay ?


could that be the case here ?