Generate Guid Plug-In with source

Interested in developing new plug-ins? Got one to share? Post here!
vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Generate Guid Plug-In with source

Postby vkumar » Mon Feb 04, 2008 4:50 pm

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.

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Unable to post source files

Postby vkumar » Mon Feb 04, 2008 4:55 pm

Is there a limit on file size? Or posting files is prohibited?

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Mon Feb 04, 2008 5:56 pm

The upload didn't work for you? Please email us the file and we'll post it!
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Trying to upload source file again

Postby vkumar » Mon May 05, 2008 8:26 pm

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

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Thu Jun 19, 2008 8:56 am

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.

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Please provide the specific error message

Postby vkumar » Thu Jun 19, 2008 12:32 pm

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

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Thu Jun 19, 2008 12:43 pm

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.

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Updated file

Postby vkumar » Thu Jun 19, 2008 1:06 pm

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

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Thu Jun 19, 2008 1:37 pm

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.

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Thu Jun 19, 2008 1:41 pm

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.

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

ADVAPI32

Postby vkumar » Thu Jun 19, 2008 2:22 pm

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

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

One more thing

Postby vkumar » Thu Jun 19, 2008 2:26 pm

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

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Fri Jun 20, 2008 8:06 am

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.

andyhore
Posts: 20
Joined: Fri Jun 06, 2008 2:10 pm

Postby andyhore » Fri Jun 20, 2008 8:07 am

Of course, if you preview your message, it loses the attachment :evil:

Andy.

File Attached:

Plug-Ins.zip

vkumar
Posts: 8
Joined: Mon Feb 04, 2008 4:08 pm

Thank you

Postby vkumar » Fri Jun 20, 2008 12:32 pm

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


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 2 guests