Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MsiGetProperty(); Retruns a blank value Posted by codeforfun on 11 Dec 2011 at 12:08 PM
I am trying to read the Installation directory from a Visual Studio Installer from a C++ DLL.

So i created a VS Installer and a Custom Action that calls a C++ DLL. The DLL does get called but the but the MsiGetProperty(); always returns no value.

I am really stuck for ideas here. I have been trying to get this to work for 2days and failed to figure out the correct way of doing this.

I need some help, can anyone point me in the right direction.


My end goal here is to get hold of the install directory selected by the user so I can create a scheduled task on the command line. That will run the program once a week.


Here the class in question: http://codepad.org/G0lWvlPJ


Thanks for any help or ideas guys, i really am so stuck. I just don’t know where to turn to next

IWantMoreCakes
Report
Re: MsiGetProperty(); Retruns a blank value Posted by codeforfun on 11 Dec 2011 at 12:24 PM
I am sure it has something to do MsiGetProperty(hInstall, TEXT("targ"), TEXT(""), &cchValueBuf);

When i call "MsiGetProperty(hInstall, TEXT("targ"), TEXT(""), &cchValueBuf);" i get a return value of "ERROR_MORE_DATA"

So i called MsiGetProperty(hInstall, TEXT("targ"), szValueBuf, &cchValueBuf); But this time i set the size of the szValueBuf buffer to the returned value in cchValueBuf. But this value is a 0. The function did return ERROR_SUCCESS this time though.

Does that mean its not finding the "Custom Action Data" i set in the "Custom Action Editor", the value i set is:
/targ=[TARGETDIR]\

I am using C++ Visual Studio 2010

Also a point worth noting i set "InstallerClass=False" because the application would not compile. Would this effect the Custom Action Data being send/received

Has anyone else managed to achieve a CustomActionData with C++ and the VS Installer.






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.