Can I register with the GAC using Pascal scripts (InnoSetup)?

I am using InnoSetup to install the application that I created. My client asks him to download the latest DLL files during installation with this InnoSetup add-on:

http://www.sherlocksoftware.org/page.php?id=50

Simple enough. I got it working the way I want, but without the [Files] section (because downloading it, and not creating them in a script), I'm not sure how to register downloaded DLLs to the GAC. In the [Files] section, I used the gacinstall flag.

Now that I no longer use [Files] , I was wondering if there is a way to install DLLs on the GAC through Pascal scripts?

Here is the relevant part of my script installation:

[Code]
procedure InitializeWizard();
begin
 itd_init;

 itd_addfile('{#DownloadLocation}/mylibrary1.dll',expandconstant('{tmp}\mylibrary1.dll'));
 itd_addfile('{#DownloadLocation}/mylibrary2.dll',expandconstant('{tmp}\mylibrary1.dll'));

 itd_downloadafter(wpReady);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
 if CurStep=ssInstall then begin //Lets install those files that were downloaded for us     
  filecopy(expandconstant('{tmp}\mylibrary1.dll'),expandconstant('{app}\mylibrary1.dll'),false);
  filecopy(expandconstant('{tmp}\mylibrary2.dll'),expandconstant('{app}\mylibrary2.dll'),false);
 end;
end;


[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters: "-i"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: runhidden  
Filename: "{app}\{#MyAppSvcName}"; Parameters: "-i"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: runhidden
Filename: "{app}\{#MyAppExeName}"; Description: "Launch the ItraceIT configuration tool"; Flags: postinstall nowait skipifsilent

[UninstallRun]
Filename: "{app}\{#MyAppSvcName}"; Parameters: "-u"; Flags: runhidden
Filename: "{app}\{#MyAppExeName}"; Parameters: "-u"; Flags: runhidden  

.

+3
2

[Files] external, , [Files], gacinstall.

[Files]
Source:{tmp}\mylibrary1.dll; DestDir:{app}; StrongAssemblyName: "MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abcdef123456, ProcessorArchitecture=MSIL" Flags: external; gacinstall;

CurStepChanged, [Files] .

Pascal API GAC.

, , .

- , API, , Exec ShellExec.

Delphi Code (CVS log) DLL , InnoSetup .

+2

.NET-, GAC, :

System.EnterpriseServices.Internal.Publish.GacInstall(string path)

System.EnterpriseServices.

0

All Articles