Solved

automatic install speech recognizer in winforms publish?

Posted on 2011-02-19
35
1,081 Views
Last Modified: 2012-05-11
VB.NET winforms application for Windows XP or above.  Publisher Wizard recognized need for Net Framework 4.0 Client Profile, installed it automatically as part of setup on target machine...very cool.

My application also requires MS Speech Recognition 5.1 or later installed on target machine.  This was NOT added during setup even though dll's are referenced in my app, and I do not see how to add it as a prerequisite in the Publishing Wizard.  

As much as possible, I want my app to be basically install and go....so I hope someone can tell me how to do an automatic install of the recognition engine when the setup determines it is not already there.....

Thanks in advance.
0
Comment
Question by:codefinger
  • 19
  • 14
35 Comments
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
You must create your own bootstrapper to be able to add this application as a prerequisite.
0
 

Author Comment

by:codefinger
Comment Utility
jorge_toriz

Please elaborate.  

How does that work?

0
 
LVL 15

Assisted Solution

by:jorge_toriz
jorge_toriz earned 500 total points
Comment Utility
In this link you can download the microsoft bootstrapper manifest generator that will create the xml files needed to integrate your application as a prerequisite

http://archive.msdn.microsoft.com/bmg

Just create a new project and search for your exe file, then you can add some verifications to check if your MS Speech Recognition is installed
0
 

Author Comment

by:codefinger
Comment Utility
This link is for VS 2008.  Will it work with VS Express 2010?
0
 

Author Comment

by:codefinger
Comment Utility
Sorry if I seem a little dense.  Up until now, the Publishing Wizard was doing all the work.
0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
mmm... well, I think it should work, if you can create setup projects with vs express 2010 then I suppose that you can do this by your custom bootstrapper
0
 

Author Comment

by:codefinger
Comment Utility
Ok, with some additional reading I am starting to catch on now.   My application requires MS English Recognizer version 5.1 or higher.

Any idea what file I should check for in the bootstrapper?   (My reading indicates the other kinds of system checks are unreliable, but what if the user has installed the the engine on his/her D drive instead of C?)

0
 

Author Comment

by:codefinger
Comment Utility
Here is the log of my first ever bootstrap effort.  Looks like it had all sorts of problems. I thought that when I finished, the bootstrap project would be listed as one of the prerequisites available in VSE 2010, but it was not. (probably because there were so many problems, even though it reports Build Succeeded.)  

Can anyone help walk me through this?  Thanks in advance!

Build Starting...
Configuring the Product
Configuring the Package: SpeechSDK51.exe  (en)
Building output files.
Product: MS.Speech.Recognizer
   PackageFiles:
   FileCheck: Speech Library
Validating C:\Documents and Settings\Al Knowles\My Documents\New Project\product.xml
Validation Was Unable to Execute: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Bootstrapper.Manifests.BootstrapperProduct.ValidateManifest(FileInfo manifest)
   at Microsoft.Bootstrapper.Manifests.BootstrapperProduct.Build(DirectoryInfo outputPath, Boolean validate)
 Package: Installing MS Speech Recognizer
   PackageFiles:
   PackageFile: C:\Documents and Settings\Al Knowles\Desktop\VERA\SpeechSDK\SpeechSDK51.exe
   FileCheck: Speech Library
  Commands...
   Command: C:\Documents and Settings\Al Knowles\Desktop\VERA\SpeechSDK\SpeechSDK51.exe
   ByPassIf: Speech Library
   DefaultExitCode:
Validating c:\documents and settings\al knowles\my documents\new project\en\package.xml
Validation Was Unable to Execute: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Bootstrapper.Manifests.BootstrapperProduct.ValidateManifest(FileInfo manifest)
   at Microsoft.Bootstrapper.Manifests.BootstrapperProduct.Build(DirectoryInfo outputPath, Boolean validate)
   Copying File: C:\Documents and Settings\Al Knowles\Desktop\VERA\SpeechSDK\SpeechSDK51.exe ...
There were validation warnings.
      Attempted to access a path that is not on the disk.
      Attempted to access a path that is not on the disk.

