How to add QBFC13_0.msm to Clickonce

2019-07-19 01:08发布

There seems to be no step by step process documented anywhere on the web on how to do this. If it is mentioned, it's very poorly documented, and I cannot follow the complex path they suggest. I am a newbie to ClickOnce, I've been able to get my c# program to install correctly on the users machine, but of course I get the "22E88GD7-FB0B-B905-CCA6BD526B52" "class not registered", implying I believe that QBFC13 is not installed on the users machine. My customer does NOT want a separate one time installation of QBFC using the standard QB installer outside of ClickOnce, he wants it as part of ClickOnce. Is it really that complex and a poorly documented process? All of the google searches and stackoverflow entries that I've seen don't give a way to do it easily or completely so that a newbie can do it. Help!

3条回答
疯言疯语
2楼-- · 2019-07-19 01:41

In VS2012, you need to add a Prerequisite (Project Properties --> Publish --> Prerequisites...).

However, QBFC is not in the list by default, so Microsoft's Bootstrapper Manifest Generator is needed to create your own. Unfortunately, it is buggy and confusing. So here's how you do:

  1. New Project - select "Package Manifest"
  2. Project Name - "The 'save' name of this manifest project goes here"
  3. In the tree, alt-click "Package", then "Add Install File" - browse to the .msi or .exe

    ex: C:\Users\{username}\AppData\Local\Downloaded Installations\{C7896CDC-45FF-49E1-A23D-68FA13A910A5}\QBFC 11.0.msi
    
  4. Display Name - "The name that will show up in Visual Studio"

    ex: QuickBooks Foundation Classes v11.0
    
  5. Properties tab - not needed, skip
  6. System Checks - click the first icon "File Check"

    1. Property for Result - The file property from Step #3 that you'd like to test

      ex: Name
      
    2. File name to search for - pick the same file as in Step #3
    3. Start Search in Special Folder - match this to Step #6.2

      ex: AppDataFolder
      
    4. Path - match this to Step #6.2

      ex: \Local\Downloaded Installations\{C7896CDC-45FF-49E1-A23D-68FA13A910A5}
      
  7. Install Conditions tab
    1. Type - ByPassIf
    2. Property - select the identifier from Step #6.1
    3. Comparison - Exists
    4. Value - N/A
  8. Exit Codes tab
    1. Exit Code - 0
    2. Result - Success
  9. Save your work, then "Build" (CTRL+SHIFT+B)
  10. Build Results dialog - click the "Build Output" link
  11. Move/Copy this entire folder to:

    [VS2012] C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\
    
  12. Restart Visual Studio and your new Prerequisite will be in the list!
  13. Now, just select it under Project Properties --> Publish --> Prerequisites... and Publish

Here's the working "product.xml" I generated for QBFCv11:

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="Intuit.QBFCv11" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="qbfc 11.0.msi" PublicKey="3082...0001" />
  </PackageFiles>
  <InstallChecks>
    <FileCheck Property="Name" SpecialFolder="ProgramFilesFolder" SearchPath="Local\Downloaded Installations\{C7896CDC-45FF-49E1-A23D-68FA13A910A5}" FileName="QBFC 11.0.msi" />
  </InstallChecks>
  <Commands Reboot="Defer">
    <Command PackageFile="qbfc 11.0.msi">
      <InstallConditions>
        <BypassIf Property="Name" Compare="ValueExists" Value="N/A for ValueExists and ValueNotExists" />
      </InstallConditions>
      <ExitCodes>
        <ExitCode Value="0" Result="Success" />
        <DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>
查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-07-19 01:48

In the clickOnce deployment, we can add pre requisites. In that if you add the QBFC.exe package then it will automatically install into clients machine from your deployment server. For adding QBFC as pre requisites, it should add in C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages in the deployment server. There is one XML for Naming convernsions. But, easy way is to use

Bootstrapper Manifest Generator Software.

Thanks.

查看更多
▲ chillily
4楼-- · 2019-07-19 02:01

A ClickOnce installation takes place in the context of the current user. If the current user is not an admin, he can not install anything that requires registration in the environment. So what you're asking probably is not possible directly.

What you could try to do is install a little helper application along with your application which is able to register your components/execute an installer and have your ClickOnce application execute that with Administrator permissions if possible. That, however, would only work if the user really has admin rights on the machine.

Even if you have the prerequisites installed prior to the ClickOnce installation, an administrator will have to execute that before any user on the machine can.

查看更多
登录 后发表回答