Page 1 of 2

Generate Guid Plug-In with source

Posted: Mon Feb 04, 2008 4:50 pm
by vkumar
Recently we had to generate a guid from InstallAware script. We could not find any inbuilt command that could provide this functionality. Hence we wrote a plug-in to achieve this functionality. I am posting this code as a reference for future plug-in developers. Hope this saves some time for you.

P.S. Use the code at your own risk. Although enough testing was put in, we do not guarantee the functionality. Review the C++ code, code make sure it does what you want and compile on your own environment to make sure that the result meets your expectations.

Unable to post source files

Posted: Mon Feb 04, 2008 4:55 pm
by vkumar
Is there a limit on file size? Or posting files is prohibited?

Posted: Mon Feb 04, 2008 5:56 pm
by CandiceJones
The upload didn't work for you? Please email us the file and we'll post it!

Trying to upload source file again

Posted: Mon May 05, 2008 8:26 pm
by vkumar
This is my second attempt at uploading the source file. Initial email to InstallAware team did not end up along with this post.

File Attached:

GenerateGuid.zip

Posted: Thu Jun 19, 2008 8:56 am
by andyhore
Hi,

I'm keen to see the source to give me a head-start on creating my own plug in, however, the zip files seems to have several of the projects missing:(

Also, I tried to get the install to work without the run time DLL, but I just get an exception when it first runs :oops:

Any chance you could post the full source?

Thanks,
Andy.

Please provide the specific error message

Posted: Thu Jun 19, 2008 12:32 pm
by vkumar
Hello Andy,

I believe I have posted the entire source. Could you please be more specific as to what is missing - or the error message you get while opening the project in Visual Studio?

Thanks
-Vimal

Posted: Thu Jun 19, 2008 12:43 pm
by andyhore
Hi Vimal,

Thanks for the quick reply. When I load up the GenerateGuid\\VC.sln file it expects the following projects that are not there:

..\\GenerateGuidRuntimePlugIn\\GenerateGuidRuntimePlugIn.vcproj
..\\DetectDMSInstallIDEPlugIn\\DetectDMSInstallIDEPlugIn.vcproj
..\\DetectDMSInstallRuntimePlugIn\\DetectDMSInstallRuntimePlugIn.vcproj

I guess the first one is the one I'm interested in most, but I'm not sure! I presume you used VS2005 to create these? Also, what version of InstallAware are you using - 6.5? Have you tries the Plug-in with the latest (7 R2)?

Thanks for the help,
Andy.

Updated file

Posted: Thu Jun 19, 2008 1:06 pm
by vkumar
Hi Andy,

Thanks for the specific messages. I realized that I had uploaded a solution file that included projects that were not supposed to be uploaded. I am trying to upload an updated ZIP file. Hope this works for you.

Regarding your question on version - I have tested the plug-in using ver 6.5. I have not tried this with version 7 R2. I am hoping that InstallAware will maintain backward compatibility for their plug-ins.

Let me know if this works for you.

-Vimal

File Attached:

GenerateGuid.zip

Posted: Thu Jun 19, 2008 1:37 pm
by andyhore
Hi Vimal,

OK, downloaded it and tried to build the solution - it works, after I created the folder C:\\Program Files\\InstallAware\\InstallAware 6.5\\Plug-Ins\\Generate Guid by hand.

I then loaded up the InstallAware project and had to removed the references to the Delete* files (and their registry settings). That then builds and the setup appears to work.

So, moment of truth, I star a clean InstallAware project and go to the MSICode tab, and drag the Generate Guid plug in and drop it...and I get the following error message:

The procedure entry point RegGetValueA could not be located in the dynamic link library ADVAPI32.dll.

Any thoughts? We're real close, I think!

Thanks,
Andy.

Posted: Thu Jun 19, 2008 1:41 pm
by andyhore
Hi Vimal,

Just a thought, your code is using MFC...I thought the plug-ins had to be pure win32 - could that be the problem?

Andy.

ADVAPI32

Posted: Thu Jun 19, 2008 2:22 pm
by vkumar
My code uses MFC and I don't think that should cause any trouble. MFC is statically linked into the DLL so we don't place any runtime library requirements. However, I am not sure as to why RegGetValueA should not work for you. These are standard Windows API calls. Our installer uses this plug-in and we have our product shipped to over 3000 users. I have not recieved any issues regarding the ADVAPI32 dll missing a method call. Could you tell me the version number of ADVAPI32.dll in your Windows\\System32 folder. Also which OS are you running InstallAware IDE?

Also, try this:
1. Open Visual Studio 2005 Command Prompt from Visual Studio 2005 Tools.
2. Run DUMPBIN /EXPORTS C:\\Windows\\System32\\Advapi32.dll
3. Let me know if RegGetValueA is exported from that DLL. If it is, then the problem must lie somewhere else - the error message must be misleading...

This is what I see on my Vista Business machine...

591 24E 0001C726 RegGetKeySecurity
>>> 592 24F 0001A419 RegGetValueA <<<<
593 250 0002C077 RegGetValueW

One more thing

Posted: Thu Jun 19, 2008 2:26 pm
by vkumar
Andy,

Please check your registry entry to see if the following key exists and has a value in it:

HKLM\\Software\\MimarSinan\\InstallAware\\2.0\\Plug-Ins\\Generate Guid\\Execute

The value should be "GenerateGuidRuntimePlugIn.dll"

-Vimal

Posted: Fri Jun 20, 2008 8:06 am
by andyhore
Hi Vimal,

Thanks for the help, I've got it working! I had to re-write the registry stuff, but other than that the code does work. Now, attached is my final updated version of everything you did. I just cleaned it up a little in that it now should be easy to get to work for anybody just following these steps:

1) Unzip the file to c:\\Program Files\\InstallAware (it will create everyhting under Plug-Ins....)
2) Using VS 2005, open the VC.sln file in GenerateGuid
3) Compile everything.
4) Open NowcomInstallAwarePlugInSetup.mpr in GenerateGuidPlugInSetup
5) Build that and then run the created installer. It installs the plug-in to c:\\Program Files\\InstallAware\\NOWCOM InstallAware PlugIns.
6) Open GuidGenTest.mpr in GUIDGenTest for a (very!) simple example.

I hope you don't mind, but I wanted to get something that everyone could use and to help avoid the frustration that I'd been going through! Thanks for all you help and the code :D

Andy.

Posted: Fri Jun 20, 2008 8:07 am
by andyhore
Of course, if you preview your message, it loses the attachment :evil:

Andy.

File Attached:

Plug-Ins.zip

Thank you

Posted: Fri Jun 20, 2008 12:32 pm
by vkumar
Thanks Andy for posting back the updated version. I'll check the changes to find out why the RegGetValue API call did not work and how you got around fixing it.

-Vimal