Jump to content

Mark-

Members
  • Content Count

    328
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mark-

  1. Mark-

    Microsoft Trusted Signing service

    Yeah that is what I thought but, no links lead to it. Most links lead to documentation. The one link that gets you to: Selecting Multifactor authentication takes you to: "Get Free Premium Trial": Confused. That was might first thought. So I checked it out and it is legit.
  2. Mark-

    Microsoft Trusted Signing service

    Just a follow up and a new question. The time can be a couple of seconds or 191 seconds. When the automated build runs it signs about 20 files. All 20 are 2-4 seconds or all are 191 seconds. Go figure. On another note, I received an email "Action required: Enable multifactor authentication for your tenant by 15 October 2024" We are paying a monthly fee for the code signing service and everywhere I searched the system wants me to sign up for some other "premium" service. I have not found a location to active MFA for the code signing service. Any ideas?
  3. I stuck with those versions for years. And sticking with 10.2 for now.
  4. Mark-

    Microsoft Trusted Signing service

    Thanks. Yeah, time of day might have a big impact.
  5. Mark-

    Microsoft Trusted Signing service

    Indeed. What is the normal time needed for a successful signing? > 1 minute ? more?
  6. Mark-

    Microsoft Trusted Signing service

    > Have you set the environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET? Yes. I do not have the last one "App". Went back over the step #5 instruction (https://melatonin.dev/blog/code-signing-on-windows-with-azure-trusted-signing/#step-4-create-an-app-registration) and now have a "Trusted Signing Certificate Profile Signer" with "App" as the type. And drum roll. Submitting digest for signing... OperationId xxxx: InProgress Signing completed with status 'Succeeded' in 192.2221622s Successfully signed: C:\apptest.exe Number of files successfully Signed: 1 Number of warnings: 0 Number of errors: 0 Thank you very much Fred Ahrens. Thank you Sudara for your blog post.
  7. Mark-

    Microsoft Trusted Signing service

    I changed them for the post. The actual ones are correct, as far as I know. The "CodeSigningAccountName" from here: "CertificateProfileName" from here:
  8. Mark-

    Microsoft Trusted Signing service

    Thank you. I recreated the client secret and the error changed. 🙂 Not sure what it means. Perhaps Azure is having a problem at the moment? Trusted Signing Version: 1.0.59 "Metadata": { "Endpoint": "https://eus.codesigning.azure.net/", "CodeSigningAccountName": "NameZ", "CertificateProfileName": "ProfileZ", "ExcludeCredentials": [] } Submitting digest for signing... Unhandled managed exception Azure.RequestFailedException: Service request failed. Status: 403 (Forbidden) Headers: Date: Fri, 31 May 2024 12:15:50 GMT Connection: keep-alive Strict-Transport-Security: REDACTED x-azure-ref: REDACTED X-Cache: REDACTED Content-Length: 0 at Azure.CodeSigning.CertificateProfileRestClient.SignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.CertificateProfileClient.StartSignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.SignAsync(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.Sign(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle) at AuthenticodeDigestSignExWithFileHandleManaged(_CRYPTOAPI_BLOB* pMetadataBlob, UInt32 digestAlgId, Byte* pbToBeSignedDigest, UInt32 cbToBeSignedDigest, Void* hFile, _CRYPTOAPI_BLOB* pSignedDigest, _CERT_CONTEXT** ppSignerCert, Void* hCertChainStore) SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign() failed." (-2147467259/0x80004005)
  9. Mark-

    Microsoft Trusted Signing service

    Thanks for the response. I added the "ExcludeCredentials" after it did not work when I read on SO someone say adding them worked from them. Yes, I am using a batch file. Where I am getting the "CodeSigningAccountName" is the correct location? I removed the "ExcludeCredentials" from the json file and ran it again. Took awhile to complete. The results are much different, same error code: SignerSign() failed." (-2147467259/0x80004005) I see this: "Original exception: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID,..." Sticks out. I know the secret is correct and it appears it can not be changed in Azure. I assume I will need to generate another cert? Or look for...?
  10. Mark-

    Microsoft Trusted Signing service

    OK, got it to at least try and sign the exe. Still not sure about " CodeSigningAccountName" Trusted Signing Version: 1.0.59 "Metadata": { "Endpoint": "https://eus.codesigning.azure.net/", "CodeSigningAccountName": "TheName", "CertificateProfileName": "TheCert", "ExcludeCredentials": [ "ManagedIdentityCredential", "EnvironmentCredential", "WorkloadIdentityCredential", "SharedTokenCacheCredential", "VisualStudioCredential", "VisualStudioCodeCredential", "AzurePowerShellCredential", "AzureDeveloperCliCredential", "InteractiveBrowserCredential" ] } Submitting digest for signing... Unhandled managed exception Azure.Identity.CredentialUnavailableException: Azure CLI not installed at Azure.Identity.DefaultAzureCredential.GetTokenFromSourcesAsync(TokenCredential[] sources, TokenRequestContext requestContext, Boolean async, CancellationToken cancellationToken) at Azure.Identity.DefaultAzureCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken) at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex, String additionalMessage, Boolean isCredentialUnavailable) at Azure.Identity.DefaultAzureCredential.GetTokenImplAsync(Boolean async, TokenRequestContext requestContext, CancellationToken cancellationToken) at Azure.Identity.DefaultAzureCredential.GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.AccessTokenCache.GetHeaderValueFromCredentialAsync(TokenRequestContext context, Boolean async, CancellationToken cancellationToken) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.AccessTokenCache.GetHeaderValueAsync(HttpMessage message, TokenRequestContext context, Boolean async) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.AccessTokenCache.GetHeaderValueAsync(HttpMessage message, TokenRequestContext context, Boolean async) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.AuthenticateAndAuthorizeRequestAsync(HttpMessage message, TokenRequestContext context) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async) at Azure.Core.Pipeline.RedirectPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async) at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async) at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async) at Azure.CodeSigning.CertificateProfileRestClient.SignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.CertificateProfileClient.StartSignAsync(String codeSigningAccountName, String certificateProfileName, SignRequest body, String xCorrelationId, String clientVersion, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.SignAsync(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle, CancellationToken cancellationToken) at Azure.CodeSigning.Dlib.Core.DigestSigner.Sign(UInt32 algorithm, Byte[] digest, SafeFileHandle safeFileHandle) at AuthenticodeDigestSignExWithFileHandleManaged(_CRYPTOAPI_BLOB* pMetadataBlob, UInt32 digestAlgId, Byte* pbToBeSignedDigest, UInt32 cbToBeSignedDigest, Void* hFile, _CRYPTOAPI_BLOB* pSignedDigest, _CERT_CONTEXT** ppSignerCert, Void* hCertChainStore) SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign() failed." (-2147467259/0x80004005) And this: Azure.Identity.CredentialUnavailableException: Azure CLI not installed "not installed"?
  11. Mark-

    Microsoft Trusted Signing service

    Hello, Thought I had it all set up but no joy so looking at everything, get this: The following certificates were considered: After EKU filter, 0 certs were left. After expiry filter, 0 certs were left. SignTool Error: No certificates were found that met all the given criteria. "CodeSigningAccountName" The name under the green: Thanks, Mark
  12. Mark-

    Desktop Icons

    I did that a few days ago out of curiosity. I did it a function at a time so it needs work to make it workable. procedure FindDesktopFolderView(riid: TGUID; var ppv: Pointer); var spShellWindows: IShellWindows; vtLoc: OleVariant; vtEmpty: OleVariant; lhwnd: LongInt; spdisp: IDispatch; spBrowser: IShellBrowser; spView: IShellView; begin spShellWindows := CoShellWindows.Create; vtLoc := CSIDL_DESKTOP; vtEmpty := VarEmpty; spShellWindows.FindWindowSW(vtLoc, vtEmpty, SWC_DESKTOP, lhwnd, SWFO_NEEDDISPATCH, spdisp); spBrowser := (spdisp as IServiceProvider).QueryService(SID_STopLevelBrowser, IShellBrowser) as IShellBrowser; spBrowser.QueryActiveShellView(spView); spView.QueryInterface(riid, ppv); end; ----------------- program DesktopFolderView; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, ActiveX, ComObj, ShlObj, ShellAPI; // CCoInitialize incorporated by reference function wmain(argc: Integer; argv: PWideChar): Integer; var init: IUnknown; // Equivalent to CCoInitialize spView: IFolderView; spFolder: IShellFolder; spEnum: IEnumIDList; spidl: PItemIDList; str: TStrRet; spszName: PWideChar; pt: TPoint; begin init := CreateComObject(CLSID_CoInitialize); FindDesktopFolderView(IID_IFolderView, spView); spView.GetFolder(IID_IShellFolder, spFolder); spView.Items(SVGIO_ALLVIEW, IID_IEnumIDList, spEnum); while spEnum.Next(1, spidl, nil) = S_OK do begin spFolder.GetDisplayNameOf(spidl, SHGDN_NORMAL, str); StrRetToStr(@str, spidl, spszName); spView.GetItemPosition(spidl, pt); Writeln(Format('At %4d,%4d is %s', [pt.x, pt.y, WideString(spszName)])); CoTaskMemFree(spidl); end; Result := 0; end; begin try CoInitialize(nil); wmain(ParamCount, PWideChar(ParamStr(0))); CoUninitialize; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. --------------------------- program DesktopFolderRandomPosition; {$APPTYPE CONSOLE} uses System.SysUtils, ActiveX, ComObj, ShlObj, ShellAPI, Windows; function wmain(argc: Integer; argv: PWideChar): Integer; var init: IUnknown; // Equivalent to CCoInitialize spView: IFolderView; spEnum: IEnumIDList; spidl: PItemIDList; pt: TPoint; apidl: array[0..0] of PItemIDList; begin init := CreateComObject(CLSID_CoInitialize); FindDesktopFolderView(IID_IFolderView, spView); spView.Items(SVGIO_ALLVIEW, IID_IEnumIDList, spEnum); while spEnum.Next(1, spidl, nil) = S_OK do begin spView.GetItemPosition(spidl, pt); pt.x := pt.x + (Random(5) - 2); pt.y := pt.y + (Random(5) - 2); apidl[0] := spidl; spView.SelectAndPositionItems(1, @apidl[0], @pt, SVSI_POSITIONITEM); CoTaskMemFree(spidl); end; Result := 0; end; begin try CoInitialize(nil); Randomize; // Initialize random number generator wmain(ParamCount, PWideChar(ParamStr(0))); CoUninitialize; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. ------------------------------------ procedure SavePositions(pView: IFolderView; pszFile: PWideChar); var spStream: IStream; spEnum: IEnumIDList; spidl: PItemIDList; pt: TPoint; begin SHCreateStreamOnFileEx(pszFile, STGM_CREATE or STGM_WRITE, FILE_ATTRIBUTE_NORMAL, True, nil, spStream); pView.Items(SVGIO_ALLVIEW, IID_IEnumIDList, spEnum); while spEnum.Next(1, spidl, nil) = S_OK do begin WritePidlToStream(spStream, spidl); // Custom function to write PIDL to stream pView.GetItemPosition(spidl, pt); WritePointToStream(spStream, pt); // Custom function to write POINT to stream ILFree(spidl); // Free the PIDL end; end; ----------------------------------- procedure RestorePositions(pView: IFolderView; pszFile: PWideChar); var spStream: IStream; spidl: PItemIDList; pt: TPoint; apidl: array[0..0] of PItemIDList; begin // Create a file stream SHCreateStreamOnFileEx(pszFile, STGM_READ, FILE_ATTRIBUTE_NORMAL, False, nil, spStream); // Read PIDLs and their positions from the stream and restore them while Succeeded(IStream_ReadPidl(spStream, spidl)) and Succeeded(spStream.Read(@pt, SizeOf(pt), nil)) do begin apidl[0] := spidl; pView.SelectAndPositionItems(1, @apidl[0], @pt, SVSI_POSITIONITEM); CoTaskMemFree(spidl); // Free the PIDL end; end; // Note: IStream_ReadPidl is a placeholder for the actual function you would use to read a PIDL from a stream. // You will need to implement this functionality in Delphi, as it is not provided by Delphi's standard libraries.
  13. Mark-

    "CAN" bus advice

    Hello, Anyone have suggestions for hardware/software for "Controller Area Network" (CAN) bus support for Windows using VCL? Thanks, Mark
  14. Mark-

    Writing if statement in the Code Editor

    Interesting, works on both monitors, on both computers here. Both computer's monitors, are arranged like this:
  15. Mark-

    Writing if statement in the Code Editor

    SHIFT + Windows key + S, allows to capture a part of the screen via click and drag the mouse.
  16. Mark-

    CPas - C for Delphi

    Yeah that was the catalyst for posting here and the webpage of "tinyBigGAMES LLC" did not have it listed. I wonder if he sold his work.
  17. Mark-

    Writing if statement in the Code Editor

    Does it change if you use the dark theme?
  18. Mark-

    CPas - C for Delphi

    Has this endeavor (CPas) ended?
  19. Mark-

    Writing if statement in the Code Editor

    Delphi 10.2 Version 25.0.31059.3231 If I turn on hints, this is how the hint is displayed:
  20. Hello, Delphi Delphi 10.2 Version 25.0.31059.3231 I have never used the IDE macro feature. Recently the three button controls appeared in the lower left of all code editor windows. The controls may have been in the window, not causing an issue. The controls are blocking the line and column values for the caret position. Any idea how to fix or hide the controls. Thanks, Mark
  21. Yes, the buttons show up as normal. Something to do with the theme and IDE foremost application I just started with dark and the buttons are not visible. Switch to light, appear, back to dark, still present. Switched to another application, back to IDE and buttons disappear. At least I now know how to get the buttons to the right location.
  22. Thanks. That placement was what I recalled. Started the IDE this morning and the macro buttons are not present. Switched from dark to light theme and back to dark, result: Go figure.
  23. Confused I am. Now I have one IDE code window with the macro controls visible and one without the controls visible.
×