Classification: Public 

Why use C++ use C# :)

Here is an example: 
http://stackoverflow.com/questions/7222782/how-to-get-the-drive-letter-from-a-full-name-of-the-drive

Here are two functions I use to GET or SET a windows installer property in C#

/// <summary>
        /// Sets a windows installer property
        /// </summary>
        /// <param name="session">Session session</param>
        /// <param name="propertyName">MSI property</param>
        /// <param name="value">string to populate</param>
        private static void SetSessionProperty(Session session, string 
propertyName, string value)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                session[propertyName] = value;
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Exception when executing 
SetSessionProperty.", ex, true);
            }
        }

        /// <summary>
        /// Gets a windows installer property
        /// </summary>
        /// <param name="session">Session session</param>
        /// <param name="propertyName">MSI property</param>
        /// <param name="isCustomActionData">true or false</param>
        /// <returns>returns the windows installer property as a 
string</returns>
        private static string GetSessionProperty(Session session, string 
propertyName, bool isCustomActionData)
        {
            string sessionProperty = string.Empty;

            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                sessionProperty = isCustomActionData ? 
session.CustomActionData[propertyName] : session[propertyName];
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Exception when executing 
GetSessionProperty.", ex, true);
            }

            return sessionProperty;
        }


-----Original Message-----
From: chintala srinivas [mailto:chentala.srini...@gmail.com]
Sent: March-05-13 10:23 AM
To: WiX-users@lists.sourceforge.net
Subject: [WiX-users] C++ custom actions

Hi,

I am very new to th C++ customaction.
Can any one help me on how to write C++ custom action for finding disk(D:\) is 
avilable or not. If not then assign c:\ to the property.

Regards,
Srinivas.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics Download AppDynamics Lite for free 
today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



This message has been marked as Public by Steven Ogilvie.

The above classification labels were added to the message by TITUS Message 
Classification.
Visit www.titus.com for more information.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to