We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Serafín
Posts: 27
Joined: Wed Aug 30, 2006 11:12 am

Property "APPDIR" is empty

Hi,

I'm testing Advanced Installer 4.3

I have created a VBScript where I read the value of Session.Property("APPDIR") and assign it to a variable. Something is wrong because the value of that variable is always “null”.



I have tried two different approaches:

a) -Placing the VBScript in section Install of Custom Actions

b) - Placing the VBScript in section Commit of Custom Actions



Any idea of what might be wrong?

TIA
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

For this use "Property Set with Formatted" custom action like this:

Property Name: your property
Formatted Text: [APPDIR]

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Serafín
Posts: 27
Joined: Wed Aug 30, 2006 11:12 am

Thanks gig for the answer, but I must continue doing something badly so that it does not work.
Script is the following one:

Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 25
Dim sComputer
dim oService, oShare
dim sDir

sDir = Session.Property("APPDIR")
msgbox sDir
if msgbox("Messege", vbyesno+vbquestion) = vbyes then

sComputer = "."
Set oService = GetObject("winmgmts:\\" & sComputer & "\root\cimv2")

Set oShare = oService.Get("Win32_Share")

errReturn = objNewShare.Create(sDir, "Share Name", FILE_SHARE, _
MAXIMUM_CONNECTIONS, "Descrip")

end if


I need to recover the route of installation of the program to be able to share the folder in the network.

Thank's
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Under install section all custom actions all added as deferred by default. And a deferred custom actions can not access properties.

My suggestion is to schedule your custom action under "InstallFinalize" standard action. You can make "InstallFinalize" visible by selecting the "InstallExecuteSequence" and choose "Show Standard Action->Before Finalize->InstallFinalize"

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Serafín
Posts: 27
Joined: Wed Aug 30, 2006 11:12 am

Thank's Gigi, now works fine

Return to “Common Problems”