This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: session.property + deferred execution in system context !
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
07:38 AM
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 :
nothing appears ?!
how i can in vbscript have some property?!
have you some idea ?!
Thanks
Christophe
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
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
07:41 AM
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
To get a property in VBS you have to just do this -
Dim MyVar
MyVar = Session.Property("INSTALLDIR")
MsgBox MyVar
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
07:50 AM
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 😞 :
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
08:19 AM
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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
08:23 AM
I think installshield can't read property in deferred execution in system context !
i've just coded this
installscript :
//Gets the property INSTALLDIR
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
08:28 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2007
08:38 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2007
02:28 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2007
09:20 AM
Hi ,
that's works perfectly under all computer (win 2000, win xp, 2003, vista)
Great...
Many thanks at both...
See you later 🙂
Christophe
that's works perfectly under all computer (win 2000, win xp, 2003, vista)
Great...
Many thanks at both...
See you later 🙂
Christophe
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)