------------------------------------
Build Suceeded.       Warnings: 3, Errors: 0
0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
To list a product in the prerequisites list you must add the entry in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages folder with the files created by the microsoft bootstrapper

To check if is installed I recommend you to find some registry entries in your system that has relation to MS English Recognizer so you can add that check to your bootstrapper configuration.

You can guide with the others products that already exists in the folder I mention before to build your custom configuration.
0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
I downloaded speechsdk51.exe and make a bootstrapper configuration to be able to use it as prerequisite.

1. In "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages" folder I created a "Microsoft Speech 5.1" folder
2. Add speechsdk51.exe
3. Add product.xml (attached to this comment)
4. Create "en" folder
5. Add license.txt (attached to this comment)
6. Add package.xml (attached to this comment)

The last two files must be into the "en" folder

The license was extracted from the zip, but you must ensure that this is the correct license to be used by your software.
product.xml
license.txt
package.xml
0
 

Author Comment

by:codefinger
Comment Utility
This is fantastic,  jorge.  I appreciate the effort much more than the number of points I can give you.

I think we still have a little work to do, but I feel like we are getting there.  VSE 2010 still does not see the Speech SDK as a pre-requisite I can check off from the publishing wizard.
I put all the files you mentioned in the specified directory structure.  It looks like this:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\
                     \Microsoft Speech 5.1\
                          product.xml
                          speechsdk5.1.exe
                               \en
                                   package.xml
                                   license.txt

Is this correct?   When I changed the build location in the BMG, it is now looking for something called
"Schemas" in the file path, which it is not finding.  Not sure if that is relevant.



                   





0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
Are you deploying your application with ClickOnce or with a Visual Setup Project?
0
 

Author Comment

by:codefinger
Comment Utility
I am using the Publishing Wizard from inside VSE 2010.  For now I am putting the files on a CD and installing from there.   I think that describes a ClickOnce deployment, but VSE 2010 never actually described it that way.


0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
mmm... well, I don't know that publishing method :s, but I tryied with setup project and ClickOnce and in both I can see the Microsoft Speech 5.1 in the prerequisite list :s
0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
What value do you have in this registry key: "HKEY_LOCAL_MACHINE\Software\Microsoft\GenericBootstrapper\4.0\Path"
0
 

Author Comment

by:codefinger
Comment Utility
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 15

Assisted Solution

by:jorge_toriz
jorge_toriz earned 500 total points
Comment Utility
Then, your bootstrapper must be in that folder... I sent you the folder for vs2008 but for vs2010 is the one you post in your comment, move your files as this:


C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
                     \Microsoft Speech 5.1\
                          product.xml
                          speechsdk5.1.exe
                               \en
                                   package.xml
                                   license.txt
0
 

Author Comment

by:codefinger
Comment Utility
That did it.  Now it shows up in the rerequisite list, but I have another question.

For the Net frameworks and SQLServerCE,  I want to download the components from the vendors website, but for the SpeechSDK it can install from the CD.

When I display the list, the choices are mutually exclusive.

How do I handle that?
0
 

Author Comment

by:codefinger
Comment Utility
It looks like I need to create a separate install (maybe an msi?) for the Speech SDK file, since the one I have only unzips he required files but does not run the Speech setup.

0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
If you want to run the speech setup:

1. Extract the contents of the zip
2. Encapsulate the contents on a rar file that runs, after decompression, the setup file

About installing net framework and sql server ce from the vendors web site... I really have no idea how to do it due to the mutually exclusive radio button :s
0
 

Author Comment

by:codefinger
Comment Utility
The rar file will require that the target machine has a rar decompressor installed, correct?

0
 
LVL 15

Assisted Solution

by:jorge_toriz
jorge_toriz earned 500 total points
Comment Utility
No, you can create a self extract rar with WinRAR
0
 

Author Comment

by:codefinger
Comment Utility
Wow, thought that might have been a stupid question, now I am glad I asked.

I also want to ask, what value does your package check on the target machine to determine
whether or not the Speech SDK is installed?

0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
In the product.xml file appears a registry key that is created when speech sdk is installed, then, if it exists, the installation of the speech sdk is bypassed
0
 

