For these APIs to work in the way you want each file must be in its own
component. You're enumerating components by component guid, and what you'll
get returned is the key path file in the component. If the component
contains a bunch of other files it can't tell you. The key file needs to be
there, obviously. 

That's the big picture, and I can't tell from your WiX whether each of the
files you have is a key file, but I see no KeyPath spec there. 

Phil  

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Tuesday, January 15, 2013 12:18 PM
To: [email protected]
Subject: [WiX-users] Using Microsoft.Deployment.WindowsInstaller.

Hello,

        I am currently using the Microsoft.Deployment.WindowsInstaller to
check some components for an install that I have done. However I have
noticed that a lot of my components are coming up with the
InstallState.Absent state. They are mostly images, aspx, and css files, but
since they show up as absent I can't get the path on disk for them. Below is
my test code that I am using to and for the absent components I hit the
FileNotFoundException , but the installer did install them. Is there anyway
I can get the path to disk for these files or did I do something wrong in
the wix to make them show up as absent? Also none of these components have
the MultiInstance = yes and this install does support multi instance, but
the product code I am testing with is for instance 0.

public static IEnumerable<ComponentInstallation>
GetComponentsForProduct(string productCode)
             {
                    return ComponentInstallation.AllComponents.Where(c =>
c.ClientProducts.Any(p => p.ProductCode.Equals(productCode)));
             }

foreach (var componentInstallation in GetComponentsForProduct(productCode))
                    {
                           try
                           {
                                 Console.WriteLine("File: {0}, Version: {1}
State: {2}", componentInstallation.Path,
 
Installer.GetFileVersion(componentInstallation.Path),
componentInstallation.State);
                           }
                           catch (FileNotFoundException e)
                           {
                                 Console.WriteLine("Component: {0},
State{1}", componentInstallation.ComponentCode,
componentInstallation.State);
                           }
                           catch (ArgumentException)
                           {
                                 Console.WriteLine("Component: {0}, State:
{1}", componentInstallation.ComponentCode, componentInstallation.State);
                           }
                    }


Below is a section of the Wix Code for one of the components that shows up
as absent.

<Component Id="css02_extallnotheme.css.component">
                           <File
Source="net\exampleuseradmin\exampleuseradmin\app_themes\avantgarde\css\02_e
xt-all-notheme.css" />
                    </Component>
                    <Component Id="css03_dctExtJsExtensions.css.component">
                           <File
Source="net\exampleuseradmin\exampleuseradmin\app_themes\avantgarde\css\03_d
ctExtJsExtensions.css" />
                    </Component>
                    <Component Id="css04_dctExtJsOverrides.css.component">
                           <File
Source="net\exampleuseradmin\exampleuseradmin\app_themes\avantgarde\css\04_d
ctExtJsOverrides.css" />
                    </Component>
                    <Component Id="css05_extxthemegray.css.component">
                           <File
Source="net\exampleuseradmin\exampleuseradmin\app_themes\avantgarde\css\05_e
xt-xtheme-gray.css" />
                    </Component>

Tyler Reid | Operations and Infrastructure | Accenture Software | P&C
Insurance
1807 Jones Street | Bolivar, MO 65613| USA
Office: +cc.xxx.xxx.xxxx | Fax: 417.777.3792
E-Mail: [email protected]<mailto:[email protected]> |
www.accenture.com/pcsoftware<http://www.accenture.com/pcsoftware>



________________________________
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its
affiliates, including e-mail and instant messaging (including content), may
be scanned by our systems for the purposes of information security and
assessment of internal compliance with Accenture policy.

____________________________________________________________________________
__________

www.accenture.com
----------------------------------------------------------------------------
--
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and
more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to