问题
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!
回答1:
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.
回答2:
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:
- New Project - select "Package Manifest"
- Project Name - "The 'save' name of this manifest project goes here"
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
Display Name - "The name that will show up in Visual Studio"
ex: QuickBooks Foundation Classes v11.0
- Properties tab - not needed, skip
System Checks - click the first icon "File Check"
Property for Result - The file property from Step #3 that you'd like to test
ex: Name
- File name to search for - pick the same file as in Step #3
Start Search in Special Folder - match this to Step #6.2
ex: AppDataFolder
Path - match this to Step #6.2
ex: \Local\Downloaded Installations\{C7896CDC-45FF-49E1-A23D-68FA13A910A5}
- Install Conditions tab
- Type - ByPassIf
- Property - select the identifier from Step #6.1
- Comparison - Exists
- Value - N/A
- Exit Codes tab
- Exit Code - 0
- Result - Success
- Save your work, then "Build" (CTRL+SHIFT+B)
- Build Results dialog - click the "Build Output" link
Move/Copy this entire folder to:
[VS2012] C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\
- Restart Visual Studio and your new Prerequisite will be in the list!
- 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:
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.
来源:https://stackoverflow.com/questions/24511080/how-to-add-qbfc13-0-msm-to-clickonce