home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / howto / doc / installers.aspx < prev    next >
Encoding:
Text File  |  2000-06-08  |  2.8 KB  |  71 lines

  1.  
  2. <!-- #include virtual="/quickstart/howto/include/header.inc" -->
  3.  
  4. <h4>How Do I...Create system resources during installation?</h4>
  5.  
  6. <div class="indent" style="width:660">
  7.  
  8. <font face="Tahoma" size="1">An application may consist not only of 
  9. traditional program files, but also of associated resources, such as message
  10. queues, event logs, and performance counters, that must be created on the
  11. deployment destination. You can configure your application to create these
  12. resources when you application is installed and to remove them if your
  13. application is uninstalled, using what are called <span class="Italic">installation
  14. components</span>.</font>
  15.  
  16. <p><font face="Tahoma" size="1">This sample illustrates how to build an
  17. application which will set up its own message queue and its own event log
  18. during installation and delete those two system resources when the application
  19. is uninstalled.</font></p>
  20.  
  21. <p><font face="Tahoma" size="1">Run the following command line to
  22. install the system resources:</font></p>
  23.  
  24.     <blockquote>
  25.     <p><font face="Courier New" size="2" color="#0000FF">> InstallUtil.exe
  26.     Installers.exe</font></p>
  27.     </blockquote>
  28.  
  29. <p><font face="Tahoma" size="1">Now, you can verify in the message queueing
  30. management console that an "InstallersSample" message queue was
  31. installed. Also, an "InstallersSample" event log source was set up in
  32. the registry.</font></p>
  33.  
  34. <p><font face="Tahoma" size="1">To uninstall the message queue and the event
  35. log source, Run the following command:</font></p>
  36.  
  37.     <blockquote>
  38.     <p><font face="Courier New" size="2" color="#0000FF">>InstallUtil.exe /u
  39.     Installers.exe</font></p>
  40.     </blockquote>
  41.  
  42. <p><font face="Tahoma" size="1">How does it work? The InstallUtil.exe will
  43. search, using Reflection mechanism, all assemblies passed as the command line
  44. arguments for classes inheriting from Installer class and with
  45. RunInstallerAttribute set to true. The Installers then handle the install and
  46. uninstall actions.  </font>
  47.  
  48. </div>
  49.  
  50. <h4>Example</h4>
  51. <p> 
  52. <div class="indent">
  53.   <a target="_blank" href="/quickstart/howto/samples/Services/Installers/Installers"><img style="border-color:black" border="1" src="/quickstart/images/genicon.gif"><br>
  54.   </a>
  55.   <div class="caption">
  56.     Installers.exe
  57.   </div>
  58.   <br>
  59.   [<a target="_blank" href="/quickstart/howto/samples/Services/Installers/Installers">View
  60.   Sample</a>] | [<a target="_blank" href="/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/Services/Installers/Installers/Installers.src">View
  61.   Source</a>]
  62.   <p> 
  63. </div>
  64. <h4>Source Code</h4>
  65. <div class="code">
  66.   <xmp>
  67.   <!-- #include virtual="/quickstart/howto/samples/Services/Installers/Installers/Installers.cs" -->
  68.   </xmp>
  69. </div>
  70. <!-- #include virtual="/quickstart/howto/include/footer.inc" -->
  71.