Распространяемый VC ++ ClickOnce Bootstrapper не будет работать должным образом - PullRequest
1 голос
/ 22 октября 2019

Я создаю проект установки для своего кода, используя расширение для проектов установки Visual Studio 2019. Я попытался использовать загрузчик clickonce для загрузки vcredist на компьютер клиента, но он был установлен с веб-сайта. Мой клиент не может использовать Интернет в своем месте, поэтому это нереальное решение.

Я попытался создать свой собственный пакет clickonce для локальной версии .exe, который работает, если он является новой установкой без какой-либо другой версии распространяемого Visual C ++, установленной ранее.

Это мой product.xml

    <InstallChecks>
        <MsiProductCheck
            Property="IsMsiInstalled"
            Product="{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}"/>
    </InstallChecks>

    <!-- Defines how to invoke the setup for .NET Framework redist -->
    <Commands Reboot="Immediate">
        <!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
        <Command PackageFile="vc_redist.x64.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper">
          <!-- These checks determine whether the package is to be installed -->
          <InstallConditions>
            <BypassIf Property="IsMsiInstalled"
              Compare="ValueGreaterThan" Value="0"/>
            <FailIf Property="AdminUser"
              Compare="ValueNotEqualTo" Value="True"
             String="NotAnAdmin"/>
          </InstallConditions>

          <ExitCodes>
            <ExitCode Value="0" Result="Success" />
            <ExitCode Value="3010" Result="SuccessReboot" />
            <DefaultExitCode Result="Fail" FormatMessageFromSystem="false" String="GeneralFailure" />
          </ExitCodes>
        </Command>
    </Commands>
</Product>

Это мой package.xml

<Package
    xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
    Name="DisplayName"
    Culture="Culture"
    >

    <!-- Defines a localizable string table for error messages-->
    <Strings>
        <String Name="DisplayName">Visual C++ "14" Runtime Libraries (x64)</String>
        <String Name="Culture">en</String>
        <String Name="AdminRequired">You do not have the permissions required to install Visual C++ "14" Runtime Libraries (x64). Please contact your administrator.</String>
        <String Name="InvalidOS">Installation of Visual C++ "14" Runtime Libraries (x64) is supported only on x64 machines.</String>
        <String Name="GeneralFailure">A failure occurred attempting to install Visual C++ "14" Runtime Libraries (x64).</String>
    </Strings>
</Package>

Я получаю сообщение об ошибке при запуске установки для компьютеров с этим пакетом (или предыдущая версия этого пакета) уже установлена.

Это ошибка.

Произошла ошибка при установке компонентов системы для (название продукта). Установка не может быть продолжена до тех пор, пока все компоненты системы не будут успешно установлены

>Component Visual C++ "14" Runtime Libraries (x64) has failed to install with the following error message:
"Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. "
The following components failed to install:
- Visual C++ "14" Runtime Libraries (x64)
See the setup log file located at 'C:\Users\(username)\AppData\Local\Temp\VSD5A50.tmp\install.log' for more information.>

Это install.log

