wmatus
Posts: 2
Joined: Sun May 14, 2006 6:20 pm

Session.Property("APPDIR") in vbs returms nothing

I am trying to run a vbs script from a Custom Action but I cannot get the install directory. In the code below, Session.Property("APPDIR") returns an empty string.


dllFileName = Session.Property("APPDIR")
msgbox dllFileName
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder("C:\Windows\Microsoft.NET\Framework")
Set sf = f.SubFolders
For Each fl in sf
If fso.FileExists(fl.Path & "\regasm.exe") Then
regasmPath = fl.Path & "\regasm.exe"
End If
Next
set wshShell = CreateObject("wscript.shell")
dllFileName = dllFileName & "CopyProps.dll"
commandName = Chr(34) & regasmPath & chr(34) & " " & chr(34) & dllFileName & Chr(34) & " /codebase"
wshShell.Run commandName


What am I doing wrong? This forum has been helpful in getting me this far.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The [APPDIR] property was introduced with 3.4 version of Advanced Installer so if you have an older version that 3.4 then use [TARGETDIR] property to get the path where the application is installed.

If you have a greater version that 3.4 then please provide me more details about where you schedule the custom action because all directories are resolved during the "CostFinalize" standard action.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
wmatus
Posts: 2
Joined: Sun May 14, 2006 6:20 pm

I am using the latest version, I think 3.9. I was able to get it to work by putting all of the code in a function and using TARGETDIR. I am not sure if one or the other or both solved the problem, but I am happy now. In fact I was just evaluating the product to see if it would do what I need and it does so I already purchased the product.

Thanks for the help.

Wayne

Return to “Common Problems”