The UAC prompt shows a temporary random Program Name for msi, can the correct name be displayed?

后端 未结 2 1682
挽巷
挽巷 2020-11-27 06:17

I\'m building an MSI installer for windows and sign the installer using signtool. When I run the .msi to test it, the UAC (User Account Control) prompt shows up to ask me if

2条回答
  •  无人及你
    2020-11-27 06:49

    this is an applied version of @Scott-langham's comment.

    this was directly from the PostBuildEvent of a visual studio installer project - VDPROJ file

    set signtool="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\signtool.exe"
    set timestampurl=http://timestamp.digicert.com
    set certpath="$(ProjectDir)CodeSigningCert.pfx"
    
    :: Setup in your user environment variables
    :: using something with low sort order to force off screen ZZCODECERTPASSWORD
    if []==[%ZZCODECERTPASSWORD%] (
    echo must set code signing certificate in ZZCODECERTPASSWORD environment variable. stopping build.
    exit /b 2
    )
    
    :: need the filename with extension that is being generated
    FOR /f %%i IN ("$(BuiltOuputPath)") DO (
    SET outputfilename=%%~nxi
    )
    
    %signtool% sign /t %timestampurl% /f %certpath% /p %CODECERTPW% /d %outputfilename% "$(BuiltOuputPath)"
    IF ERRORLEVEL 1 (
    echo failed to sign MSI
    exit /b 3
    )
    
    %signtool% sign /t %timestampurl% /f %certpath% /p %CODECERTPW% "$(ProjectDir)$(Configuration)\Setup.exe"
    IF ERRORLEVEL 1 (
    echo failed to sign boostrap setup EXE
    exit /b 4
    )
    

提交回复
热议问题