coapp-developers team mailing list archive
-
coapp-developers team
-
Mailing list archive
-
Message #00694
Tool to generate test EXEs and DLLs for packages
I just checked in the code to generate Windows side-by-side EXEs and DLLs to test packages in the lp:coapp-testpackagemaker project.
(make sure you pull updates for coapp-solution and coapp-toolkit)
Compile it using the coapp-solution\coapp-tools.sln solution file.
WHAT IT DOES
============
Based on contents of an .INI file, it generates C source code to create tiny EXE and DLL files that are bound with version information.
(see the packagemaker.ini file that is included in the source code)
EXEs are generated with a manifest that declares the version of the libraries that are required for the application.
DLLs are also generated with a manifest describing the version of the libraries it requires, along with a Publisher Configuration file containing the binding policy for the library (if it has one).
It uses an embedded code signing certificate to sign the binaries, and sign the catalogs for the policy files.
THINGS TO SEE
============
There aren't a lot of people that will need this tool (Eric will), but looking at the source code, you can see a few interesting things that I've used out of the CoApp Toolkit:
- Use of the ProcessUtility and ProgramFinder classes
These provide trivial wrapping of command line applications from .NET
ProgramFinder will search (and cache in the registry) the locations of command line utilities-the usage of it here searches the PATH and then all of the program files and c:\windows\microsoft.net folders
ProcessUtility lets you execute the command line tool using a formatted string for the command line (like writeline!) and gathers the Standard Out and Standard Err streams up and lets the developer access them as strings. (Not used in this app, it also has support for calling the tools asynchronously)
- Also, some extended use of the code that pulls command line parameters out, and shows how that same code can pull data from .ini files (see the CommandLineExtensions.cs file in the CoApp.Toolkit)
HOW TO USE IT
============
Sample Run:
C:\bin> CoApp.Testpackagemaker.exe --load-config=PackageMaker.ini
CoApp Project CoApp.TestPackagemaker Version 1.0.0 for x64
Copyright (c) Garrett Serack, CoApp Contributors 2010. All rights reserved
CoApp TestPackageMaker
-------------------------------------------------------------------------------
[Looking up tool locations...]
Building Binary [liba-1.0.0.0]
Building Binary [libd-1.0.0.0]
Building Binary [libc-1.0.0.0]
Building Binary [libb-1.0.0.0]
Building Binary [libd-2.0.0.0]
Building Binary [liba-1.0.0.1]
Building Binary [liba-2.0.0.0]
Building Binary [libb-1.0.0.1]
Building Binary [libb-2.0.0.0]
Building Binary [libb-2.0.0.1]
Building Binary [libc-2.0.0.1]
Building Binary [appone-1.0.0.0]
Building Binary [apptwo-1.0.0.0]
Building Binary [appthree-1.0.0.0]
Building Binary [appfour-1.0.0.0]
You can dig into the testpackages directory to see what's been created:
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appfour-1.0.0.0\appfour.exe
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appfour-1.0.0.0\appfour.exe.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appone-1.0.0.0\appone.exe
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appone-1.0.0.0\appone.exe.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appthree-1.0.0.0\appthree.exe
C:\root\projects\coapp\output\x86\debug\bin\testpackages\appthree-1.0.0.0\appthree.exe.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\apptwo-1.0.0.0\apptwo.exe
C:\root\projects\coapp\output\x86\debug\bin\testpackages\apptwo-1.0.0.0\apptwo.exe.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.0\liba.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.0\liba.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.1\liba.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.1\liba.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.1\policy.1.0.liba.cat
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-1.0.0.1\policy.1.0.liba.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-2.0.0.0\liba.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-2.0.0.0\liba.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-2.0.0.0\policy.2.0.liba.cat
C:\root\projects\coapp\output\x86\debug\bin\testpackages\liba-2.0.0.0\policy.2.0.liba.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.0\libb.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.0\libb.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.1\libb.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.1\libb.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.1\policy.1.0.libb.cat
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-1.0.0.1\policy.1.0.libb.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.0\libb.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.0\libb.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.1\libb.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.1\libb.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.1\policy.2.0.libb.cat
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libb-2.0.0.1\policy.2.0.libb.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-1.0.0.0\libc.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-1.0.0.0\libc.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-2.0.0.1\libc.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-2.0.0.1\libc.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-2.0.0.1\policy.2.0.libc.cat
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libc-2.0.0.1\policy.2.0.libc.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libd-1.0.0.0\libd.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libd-1.0.0.0\libd.dll.manifest
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libd-2.0.0.0\libd.dll
C:\root\projects\coapp\output\x86\debug\bin\testpackages\libd-2.0.0.0\libd.dll.manifest
[Description: fearthecowboy]<http://fearthecowboy.com/>
Garrett Serack | Microsoft's Open Source Software Developer | Microsoft Corporation
Office:(425)706-7939 email/messenger: garretts@xxxxxxxxxxxxx<mailto:garretts@xxxxxxxxxxxxx>
blog: http://fearthecowboy.com<http://fearthecowboy.com/> twitter: @fearthecowboy<http://twitter.com/fearthecowboy>
I don't make the software you use; I make the software you use better on Windows.
Follow ups