An MSI will have lots of different GUID's associated with it such as: Product Code, Upgrade Code, Package Code, Component GUIDs etc.
Each one of these will be stored in a Windows Property - I'm not sure how (or why) you want to detect the GUID whilst the installer is running however you will be able to access them by calling the relevant property that stores the GUID you want.
For example the Proct Code GUID is stored in the property PRODUCTCODE:
hope this helps...
I was looking particular GUID as during uninstall i want to check if the running process is associated with particular version of application. As i can have multiple version of same application with different GUID.
I used different approach in place of GUID.
Thanks for quick reply .
The following VB script returns all MSI Product Names along with their ProductCodes - you could modify it yourself to achieve what you need - and then have your application run it when it starts for the first time: