Well, I'll try to help but as I say, I was given these files as part of an
old installer.

Looking at the first line that accesses the Session object I can see;
targetDirPath = "" + Session.Property("CustomActionData")

This is for a deferred custom action, if yours is deferred too then you'll
only be able to see CustomActionData.

Below is a response to someone else on this list that might give you some
more info;
--- 
My understanding is that deferred custom actions cannot read the normal MSI
properties and can only access data through the CustomActionData property.
This is because they are run outside the scope of the UI in a separate
transaction, after the UI has been completed.

You may be on to something but I don't 'think' those functions will help
you. You'll have to write a delimited string into CustomActionData.

To set that property, do the following from your WXS (an extract from my
code);
    <!-- Populate a property with the same name as the custom action, this
gets passed to that action DLL call as CustomActionData -->
    <CustomAction Id="CA_SetCleanLocalAppData" Property="CleanLocalAppData"
Value="[LocalAppRootDirectory]" />
    <!-- Pass the current users data path to the NukeFolder action to clean
the directory on uninstall.  -->
    <CustomAction Id="CleanLocalAppData" BinaryKey="InstallHelper"
DllEntry="NukeFolder" Execute="deferred" /> Note that the property of the
first CA is the same name as the second CA. This is how you set
CustomActionData, you set a property with the same name as the CA you are
calling. In the above example it passed the directory to delete to the
custom action.

The Custom action C++ code looks like;

__declspec(dllexport) UINT __stdcall NukeFolder(MSIHANDLE hModule) {
        TCHAR szDirectoryToDelete[MAX_PATH];
        DWORD dwlen = MAX_PATH;

        UINT ur = MsiGetProperty(hModule, TEXT("CustomActionData"),
szDirectoryToDelete, &dwlen);

        // TODO: Handle error return.
        DeleteDirectory(szDirectoryToDelete);

        return ERROR_SUCCESS;
}
 
I hope that helps in some way.

Ryan


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Yuval David
Sent: 17 June 2008 12:21
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Session object

Thank you for the warning.
I understand from your mail that you had already used this session
object in your project.
So maybe you can tell me: is this file created automatically after
compilation?, I mean: is it included in the msi file?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ryan
O'Neill
Sent: Tuesday, June 17, 2008 14:13
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Session object

I don't know why it would do that, but I'll just give you a warning
based on
my current experience of VB Script custom actions. Avoid them if you
can.

A lot of people have said not to use them (I inherited these ones) as
they
get blocked by anti-virus and are difficult to debug. We released
yesterday
and I'm just starting to get reports of what looks like over-zealous
anti-virus blocking the scripts.

Of course you might be running in a known environment in which case you
can
use what you like.

Regards

Ryan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
yuval_david
Sent: 17 June 2008 11:59
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Session object


hi,
Im trying to write an installer in wix and which executes a vbs file
using a
custom action.
But I have a problem: It seems as the installer doesn't construct a
Session
object and therefor
I can't write in the vbs file the command
Session.Property("INSTALLDIR").

Does somebody know why the installer did not create a session object?


-- 
View this message in context:
http://www.nabble.com/Session-object-tp17880754p17880754.html
Sent from the wix-users mailing list archive at Nabble.com.


------------------------------------------------------------------------
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.3.0/1505 - Release Date:
16/06/2008
07:20


------------------------------------------------------------------------
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.3.0/1505 - Release Date: 16/06/2008
07:20


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to