cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ChristopheOce
Level 7

session.property + deferred execution in system context !

Hi,

i have a setup project (basic msi project) made with installshield 2008.
In this project i have a custom action in vbscript stored directly in the custom action.

This custom action gets some proprety as INSTALLDIR, ProductLanguage, ..
and open a xml file and write the property in this xml file.

That's works perfectly on win xp, win 2003 but on vista that's failed !!!!
the custom action is fired in immediate execution for win xp or win 2003

for vista in immediate execution that failed and in deferred execution in system context that failed too !

if i do on deferred execution in system context :

MsgBox Session.Property("INSTALLDIR")


nothing appears ?!

how i can in vbscript have some property?!
have you some idea ?!

Thanks
Christophe
Labels (1)
0 Kudos
(8) Replies
Gaurav
Level 3

For XML update, it would be preferable to use the in built 'XML File Changes' option.

To get a property in VBS you have to just do this -
Dim MyVar
MyVar = Session.Property("INSTALLDIR")
MsgBox MyVar
0 Kudos
ChristopheOce
Level 7

Hi Gaurv,

Thanks for your quik reply but I CAN'T USE XML change view!

Here is it my vb code
[CODE]

sgBox("Lecture")
dim xml, objElem, v, path, valeurLanguage
Set xml = CreateObject("Msxml2.DOMDocument")

'Gets from the installer two property
path = Session.Property("INSTALLDIR")
valeurLanguage = Session.Property("VALUE_LANGUAGE")
MsgBox path & " "& valeurLanguage

'Load the file to modify
If xml.Load(path & "\\*****.config") Then
'MsgBox "Document XML correctement chargé"

'Load the node Language

Set objElem = xml.selectSingleNode("/configuration/******/add[5]")
v = objElem.getAttribute("value")
'Read the value of the attribute
'MsgBox v
'Change the value
objElem.Attributes(1).Text = valeurLanguage
'Save fichier
xml.save (path & "\\****.config")
Else
MsgBox "An error occured while reading xml file !"End If
[/CODE]

when i run the custom action (deferred execution in system context) and arrive here on VISTA 😞 :


MsgBox path & " "& valeurLanguage


noting is display in vista just the form vb but no VALUE !!!

Arrrgh and it'"s work with other computer !

Have you got an idea ?

Thanks
Christophe
0 Kudos
Gaurav
Level 3

Lets have a look at the sequence where we are calling this. We know that it works on other machines so the script should be alright. (seems to be good too 🙂 )
The CA should be used before 'File Transfer' and should be associated with an event; probably on clicking 'Install' at the 'Ready To Install' screen.

Lets see if this works.
0 Kudos
ChristopheOce
Level 7

I think installshield can't read property in deferred execution in system context !

i've just coded this

installscript :

//Gets the property INSTALLDIR

function ReadProperty(hMSI)

string szPath;
NUMBER cchValueBuff, nRetPath;

begin
cchValueBuff = 512;
nRetPath = MsiGetProperty(hMSI, "INSTALLDIR", szPath, cchValueBuff);

MessageBox("Path :" +szPath);

end;


if the custom action is on IMMEDIATE EXECUTION the value of proprety is displayed but NOT on deferred execution in system context !!!!

What i can do !?

Thanks for all
Christophe
0 Kudos
ChristopheOce
Level 7

Thanks for your time 🙂

But i can't associate this custom action as an events clicking 'Install' at the 'Ready To Install' screen BECAUSE the file is not present on the target computer !!!!

Arghhhh...

I think i m stop in my action because if i want to have property on vista i must to place my custom action in immediate execution but if in this custom action i run an exe with my parameters that WILL BE FAILED !!!!

i m boring really :-(!

Thanks if you have any idea
Christophe
0 Kudos
RobertDickau
Flexera Alumni

If you want to read a property during deferred mode, you'll need to go through the CustomActionData property; please see this newsletter tip for more information (PDF warning): http://www.macrovision.com/webdocuments/PDF/CustomActionData.pdf?link_id=productsTipsTricks.
0 Kudos
ChristopheOce
Level 7

Hi both,

I've just to doing a simple project test with a setProperty INSTALLDIR in a Property PATH for example and i arrive well to gets this property in other custom action in deferred execution in system context !

Now i'will be change in my project..

I hope all will be works in windows 2000, windows xp ...

If that's works i will send a reply:-)

In advance thanks
Christophe
0 Kudos
ChristopheOce
Level 7

Hi ,

that's works perfectly under all computer (win 2000, win xp, 2003, vista)

Great...

Many thanks at both...

See you later 🙂
Christophe
0 Kudos