Can't get package references registered to an instance of Visual Studio 17 and above from Pascal Script

馋奶兔 提交于 2019-12-04 19:09:50
Night walker

I managed to solve the problem thanks to the comment by Martin Prikryl (thank you once again).

The GetPackages() method is declared in the ISetupInstance2 interface, inherited from ISetupInstance. Consequently, methods from ISetupInstance had to be declared when declaring ISetupInstance2.

The declaration of the ISetupInstance2 interface in order to use the GetPackages() method has to look like this:

ISetupInstance2 = interface(IUnknown)
    '{89143C9A-05AF-49B0-B717-72E218A2185C}'
    { Inherited methods from ISetupInstance }
    function GetInstanceId(out id: WideString): HResult;
    procedure Dummy2;
    function GetInstallationName(out installationName: WideString): HResult;
    function GetInstallationPath(out installationName: WideString): HResult;
    function GetInstallationVersion(out installationVersion: WideString): HResult;
    function GetDisplayName(lcid: Integer; out displayName: WideString): HResult;
    function GetDescription(lcid: Integer; out description: WideString): HResult;
    function ResolvePath(pwszRelativePath: WideString; out result: WideString): HResult;
    { Own methods of ISetupInstance2 }
    procedure Dummy3;
    function GetPackages(out pack: packageReference): HResult;
    procedure Dummy4;
    procedure Dummy5;
    procedure Dummy6;
    procedure Dummy7;
    procedure Dummy8;
    procedure Dummy9;
    procedure Dummy10;
  end;

Maybe this will help someone in solving similar problems.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!