How do I?

For all your non-technical questions.
Flamelord2

How do I?

Postby Flamelord2 » Fri Jan 21, 2005 2:26 am

I am evaluating your product and part of what I need to be able to do is call several .Net Installer classes and raise the appropriate events. I have searched the net and found the best way is to use InstallUtil.Dll. I need to find the path to it so I was trying to call GetCORSystemDirectory, but the resulting path does not appear to be correct. It looks like this is because it is a unicode path and InstallAware is using an ANSI string so I just get the first character. Is there another way to do this or can this be fixed in InstallAware?

sinan
Site Admin
Posts: 970
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Fri Jan 21, 2005 5:17 am

The Call DLL Function mechanism currently supports ANSI strings only.

I recommend authoring a custom DLL. You can have the DLL do all the unicode work for you and call it from InstallAware.

You could author the DLL as a plug-in if you need full access to the state of installation variables, or just make it a regular DLL with function exports that you tap into using the Call DLL Function mechanism.

Hope this helps,
Sinan

Flamelord2

Building a plugin...

Postby Flamelord2 » Sun Jan 23, 2005 6:34 pm

I decided to try to build a plugin as you stated and I have got it working except when I test the script using it. I get an error about loading the DLL so it skips the action. I did figure out that I had to copy the runtime DLL to the BuildPath so that isn't the problem. I thought that it wasn't working because I wasn't using an 8.3 filename so I changed it to that but it didn't fix it. I also thought that it may have to do with the Managed C++ extensions, so I removed them as well. I now have a standard DLL that is written in VC7.1 that exports DllMain and the Excute function which does nothing except return 0, but it still doesn't work correctly. What am I missing and/or doing wrong?

BTW, I am posting here because I never got the registration email when I tried to sign up. This topic really belongs in Plugin or Tech. support.

<FL />

sinan
Site Admin
Posts: 970
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Mon Jan 24, 2005 12:09 am

Did you try running both inside and outside the IDE? If one fails, try the other...it might provide more clues into why the load fails.

Feel free to send me your plugin sources and registry entries, along with a sample project that calls it. I'll take a look at it.

Flamelord2

Postby Flamelord2 » Tue Jan 25, 2005 10:39 pm

I will send you the code tomorrow, but one thing I wanted to ask that may be useful for developers creating plugins is what exactly does that error message mean? Does it mean that a call to LoadLibrary failed? Does it mean that the DLL doesn't have the correct exports? An exception was thrown from the DLL? Something else? It would be very helpful to have some information such as this to help track down the issue.

<FL />

Flamelord2

Forgot

Postby Flamelord2 » Tue Jan 25, 2005 10:41 pm

I forgot to tell you that I did try inside and outide the IDE.

<FL />

Flamelord2

Another thought

Postby Flamelord2 » Wed Jan 26, 2005 1:29 am

Along the same lines, it would be great to have a sample/template or two that are available so that people are able to create new plugins relatively quickly.

<FL />

sinan
Site Admin
Posts: 970
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Jan 26, 2005 2:51 am

If this is the exact error you received:

Code: Select all

'Unable to load plug-in library. Please rebuild your project and make sure all required plug-ins are installed.'

It means that the setup program failed to locate your plugin DLL where it expects it to be. It does not mean that LoadLibrary failed - but it probably would have failed if you were using any managed extensions, since the DLL it loads is expected to be self-contained. No effort wasted there :wink:

I've had another instance of this problem reported before...and it was caused by registry entries which confused the plugin loader. If you can post the contents of your .reg file here, I'd be able to help more.

sinan
Site Admin
Posts: 970
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Jan 26, 2005 2:58 am

About your other question...sorry I forgot that one :)

There are two plugin templates available. One is for Delphi and contains a fully implemented plugin with a sample action to perform. Another is for Visual C++ and contains correct declarations for the expected library exports, but the functions are skeletal and not fleshed out. These two samples are accessible using the File->New->Other menu, Plug-Ins tab. You could try creating a new VC plugin just to see the kind of .reg file it creates - you could then update your registry entries accordingly and check if that helps (feel free to send me your .reg also).

Of course, if you would like to contribute any empty/partially fleshed out samples, I'd be glad to add them to the upcoming version of the product.

Flamelord2

Postby Flamelord2 » Wed Jan 26, 2005 6:28 pm

I am going try the VC template before I bug you any more. The registry entries look very similar to mine... I'll let you know what I find out.

<FL />

Flamelord2

Postby Flamelord2 » Thu Jan 27, 2005 12:58 am

Here is the .reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\\SOFTWARE\\MimarSinan\\InstallAware\\2.0\\Plug-Ins\\Test InstallAware Plugin]
"Action"="Test Plugin"
"Execute"="TestRun.dll"
"Script"="Dummy script action"
@="C:\\\\Code\\\\TestInstallAwarePlugIn\\\\TestInstallAwarePlugIn.dll"

Both DLLs are in that folder. When I compile, TestRun.DLL ends up in the "data\\TestInstallAwarePlugIn.dll\" folder under the compiled installer. I copy it there during the compile.

<FL />

Flamelord2

Postby Flamelord2 » Thu Jan 27, 2005 1:21 am

I think I figured out why my DLL wasn't being located. I changed the design-time dll to a short filename and it worked. It would probably be nice if InstallAware could support long filenames in this area. Now I am on the way to getting this done. Thanks.

<FL />

sinan
Site Admin
Posts: 970
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Thu Jan 27, 2005 3:53 am

Glad to hear it got resolved :D IA does support long file names in plugin DLLs though...so I tend to think there was something else in the naming which confused the system. Are the registry entries you provided below for the working version or the broken version?

Flamelord2

Postby Flamelord2 » Thu Jan 27, 2005 10:03 am

The reg entries are from the non-working one.

<FL />


Return to “Non-Technical”

Who is online

Users browsing this forum: No registered users and 4 guests