>The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = SameSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 10.0.0 {version}
Running checks for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)', phase BuildList
Reading value 'Release' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
Read integer value 528049
Setting value '528049 {int}' for property 'DotNetFull_Release'
Reading value 'v4' of registry key 'HKLM\SOFTWARE\Microsoft\NET Framework Setup\OS Integration'
Read integer value 1
Setting value '1 {int}' for property 'DotNetFull_OSIntegrated'
Reading value 'ThisVersionInstalled' of registry key 'HKLM\SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 4.7.2\KB4087364'
Unable to read registry value
Not setting value for property 'DotNetFull_MSPDetection'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054542~31bf3856ad364e35~amd64~~6.2.1.2142'
Unable to read registry value
Not setting value for property 'DotNetFull_Win8X86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054542~31bf3856ad364e35~x86~~6.2.1.2142'
Unable to read registry value
Not setting value for property 'DotNetFull_Win8X64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054566~31bf3856ad364e35~amd64~~6.3.1.2145'
Unable to read registry value
Not setting value for property 'DotNetFull_Win81X86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054566~31bf3856ad364e35~x86~~6.3.1.2145'
Unable to read registry value
Not setting value for property 'DotNetFull_Win81X64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054590~31bf3856ad364e35~amd64~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10AX86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4054590~31bf3856ad364e35~x86~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10AX64Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4073120~31bf3856ad364e35~amd64~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10BX86Identity'
Reading value 'CurrentState' of registry key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB4073120~31bf3856ad364e35~x86~~10.0.1.2072'
Unable to read registry value
Not setting value for property 'DotNetFull_Win10BX64Identity'
The following properties have been set for package 'Microsoft .NET Framework 4.7.2 (x86 and x64)':
Property: [DotNetFull_OSIntegrated] = 1 {int}
Property: [DotNetFull_Release] = 528049 {int}
Running checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'ValueGreaterThan' on property 'DotNetFull_Release' and value '461808': true
Result of checks for command 'DotNetFX472\NDP472-KB4054530-x86-x64-AllOS-ENU.exe' is 'Bypass'
Running checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX472\NDP472-KB4054531-Web.exe' is 'Bypass'
'Microsoft .NET Framework 4.7.2 (x86 and x64)' RunCheck result: No Install Needed
Running checks for package 'Microsoft Visual C++ Redistributable 14.0', phase BuildList
Running MsiProductCheck with ProductCode '{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Microsoft Visual C++ Redistributable 14.0':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_current_x64\vc_redist.x64.exe'
Skipping ByPassIf because Property 'IsMsiInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'AdminUser' and value 'True': false
Result of checks for command 'vcredist_current_x64\vc_redist.x64.exe' is 'Install'
'Microsoft Visual C++ Redistributable 14.0' RunCheck result: Install Needed
EULA for components 'Microsoft Visual C++ Redistributable 14.0' was accepted.
Copying files to temporary directory "C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\"
Copying from 'C:\Users\(username)\(product)\(installer)\Debug\vcredist_current_x64\vc_redist.x64.exe' to 'C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe'
Verifying file integrity of C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe
WinVerifyTrust returned 0
File trusted
Running checks for package 'Microsoft Visual C++ Redistributable 14.0', phase BeforePackage
Running MsiProductCheck with ProductCode '{2cbcedbb-f38c-48a3-a3e1-6c6fd821a7f4}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'VCRedistInstalled'
The following properties have been set for package 'Microsoft Visual C++ Redistributable 14.0':
Property: [VCRedistInstalled] = -1 {int}
Running checks for command 'vcredist_current_x64\vc_redist.x64.exe'
Skipping ByPassIf because Property 'IsMsiInstalled' was not defined
Result of running operator 'ValueNotEqualTo' on property 'AdminUser' and value 'True': false
Result of checks for command 'vcredist_current_x64\vc_redist.x64.exe' is 'Install'
'Microsoft Visual C++ Redistributable 14.0' RunCheck result: Install Needed
Verifying file integrity of C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe
WinVerifyTrust returned 0
File trusted
Installing using command 'C:\Users\(username)\AppData\Local\Temp\VSDA0C2.tmp\vcredist_current_x64\vc_redist.x64.exe' and parameters ' /q /norestart /ChainingPackage FullX64Bootstrapper'
Process exited with code 1638
Status of package 'Microsoft Visual C++ Redistributable 14.0' after install is 'InstallFailed'
>

Я попытался выполнить пакет и манифест продукта из Программного файла(x86) \ Microsoft SDKs ... для vcredist, но изменение его с веб-сайта на локальный, но это, похоже, не работает. Следование руководству Microsoft также не сработало для меня.

Я думаю, у меня проблема с ключом продукта, который не является правильным ключом продукта.

Мне нужно, чтобы программа установки проверила, установлен ли продукт или предыдущая версия. Если это так, то пропустите эту часть настройки.

Руководство ценится!

Спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...