Académique Documents
Professionnel Documents
Culture Documents
Table of Contents
Componentizing Applications End To End using Windows Embedded Standard 2009 ....... 1
Exercise 1 Track the application install .........................................................................................................................2
Exercise 2 Create the Application SLD .........................................................................................................................8
Exercise 3 Static analysis of the application binaries .................................................................................................. 11
Exercise 4 Optional - Dynamic analysis of Application dependencies ....................................................................... 15
Exercise 5 Optional - Create a resource component .................................................................................................... 17
Exercise 6 Deploy and test the new component .......................................................................................................... 18
Componentizing Applications End To End using Windows Embedded Standard 2009
The password for the User account on all computers in this lab is: P@ssw0rd.
Page 1 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 1
Track the application install
Scenario
We will be using Process Monitor to get the resources created during the install of PowerPoint Viewer 2003. There
are ample of commercial setup tracking software. We will be using the free tool Process Monitor from Microsoft to
track the install with respect to the files and registry entries created.
f. Filter | Filter or CTRL + L should bring the filter menu. Add a filter “Process
Name is not msiexec.exe then Exclude”. This enables tracking only msiexec.exe
g. Press Add and Ok on the Filter window to set the filter.
2. Start installation a. Press CTRL+E or File | Capture Events to start capturing events.
Page 2 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
and get the list of b. Install PowerPoint viewer at C:\COMPONENTIZE\App\ppviewer.exe (right-
files owned by the click and Run as Administrator).
component. c. Once the installation is complete, stop the capture process in Process Monitor by
pressing CTRL+E. Now we can start collecting information about the files and
registry keys created.
d. Add a filter “Operation-is not-WriteFile-then-Exclude” to narrow the view to the
new files that were written as part of the install.
e. You should get a list of WriteFile operations. This corresponds to the list of the
files written during the installation.
Select the Tools | Unique Values to exclude multiple entries of the same file.
Once the “Show Unique Values” window opens, select Path from the column drop
down to list the files. Click the Show button.
Select the Save option to save the results to a file, C:\Componentize\files.csv.
Open files.csv with Notepad or Wordpad.
f. The final list of files would be:
"C:\Config.Msi\1385abe8.rbs"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\GDIPLUS.DLL"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\INTLDATE.DLL"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\PPTVIEW.EXE"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\PPVWINTL.DLL"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\PVREADME.HTM"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\SAEXT.DLL"
"C:\Program Files\Microsoft Office\PowerPoint Viewer\UNICOWS.DLL"
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office
PowerPoint Viewer 2003.lnk"
Page 3 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
"C:\System Volume Information\SPP\metadata"
"C:\System Volume Information\SPP\snapshot"
"C:\Windows\Installer\{90AF0409-6000-11D3-8CFE-
0150048383C9}\ppvwicon.exe"
"C:\Windows\Installer\163e354.msi"
"C:\Windows\Installer\163e357.ipi"
"C:\Windows\Installer\163e359.msi"
"C:\Windows\Installer\MSI8A5A.tmp"
"C:\Windows\System32\config"
"C:\Windows\System32\config\SOFTWARE"
"C:\Windows\System32\config\SOFTWARE.LOG1"
"C:\Windows\System32\config\SYSTEM"
"C:\Windows\System32\config\SYSTEM.LOG1"
C:\COMPONENTIZE\Exercise\Exercise 1\Task
2\List_Of_Setup_Files.txt
Note: If Save Function in “Show Files” saves only an empty file, please use the above
file.
g. It is essential to ignore files that do not directly correspond to the application that
we are trying to componentize. For example, *.msi and *.ipi files are used for
Uninstall\Modify operations and it is not a typical scenario for embedded runtimes.
Similarly SOFTWARE, SOFTWARE.LOG1 etc. correspond to the registry hives
written. We now have the final list of binaries that will be owned by the
component highlighted in bold text.
h. Even though PVREADME.HTM is very small, it needs the “Internet Explorer”
component to view which has a large footprint hit. So it is up to us to choose if we
want to increase the footprint of our runtime just to be able to view the README
file or not include it in our component. Let’s exclude the README file for this
lab.
i. Delete all files we are not concerned about from your list and save. Close the list of
files and move back to the Process Monitor window.
3. Get the list of Note: Filtering registry key values is done in the same way as files. However,
registry entries determining the list of keys that the component should own takes some effort.
created by the a. In order to apply the new filter, the previously applied WriteFile filter has to be
installation removed.
Bring up the Filter menu item, click on the filter rule for the WriteFile operation
and Remove.
Add a filter “Operation is not RegCreateKey then Exclude”, to clear everything
except RegCreateKey operation.
Apply the “Show Unique Values” constraint on Path, and save the list of registry
keys as C:\Componentize\regkeys.csv.
Open the file in notepad.
b. There will be a lot of keys that are not needed. We need to keep the keys that say
PowerPointViewer.*.11. We also need to keep the extension-specific keys,
namely .pot, .ppt, .pps. Finally we need to keep the installer keys that windows
Page 4 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
uses to find and open an application. We can usually disregard all the installer keys
that have local user SIDs (Security Identifiers). These are not portable and might
change with each user during OS install. It is OK,however, to collect the
installation keys for “Well Known SIDs”. In this instance we will keep keys
pertaining to SID S-1-5-18, which is a well known SID for in built user –
SYSTEM. The final list of registry keys that we are concerned with should look
something like this.
HKCR\.pot
HKCR\.pps
HKCR\.ppt
HKCR\Installer\Features\9040FA0900063D11C8EF10054038389C
HKCR\Installer\Products\9040FA0900063D11C8EF10054038389C
HKCR\Installer\Products\9040FA0900063D11C8EF10054038389C\SourceList
HKCR\Installer\Products\9040FA0900063D11C8EF10054038389C\SourceList\
Media
HKCR\Installer\Products\9040FA0900063D11C8EF10054038389C\SourceList\Net
HKCR\PowerPointViewer.Show.11
HKCR\PowerPointViewer.Show.11\DefaultIcon
HKCR\PowerPointViewer.Show.11\shell
HKCR\PowerPointViewer.Show.11\shell\Print
HKCR\PowerPointViewer.Show.11\shell\Print\command
HKCR\PowerPointViewer.Show.11\shell\Show
HKCR\PowerPointViewer.Show.11\shell\Show\command
HKCR\PowerPointViewer.SlideShow.11
HKCR\PowerPointViewer.SlideShow.11\DefaultIcon
HKCR\PowerPointViewer.SlideShow.11\shell
HKCR\PowerPointViewer.SlideShow.11\shell\Print
HKCR\PowerPointViewer.SlideShow.11\shell\Print\command
HKCR\PowerPointViewer.SlideShow.11\shell\Show
HKCR\PowerPointViewer.SlideShow.11\shell\Show\command
HKCR\PowerPointViewer.Template.11
HKCR\PowerPointViewer.Template.11\DefaultIcon
HKCR\PowerPointViewer.Template.11\shell
HKCR\PowerPointViewer.Template.11\shell\Print
HKCR\PowerPointViewer.Template.11\shell\Print\command
HKCR\PowerPointViewer.Template.11\shell\Show
HKCR\PowerPointViewer.Template.11\shell\Show\command
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Page 5 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
Data\S-1-5-18\Components\
44A1EC8F6A3D4844B89EB4B25DA2ACE1
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
78A0C082277ABBB4082770749C7F86DA
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
A0A0D0E3C44EB1CDFB76A4AAA464D8DC
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
A874C847098976648AE06316CBE4C970
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
AC18EF598BF737D44965518454BFCFBF
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
C9D4AA4B20E4DDF489803259E7032E55
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
E2D3EE8A529976442B4D0857744A1744
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Components\
FC4944160D707244F9C43E3CBB48F64D
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Products\
9040FA0900063D11C8EF10054038389C
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Products\
9040FA0900063D11C8EF10054038389C\Features
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\
Products\9040FA0900063D11C8EF10054038389C\InstallProperties
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Products\
9040FA0900063D11C8EF10054038389C\Patches
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\User
Data\S-1-5-18\Products\
9040FA0900063D11C8EF10054038389C\Usage
c. Delete all other keys from your list and save.
C:\COMPONENTIZE\Exercise\Exercise 1\Task
3\List_Of_Setup_RegistryKeys.txt
Page 6 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
d. We can keep Process Monitor running, so that we can refer back to the saved state
if we needed to.
e. Now we have all the information to build the initial version of the component.
Page 7 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 2
Create the Application SLD
Scenario
We can create a skeletal component from the information obtained from Exercise 1.We could wait till we have all
the information on the component, but as a best practice let’s create the component in steps. This is where we are
going to assume some familiarity with Component Designer, so that we can quickly get through this.
ppvwicon.exe %10%\Installer\{90AF0409-6000-11D3-
Page 8 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
8CFE-0150048383C9}\
c. One file is handles differently, and that is the .lnk file. Instead of adding this as a
file resource it needs to be added as a shortcut resource. This can be done as
follows:
d. On the Resources node, right-click and Add | Shortcut
e. Set the following:
Name =Shortcut:Microsoft Office PowerPoint Viewer 2003.lnk
DstName = Microsoft Office PowerPoint Viewer 2003.lnk
DstPath =%16407%
TargetPath = %16426%\Microsoft Office\PowerPoint Viewer\ PPTVIEW.EXE
Page 9 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Components\AC18EF598BF737D44965518454BFCFBF
HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Components\C9D4AA4B20E4DDF489803259E7032E55
HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Components\E2D3EE8A529976442B4D0857744A1744
HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Components\FC4944160D707244F9C43E3CBB48F64D
HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\
S-1-5-18\Products\9040FA0900063D11C8EF10054038389C
Page 10 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 3
Static analysis of the application binaries
Scenario
We now have all the files and registry keys needed by the component; however this is not enough to make the
component work. Each file owned by the component might have dependencies on other Windows files that need to
be included in the runtime. In order to ensure that the dependent files are automatically included in the runtime when
our component is imported, we need to find the files that the component files depend on. Then we can express a
dependency in our component on the component that owns those files. The tool we would be using to get the
dependencies is “Dependency Walker”, with which we will analyze each file owned by the component. You can
find it at C:\COMPONENTIZE\Tools\depends\Depends.exe
Page 11 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
component designer is open, it may open in non-exclusive mode that is enough for
us.)
b. Navigate to “Component” tab and click on the Filter button.
c. Click on New to create a new filter and call it File Search.
d. Double-click on the rule “Component contains the following file: [filelist]” to add
it.
e. Double-click the rule you added to open it and enter “KERNEL32.DLL”, then OK.
f. Apply the filter. The search could result in multiple components which own the
file.
Note: Make a note of the component with the highest version and revision- this is the
latest version of the component. IN this case it is “Windows API – Kernel [Version
5.1.2600.5512, R5512]”.
3. Get the total list of a. Repeat task 2 for all the files listed in the top level of Dependency Walker. Then
dependency look up the dependencies of all the other files that make up our PowerPoint Viewer
components component and find their owning components (repeat task 1 and 2 for all files).
Note: When complete the result set should look something like the following table.
X - Axis: List of Binaries for PowerPoint 2003 Application
Page 12 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
Y – Axis: Complete list of binary dependencies of the application binaries.
COMCTL32.DLL
KERNEL32.DLL
ADVAPI32.DLL
VERSION.DLL
USER32.DLL
GDI32.DLL
Binary
Dependency
KERNEL32.DLL X X X X X X
GDI32.DLL X X
ADVAPI32.DLL X X X X
NTDLL.DLL X X X X X
RPCRT4.DLL X
SECUR32.DLL X
BCRYPT.DLL X
USER32.DLL X X X
MSIMG32.DLL X
PPOWRPROF.D X
LL
WINSTA.DLL X
MSVCRT.DLL X
C:\COMPONENTIZE\Exercise\Exercise 3\Task
3\Complete_List_Of_Binary_Dependencies.txt
b. Now we can find the components that own all these binaries.
Binary Owning
Dependency Component
Page 13 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
32.DLL [Version 5.1.2600. 5512, R5512]
VERSION.DLL Primitive: Version [Version 5.1.2600. 5512, R5512]
NTDLL.DLL Primitive: Ntdll [Version 5.1.2600. 5512, R5512]
RPCRT4.DLL RPC Local Support [Version 5.1.2600. 5512, R5512]
Primitive: Secur
SECUR32.DLL
3 [Version 5.1.2600. 5512, R5512]
BCRYPT.DLL
MSIMG32.DLL Primitive: MSIMG32 [Version 5.1.2600.5512, R5512]
C:\COMPONENTIZE\Exercise\Exercise 3\Task
3\Dependent_Components.txt
c. GDIPLUS.DLL is a special case. This file in owned by our component and also it
is owned by the component GDI+ XPSP3 [Version 5.1.2600.5512, R5512]. These
two files could be different versions of the same file, so it is better give preference
to the file installed by our component. We give preference to our component, so
we will NOT add GDI+XPSP3 as a component dependency in our PowerPoint
component. Note that
4. Update the a. Open ppviewer2003.sld using Component Designer.
component with the b. Right-Click the Component or Group Dependency node and Add | Component
dependency Dependency.
components
c. Search for or browse to each of the components you have identified in the previous
task and add by double-clicking.
Page 14 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 4
Optional - Dynamic analysis of Application dependencies
Scenario
Even though we have done static analysis of the application binaries it may not be enough for every application,
because the application can have non-intuitive dependencies on other binaries or use previously undiscovered
registry keys when it is running. In dynamic analysis we monitor the application while it is running and try to catch
any additional dependencies.
Generally this analysis is only done after initial testing of your application component in a runtime image, when
problems are encountered with the functionality.
Page 15 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
R5512]
davclnt.dll Webdav Client Redirector [Version 5.1.2600. 5512,
R5512]
drprov.dll Terminal Services Core [Version 5.1.2600. 5512,
R5512]
linkinfo.dll Shell Namespace Extensions [Version 5.1.2600. 5512,
R5512]
C:\COMPONENTIZE\Exercise\Exercise 4\Task
2\Dynamic_Load_Components.txt
f. The list of Dynamic loads will differ with the code paths executed.
g. Just to re-iterate that some of component identified might not be useful in your
specific scenario and may cause a huge foot print hit. If your primary concern is
foot print, look to prune some of the files in each step of the processes above.
h. Update the component with the dynamic dependencies we just identified.
Page 16 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 5
Optional - Create a resource component
Scenario
Even though we have done static analysis of the application binaries it may not be enough for every application,
because the application can have non-intuitive dependencies on other binaries or use previously undiscovered
registry keys when it is running. In dynamic analysis we monitor the application while it is running and try to catch
any additional dependencies.
Generally this analysis is only done after initial testing of your application component in a runtime image, when
problems are encountered with the functionality.
Page 17 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Exercise 6
Deploy and test the new component
Scenario
We have come to the final steps of the process. Let us create runtime with our new component, deploy it and test it.
This is an optional exercise. Please proceed only if you still have time. We are assuming familiarirty with respect to
importing a SLD to the component database, creating and deploying a new runtime image.
Page 18 of 19
Componentizing Applications End To End using Windows Embedded Standard 2009
Tasks Detailed Steps
m. Open Component Database Manager
n. Click on the Package tab
o. Scroll down to the custom package you created (PowerPoint Viewer 2003
Package), select it and click the Delete Package button.
p. Check the box to delete all repository files and click Yes.
q. After the delete operation is complete close Component Database Manager.
Page 19 of 19