Dah Sra
Dah Sra

Reputation: 4445

InstallScope="perMachine" in wix makes no difference

Hi i need my application just to work in administator mode and all users mode.(ie)It should work in all the modes. I have created setup in WIX and after surfing a lot i came to know that setting InstallScope="perMachine" in package makes our application work in all the modes. But i found that only it shows our application under Add\Remove programs in all logins(admin or other users).

(ie): I am able to work my application in administrator mode and if i logged in as any user then my application is not visible for working.Its just appears in Add\Remove programs.

My requirement is i need my application work in all the mode,administrator,logins,all users too.

 <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" ></Package>

Even i tried allUser option in InstallScopeDlg. I need my application should work for all users including administrator too

Upvotes: 2

Views: 7470

Answers (2)

user3165438
user3165438

Reputation: 2661

In the Setup.wxs file add the following line

<Property Id="ALLUSERS" Value="1"></Property>

The file should look like :

<?xml version="1.0"?>  
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
         Name="programName"
         Language="1033"
         Version="1.0.0.0"
         UpgradeCode="183CC369-D86F-43B3-99E7-A82A16335E52"
         Manufacturer="CompanyName">
    <Package Description="#Description"
             Comments="Comments"
             InstallerVersion="200"
             Compressed="yes"/>
    <!--
        Source media for the installation. 
        Specifies a single cab file to be embedded in the installer's .msi. 
    -->
    <Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>

    <!-- Installation directory and files are defined in Files.wxs -->
    <Directory Id="TARGETDIR" Name="SourceDir"/>

    <Feature Id="Complete"
             Title="programName"
             Description="programName"
             Level="1">
        <ComponentRef Id="programNameFiles"/>
        <ComponentRef Id="programNameRegEntries"/>
    </Feature>

    <!--
        Using the Wix UI library

        WixUI_InstallDir does not allow the user to choose 
        features but adds a dialog to let the user choose a 
        directory where the product will be installed
    -->
    <Property Id="WIXUI_INSTALLDIR">INSTALLDIR</Property>
    <Property Id="ALLUSERS" Value="1"></Property>
    <UIRef Id="WixUI_InstallDir"/>
</Product>

Upvotes: 6

PhilDW
PhilDW

Reputation: 20790

The Program Files folder cannot be updated by limited users. Just because you have a per machine install doesn't mean that Windows Installer will violate the security rules by allowing limited users to write there!

The most likely thing that is happening is that admins install successfully to Program Files because they have the privileges to do that. Limited users cannot write to Program Files, so the files get diverted, most likely to C:\ProgramData

When you say "the app is not working" for limited users I'll guess that it may be a security issue - it needs admin privilege because it tries to write/update restricted locations or registry entries. In other words your app will only work for limited users if it restricts its activities to those permitted to limited users. If the app is not working then debug it - it's impossible for anyone here to say why it's failing without a lot more information. That's an app issue, not an install issue.

Upvotes: 1

Related Questions