How to create an installer that automatically registers the InfoPath Template

Source: Internet
Author: User
The day before yesterday, I wrote an article about using InfoPath's installable template to deploy InfoPath. The installable template is really good, but it has a problem because it is a separate msi file, if I want this template to be only part of the program I want to install, I still need to deploy other things with another Installer. This seems redundant, so I made some analysis on the msi automatically generated by InfoPath.

During the running process, I found that every time it runs a console window, I began to wonder if a command line program was called and tracked with ProcessExplorer, it is found that there is a ca <TemplateName> In the target installation directory. when the exe program is running, open the directory to find that it is hidden, but don't worry, the installer will not delete it after the installation is complete (because it will be used when it is uninstalled ). If you double-click to run the program, a prompt window is displayed, which is used to register and uninstall the template.

From the pop-up information, we know that to install an InfoPath form template, we can use the following command RegTemplate formtemplatefile/install

The command to uninstall is RegTemplate formtemplatefile/uninstall.

For example, if we have an abc. xsn template, the installation command is RegForm abc. xsn/install. Note that the formtemplatefile must be the complete path. The path is not included only when the template is located in the current directory.

Therefore, the console window we see is that it is installing or uninstalling the template. In this way, we can use the custom action in the VS installation project to implement it.

First, you need to register the InfoPath template file (. xsn) in the installer.

Then, we create an installauto-defined role and select regform.exe as the command to execute this action. The parameters for setting this action are as follows:

Name: install template
Arguments: filetemplatefile/Install (If your template file is stored in the application root directory, the filetemplatefile here can be left with no path .)

Then, create an uninstallauto-defined role and select regform.exe as the command to be executed for this action. The parameters are as follows:

Name: Uninstall template
Arguments: filetemplatefile/Uninstall

Now, your installer will automatically register and uninstall the template file.

Note: RegTemplate and RegForm are two different tools. I made a mistake before, so I 'd like to clarify to you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.