Author Comment

by:codefinger
Comment Utility
jorge, when the dialog box comes up and says "Copying required files..." I notice that there is no progress bar at all.  Is that normal or is there an option I can set that says "Display progress bar.".

Also, when the setup runs, it asks for the user to confirm license agreement with MS Speech SDK 5.1, then instead of installing MS Speech SDK 5.1, it starts to install the files from my application.  It does not really matter which comes first as long as both are installed, but again, I do not know if this is normal.

Thanks for your incredible patience with this, jorge.  I wish I could give you more than 500 points!
0
 

Author Comment

by:codefinger
Comment Utility
Also, I created the RAR SFX file as you suggested, but now the package you sent to me is no longer
valid.  I have been trying without success to get the BMG to work properly so I can "roll my own" with
the new RAR SFX file, but without success.  Trying to determine exactly how to set up the BMG so
VSE 2010 recognizes the prerequisite changes is really confusing.

0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
Well, the thing is that the bootstrapper must be built again, I've uploaded the new generated bootstrapper in this link:

http://www.jorgetoriz.com/MSSpeech_Bootstrapper.rar
0
 

Author Comment

by:codefinger
Comment Utility
How do I get your new package, MSSpeech_Bootstrapper, to show up in the list of prerequisites?

I tried adding the whole folder under

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\

but that did not make it show up in the list of available prerequisites.   Not sure why, since it worked so well with the earlier package..

thanks!
0
 

Author Comment

by:codefinger
Comment Utility
Never mind that last question.  It took me a little while to figure out that the names of the items in the prerequisites correspond to the names INSIDE the xml files, not the actual file or folder names...no wonder its confusing!

Getting closer now.    Trying to make some adjustments to the SFX file, since the one you sent to me is in Spanish, and its set to put the temporary files in the current folder...which is the D: drive on my machine, the same as where the CD was launched from.  (For some reason, the option to specify an absolute path is disabled in my copy of WinRar.)   Working on the SFX file now, but not quite getting the right results yet.    

0
 

Accepted Solution

by:
codefinger earned 0 total points
Comment Utility
So close, but not there yet.

When I start the install from the CD, it asks me to accept the license agreement for the Speech SDK, then it begins "Copying required files" (no progress bar).  Then the setup program for the Speech SDK starts...I can tell because it asks me to confirm another speech SDK license agreement before hand, which I could live with, but then at the same time it presents the "Launching Application" setup dialog from my application install.  In other words, the whole routine is not waiting for the Speech SDK install to complete before starting the application install.

Any ideas?  I am stumped (again!).



0
 
LVL 15

Expert Comment

by:jorge_toriz
Comment Utility
mmm... let me think, because is weird that the "main" setup continue without waiting the prerequisite installation.
0
 

Author Comment

by:codefinger
Comment Utility
I have a theory....as far as the ClickOnce installation is concerned, the prerequisite is installed as soon as WinRar completes extraction of the files....the actual Speech Setup is not controlled by WinRar beyond starting the setup program.  

This might work if we take WinRar out of the equation.  The files the Speech Setup will need will not be compressed and will reside in one of the bootstrapper subdirectories.   The Speech Setup program would be the prerequisite and will run from that directory on the CD.

My attempt to create a bootstrapper like I described resulted in an error reading the setup initialization file. That doesn't necessarily mean my idea is no good, I'm just having some trouble implementing it properly (like I have had from the start...).

If you wouldn't mind and you think I may be on to something, maybe you could create another bootstrapper like I described?

Thanks!

0
 

Author Closing Comment

by:codefinger
Comment Utility
It looks like you gave up on this, jorge.  I cannot say as I blame you...I am giving up as well and will simply have to tell my users they must have MS Speech SDK 5.1 or later installed on their machine in order to use my app, so I can let THEM worry about it....so much for click and go...oh, well. But I learned a LOT about bootstrapping, about which I previously knew nothing, and that is information that will probably be useful for me at some time in the future. So thanks for your efforts, jorge.  I do appreciate the extensive effort you put into this question.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Several part series to implement Internet Explorer 11 Enterprise Mode
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now