title: C# application and assembly hell!
body: <p>I have created a C# project on my home computer with Windows 7, VS 2008 and using .net framework 2.0. My app is using "Irklang" sound library. Using InnoSetup 5 i have created setup for my app. Setup includes all needed files, it installs them well but when i install my app on some other computer i got some confusing errors. First one looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/hcQxW.jpg" alt="enter image description here"></p>
  
  <p>When i create install script flaging "irklang.dll" with "regserver" (to be registered during setup), i got this error during installation of my program: "Unable to register DLL/OCX: RegSrv32 failed with exit code 0x4". Message got standard "Abort, Ignore, Retry" buttons, but, as always, "Retry" won't fix it.</p>
  
  <p>What should i do? How to fix this error which shouldn't even bother average programmer?</p>
  
  <p>This is my Inno setup instalation file:</p>
  
  <pre><code>; Script generated by the Inno Setup Script Wizard.
  ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  [CustomMessages]
  dotnetmissing=This setup requires the .NET Framework v2.0. Please download and install the .NET Framework v.2 and run this setup again. Do you want to download the framework now?
  
  [Setup]
  ; NOTE: The value of AppId uniquely identifies this application.
  ; Do not use the same AppId value in installers for other applications.
  ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  AppId={{10087152-8A1D-4C0B-9BFC-E463C2F8E3C0}
  AppName=Kucni rad
  AppVersion=1.5
  ;AppVerName=Kucni rad 1.5
  DefaultDirName={pf}\Kucni rad
  DefaultGroupName=Kucni rad
  OutputDir=C:\Users\Boza\Desktop
  OutputBaseFilename=setup
  Compression=lzma
  SolidCompression=yes
  
  
  
  [Languages]
  Name: "english"; MessagesFile: "compiler:Default.isl"
  
  [Tasks]
  Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
  
  [Code]
  function InitializeSetup(): Boolean;
  var
      ErrorCode: Integer;
      NetFrameWorkInstalled : Boolean;
      Result1 : Boolean;
  begin
  
      NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
      if NetFrameWorkInstalled =true then
      begin
          Result := true;
      end;
  
      if NetFrameWorkInstalled = false then
      begin
          NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
          if NetFrameWorkInstalled =true then
          begin
              Result := true;
          end;
  
          if NetFrameWorkInstalled =false then
              begin
                  //Result1 := (ExpandConstant('{cm:dotnetmissing}'), mbConfirmation, MB_YESNO) = idYes;
                  Result1 := MsgBox(ExpandConstant('{cm:dotnetmissing}'),
                          mbConfirmation, MB_YESNO) = idYes;
                  if Result1 =false then
                  begin
                      Result:=false;
                  end
                  else
                  begin
                      Result:=false;
                      ShellExec('open',
                      'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe',
                      '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
                  end;
              end;
      end;
  end;
  
  
  [Dirs]
  Name: "{app}\Sounds"
  
  [Files]
  Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\kucnirad.exe"; DestDir: "{app}"; Flags: ignoreversion
  Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\Sounds\*"; DestDir: "{app}\Sounds"; Flags: ignoreversion recursesubdirs createallsubdirs
  Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\ikpMP3.dll"; DestDir: "{app}"; Flags: ignoreversion regserver
  Source: "C:\Users\Boza\Desktop\Novi kucnirad\kucnirad\bin\Debug\irrKlang.NET2.0.dll"; DestDir: "{app}"; Flags: ignoreversion regserver
  
  ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  
  [Icons]
  Name: "{group}\Kucni rad"; Filename: "{app}\kucnirad.exe"
  Name: "{group}\{cm:UninstallProgram,Kucni rad}"; Filename: "{uninstallexe}"
  Name: "{commondesktop}\Kucni rad"; Filename: "{app}\kucnirad.exe"; Tasks: desktopicon
  
  [Run]
  Filename: "{app}\kucnirad.exe"; Description: "{cm:LaunchProgram,Kucni rad}"; Flags: nowait postinstall skipifsilent
  </code></pre>
  
  <p>EDIT:
  I GOT IT! IT'S NOT PROBLEM WITH MY APP, IT'S PROBLEM WITH DOWNLOADED DLL ITSELF! It seems that IrrKlang.dll version 1.3 (the newest version, i used) is causeing the problems! Version 1.1 is working just fine!</p>