简体   繁体   中英

How to remove “Will be installed to run from network” installation options from MSI when using WiX?

Bear with me, I'm just trying to learn WiX . I'm curious how to remove the following network installation options from this popup menu (circled in red)?

在此处输入图片说明

EDIT: As requested below, here's the Feature node:

<Feature Id='Complete' Title='Product title' Description='The complete package.'
  Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' Absent='disallow' AllowAdvertise='no' >

  <Feature Id='MainProgram' Title='Program files'
           Description='Installs the main executable files for the software.'
           Absent='disallow'
           AllowAdvertise='no'
           Level='1'>
    <ComponentRef Id='CompIDFile1EXE' />
    <ComponentRef Id='CompIDFile2EXE' />
    <ComponentRef Id='CompIDFile3EXE' />
    <ComponentRef Id='CompIDFile1DLL' />
    <ComponentRef Id='CompIDFile2DLL' />

    <ComponentRef Id='CompIDMainRegistry' />
    <ComponentRef Id='ProgramMenuDir' />
  </Feature>

  <Feature Id='ShortcutsStart' Title='Start Menu Shortcuts'
           AllowAdvertise='no'
           Description="Places software shortcuts into the Windows Start Menu."
           Level='1'>
    <ComponentRef Id='CompIDShortcutsStart' />
  </Feature>

  <Feature Id='ShortcutsDesktop' Title='Desktop Shortcut'
           AllowAdvertise='no'
           Description="Places software shortcut onto the users' desktops."
           Level='1000'>
    <ComponentRef Id='CompIDShortcutsDesktop' />
  </Feature>

</Feature>

You should show your WiX source being used for the Feature elements. It's most likely a combination of the InstallDefault setting (which you probably want to be "local") and AllowAdvertise (and set it to "no").

For features that do not directly contain ComponentRef or ComponentGroupRef , you just create a dummy component inside that feature with a Location="local" attribute. This will get rid of the "run from network" options. Example:

<Feature Id='Complete' Title='Product title' Description='The complete package.'  Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' Absent='disallow' AllowAdvertise='no' >
   <!-- Dummy component to get rid of the "run from network" option  -->
   <Component Id="CompleteDummyComponent" Location="local" Directory="TARGETDIR" Guid="GUID_HERE_PLEASE" />

<!-- sub features here -->
</Feature>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM