Many people need to embed Silverlight applications into their own software applications in their own programs. Therefore, the installation method is to be completed directly in their own software. In fact, sliverlight4 already supports this function, but not many people know it. In this regard, cool Superman will let everyone know about it. You can run the following command line in your program through system. Diagnostics. process. Use your application in this way.
1. First, you must first determine which client machine has installed the Silverlight runtime. Similarly, its installation can be integrated into your application:
Silverlight.exe /q /doNotRequireDRMPrompt
The '/Q' parameter runs in silent mode. The following are some excerpts from the deployment manual of Silverlight 4.0.
The above is a description of the parameters for installing Silverlight runtime. You can also use system. Diagnostics. Process to quietly install Runtime on the client.
2. install your own Offline Application on the client:
The following is a demo script installation example:
"C: \ Program Files \ microsoft Silverlight \ sllauncher.exe"
/Install: "{localpathtoxapfile} \ Yourfile. xap"
/Origin: "{urltoxapfile}/Yourfile. xap"
/Shortcut cut: desktop + startmenu
The following describes the xap parameters for local installation of Silverlight.
Install
- /Install: "xapfile"-Xapfile is the file name/file path. xap file., e. g./install: "C: \ temp \ sample. xap"
- /Origin: "Xapuri" -Here, Xapuri is the. xap file in it and will be the URI from the past. If it is not installed on the command line
- E.g. /origin: "http://example.com/sample.xap ". this URI will be used as the origin site for security purposes. for example, for sandbox applications, the Silverlight network requires a policy file to check the network request time domain ratio to other source sites. The origin can also be the unique ID of an application. the Xapuri must be an absolute URI instead of a relative Uri, and must start with HTTP:, via https: or file :.
- /Overwrite-- (Optional) overwrites any xap installed before the Xapuri.
Delete
- /Uninstall-Uninstall the specified application/origin. This is the same/origin function used to install the application initially.
- /Origin: "Xapuri"-Installation with the same/Origin