Page 1 of 1

Plug-In Dev Help: Error during build

Posted: Mon Jan 15, 2007 3:57 pm
by mbuckaway
(if this belongs in the Plug-In Dev forum, my appologies)

I am developing my own plug-in to kill off an application. The current TerminateProgram functionality does not work in my situation. I have used the sample Eval plug-in code to develop the plug-in. The DesignTime DLL works. I can use the about box, add/edit my script code, but I cannot build the project. The documentation is rather vague. I am using the AutoRun project to test it to keep things simple. A compile yields the following:

Built plug-in action Process Id
Created Windows Installer database
Built installation executable
Injected setup languages
Error during build: Unable to find support file , use the Project Manager window to update or remove the reference

I know it is my plugin because if I comment it out, the build works.

I have implemented a Copyfile routine to copy my runtime dll to the build directory - although, it does not appear to be necessary for Eval plug-in (and whether I commend my copy routine out or not, it still fails). There is something quite strange: any other plug-in copies itself to the project folder AND the build folder. My plug is only copied to the build folder. If I add the EXE dll to the project folder it still will not build.

I am missing something simple. Anyone that has Plug-in experience off any assistance?

Thanks,
Mark

Posted: Mon Jan 15, 2007 4:02 pm
by MichaelNesmith
Want to post your build code - I'll see what I can find out!

Posted: Mon Jan 15, 2007 4:40 pm
by Tinus
You can check a few items in CompileTimeBuild and Registry

- Registry: Is "Execute"="your EXEPlug.dll"?
- Does CompileTimeBuild returns true?
- Do you modify any parameters?

I use Delphi and my CompileTimeBuild looks like this;

Code: Select all

function CompileTimeBuild(MSIHandle: THandle; State, BuildPath: PChar; Build: Boolean;
  var Fetch: Boolean): Boolean; stdcall; export;
begin
  Result := True; // compile time build successful
  if Build then
  begin
    // copy runtime DLL
    CopyFile(PChar(ModuleFolder + 'FirewallEXEPlugIn.dll'),
      PChar(BuildPath + 'FirewallEXEPlugIn.dll'), false);
  end;
end;


And finally you can run InstallAware as host application from your compiler to debug your DLL code.

Posted: Tue Jan 16, 2007 11:26 am
by mbuckaway
Tinus wrote:You can check a few items in CompileTimeBuild and Registry

- Registry: Is "Execute"="your EXEPlug.dll"?


Hmm. Checked. I exported the reg file. The contents are below:

Code: Select all

[HKEY_LOCAL_MACHINE\\SOFTWARE\\MimarSinan\\InstallAware\\2.0\\Plug-Ins\\GetProcessID]
@="C:\\\\src\\\\lgplugins\\\\GetProcessId\\\\debug\\\\lgIDEProcessId.dll"
"Action"="Process Id"
"Execute"="lgEXEProcessId.dll"
"Script"="Get Process Id"


...hmmm.....

Found the problem.

Action in the registry entry and the NAME of the registry entry must be the same.

The registry entry above is not correct, but the registry entry below is:

Code: Select all

[HKEY_LOCAL_MACHINE\\SOFTWARE\\MimarSinan\\InstallAware\\2.0\\Plug-Ins\\Process Id]
@="C:\\\\src\\\\lgplugins\\\\GetProcessId\\\\debug\\\\lgIDEProcessId.dll"
"Action"="Process Id"
"Execute"="lgEXEProcessId.dll"
"Script"="Get Process Id"


I changed the registry to the above entry and it now compiles and builds correctly.

Thanks for the pointers. I knew is was something simple and stupid.

Mark