Geeks With Blogs
derekf's blog On C#, repackaging applications, and deploying via group policy...

Ok, I need to work on my ability to tell when exactly "tomorrow" is.

Last time I left off by announcing a better way to look at the guts of an AAS file instead of just looking for the first, second, and last GUIDs.  That better way is part of the MSI portion of the Platform SDK -- a VBS script named WiListScr.vbs.  On my machine the file is at \Microsoft Platform SDK\Samples\SysMgmt\Msi\Scripts (with the 2003 Server SP1 version) ; yours may vary.

Not sure of the legality of posting the script so I'm not going to do it, but what I will do is provide sample output:

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Header(Signature=1397708873,Version=200,Timestamp=879849785,LangId=1033,Platform=0,ScriptType=3,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=0)
ProductInfo(ProductKey={E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E},ProductName=MyApp 1.0,PackageName=AppName.msi,Language=1033,Version=1510
60480,Assignment=1,ObsoleteArg=0,ProductIcon=ARPICON.80486C74_ABED_4227_AF5C_9B1791CFA89C.exe,,PackageCode={1B96C48C-2DD6-4D4C-ABCD-B00570F26EC7},,,InstanceType
=0,,)
DialogInfo(Type=0,Argument=1033,1252)
DialogInfo(Type=1,Argument=MyApp 1.0)
RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
ActionStart(Name=CreateShortcuts,Description=Creating shortcuts,Template=Shortcut: [1])
SetTargetFolder(Folder=23\MyApp 1.0\)
ShortcutCreate(Name=PROGRA~2|MyAppPN,Feature=PN,Component={2AE8A409-AA18-4780-856F-DE6ED0FA4BAB},,,WorkingDir=C:\Program Files\MyApp\,Icon=Icon80951CEC.exe.C76E2E86_AE54_4AF5_997C_63EBB83C7651.exe,IconIndex=0,HotKey=0,ShowCmd=1,)
SetTargetFolder(Folder=23\MyApp\ApPFolder\)
ShortcutCreate(Name=PROGRA~1|Program Neighborhood Agent,Feature=PN_AGENT,Component={1DD10EF4-2557-4F04-A23C-9B8963D65DE0},,,WorkingDir=C:\Program Files\MyApp\,Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe,IconIndex=0,,ShowCmd=1,)
ActionStart(Name=RegisterClassInfo,Description=Registering Class servers,Template=Class Id: [1])
RegClassInfoRegister(Feature=My_App,Component={6E02C3A5-9184-4E16-8282-B40F3516DA46},,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},ProgId=MyApp.App.2.5,VIProgId=MyApp.App,Description=My App,Context=InprocServer32,,,,,,,,,)
RegClassInfoRegister(Feature=My_App,Component={6E02C3A5-9184-4E16-8282-B40F3516DA46},,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},ProgId=MyApp.AppProp.2.4,VIProgId=MyApp.AppProp,Description=My App Properties,Context=InprocServer32,,,,,,,,,)
RegClassInfoRegister(Feature=SSON_BINARIES,Component={103B82C3-601D-400C-BC42-CCF14C324A2F},,ClsId={2C22A8C9-B8C8-4B0C-8063-D63F18DB075F},,,Description=PSFactoryBuffer,Context=InprocServer32,,,,,IconIndex=0,,,,)
RegClassInfoRegister(Feature=My_App,Component={6C858A94-FC28-40F8-9BE1-F745061A2C2B},,ClsId={666006C6-C743-11D5-BA02-00C04F2EFC0F},ProgId=ProxySup.ProxySupMain.1,VIProgId=ProxySup.ProxySupMain,Description=ProxySupMain,Context=InprocServer32,,,,,IconIndex=0,,,,)
RegClassInfoRegister(Feature=SSON_BINARIES,Component={614BA753-7004-4BAD-95FC-0AAB52140FE6},,ClsId={E63F16AA-7C16-4697-826C-98B7A5092299},ProgId=SSON.Cmpnt1.1,VIProgId=SSON.Cmpnt1,Description=SSON COM component,Context=LocalServer32,,,,,IconIndex=0,DefInprocHandler=ssoncom.exe,,,)
RegClassInfoRegister(Feature=PN_AGENT,Component={260DAD21-3007-4FDB-90A5-F1390D2E2977},,ClsId={B94E2601-D7A1-11D4-A1EE-444553540000},ProgId=DesktopPortalfile.IconHandler1.0,VIProgId=DesktopPortalfile.IconHandler,Description=DesktopPortal Icon Handler,Context=InprocServer32,,,,,,,,,)
ActionStart(Name=RegisterExtensionInfo,Description=Registering extension servers,Template=Extension: [1])
RegExtensionInfoRegister(Feature=My_App,Component={DEAEF21B-4507-4142-9853-BE482CCA8FB2},,Extension=app,ProgId=MyApp.App.2.5,,,ContentType=applMyApp.Apption/x-myapp,Order=1,open,,"%1")
RegExtensionInfoRegister(Feature=PN_AGENT,Component={1DD10EF4-2557-4F04-A23C-9B8963D65DE0},,Extension=pnagent,ProgId=PNAgentFile,,,ContentType=applMyApp.Apption/x-pnagent,Order=1,open,,"%1")
ActionStart(Name=RegisterProgIdInfo,Description=Unregistering program identifiers,Template=ProgId: [1])
RegProgIdInfoRegister(ProgId=MyApp.App.2.5,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},Extension=MyApp.App,Description=My App,Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe,IconIndex=0,VIProgId=MyApp.App,VIProgIdDescription=My App,)
RegProgIdInfoRegister(ProgId=MyApp.AppProp.2.4,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},,Description=My App Properties,,,VIProgId=MyApp.AppProp,VIProgIdDescription=My App Properties,)
RegProgIdInfoRegister(ProgId=ProxySup.ProxySupMain.1,ClsId={666006C6-C743-11D5-BA02-00C04F2EFC0F},,Description=ProxySupMain,,,VIProgId=ProxySup.ProxySupMain,VIProgIdDescription=ProxySupMain,)
RegProgIdInfoRegister(ProgId=SSON.Cmpnt1.1,ClsId={E63F16AA-7C16-4697-826C-98B7A5092299},,Description=SSON COM component,,,VIProgId=SSON.Cmpnt1,VIProgIdDescription=SSON COM component,)
RegProgIdInfoRegister(ProgId=MyApp.App.2,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=My App,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.App.2.1,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=My App,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.App.2.2,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=My App,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.App.2.3,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=My App,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.App.2.4,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=My App,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.AppProp.2,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},,,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.AppProp.2.1,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},,Description=My App Properties,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.AppProp.2.2,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},,Description=My App Properties,,,,,)
RegProgIdInfoRegister(ProgId=MyApp.AppProp.2.3,ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3},,Description=My App Properties,,,,,)
RegProgIdInfoRegister(ProgId=WinFrameMyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3},,Description=MyApp.File,Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe,IconIndex=0,,,)
RegProgIdInfoRegister(ProgId=Appfile.IconHandler1.0,ClsId={B94E2601-D7A1-11D4-A1EE-444553540000},,Description=App Icon Handler,,,VIProgId=DesktopPortalfile.IconHandler,VIProgIdDescription=DesktopPortal Icon Handler,)
RegProgIdInfoRegister(ProgId=PNAgentFile,,Extension=pnagent,Description=MyAppPN Agent File,Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe,IconIndex=0,,,)
ActionStart(Name=RegisterMIMEInfo,Description=Registering MIME info,Template=MIME Content Type: [1], Extension: [2])
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=euc-jp,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=UTF8,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=UTF-8,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=MS950,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=MS949,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=MS936,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App;charset=ISO-8859-1,Extension=app,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=euc-jp,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=UTF8,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=UTF-8,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=MS950,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=MS949,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=MS936,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=applMyApp.Apption/x-MyApp.App; charset=ISO-8859-1,Extension=MyApp.App,ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3})
RegMIMEInfoRegister(ContentType=application/x-pnagent,Extension=pnagent,ClsId={B94E2601-D7A1-11D4-A1EE-444553540000})
ActionStart(Name=PublishFeatures,Description=Publishing Product Features,Template=Feature: [1])
FeaturePublish(Feature=My_App,,Absent=0,)
FeaturePublish(Feature=PN,Parent=My_App,Absent=0,)
FeaturePublish(Feature=PN_AGENT,Parent=My_App,Absent=0,)
FeaturePublish(Feature=WEB_CLIENT,Parent=My_App,Absent=0,)
FeaturePublish(Feature=SSON_BINARIES,,Absent=0,)
FeaturePublish(Feature=SSON_SETTINGS,,Absent=1,)
ActionStart(Name=PublishProduct,Description=Publishing product information,)
IconCreate(Icon=ARPICON.80486C74_ABED_4227_AF5C_9B1791CFA89C.exe,Data=BinaryData)
IconCreate(Icon=Icon80951CEC.exe.C76E2E86_AE54_4AF5_997C_63EBB83C7651.exe,Data=BinaryData)
IconCreate(Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe,Data=BinaryData)
IconCreate(Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe,Data=BinaryData)
ProductPublish(PackageKey={1B96C48C-2DD6-4D4C-ABCD-B00570F26EC7})
UpgradeCodePublish(UpgradeCode={94F321B9-45B0-4125-970D-DE3D98CBCA1C})
SourceListPublish(,,,,NumberOfDisks=3,1,,LABEL,2,,LABEL,3,,LABEL,\\server\share\MyApp.10\)
ProductPublishClient(,,)
ActionStart(Name=HideCancelButton.827545C6_7013_4DE1_8E6C_DAEE4C57F54A,,)
CustomActionSchedule(Action=HideCancelButton.827545C6_7013_4DE1_8E6C_DAEE4C57F54A,ActionType=3137,Source=BinaryData,Target=HideCancelButton,)
ActionStart(Name=AdvertiseLNK2Type.827545C6_7013_4DE1_8E6C_DAEE4C57F54A,,)
CustomActionSchedule(Action=AdvertiseLNK2Type.827545C6_7013_4DE1_8E6C_DAEE4C57F54A,ActionType=3137,Source=BinaryData,Target=AdvertiseLNK2Type,)
ActionStart(Name=FixDesktopPNIcon.C76E2E86_AE54_4AF5_997C_63EBB83C7651,,)
CustomActionSchedule(Action=FixDesktopPNIcon.C76E2E86_AE54_4AF5_997C_63EBB83C7651,ActionType=3137,Source=BinaryData,Target=FixDesktopPNIcon,CustomActionData=C:\
Documents and Settings\All Users\Desktop\MyApp.lnk2)
End(Checksum=0,ProgressTotalHDWord=0,)

A bit on the hard-to-read side, but way more information than what last time was able to extract.  The information from last time is here:

ProductInfo(ProductKey={E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E}

PackageCode={1B96C48C-2DD6-4D4C-ABCD-B00570F26EC7}

UpgradeCodePublish(UpgradeCode={94F321B9-45B0-4125-970D-DE3D98CBCA1C})

but I'm not a big fan of using batch files piping output through Find.exe to get what I need to know.

Instead, I wanted to go ahead and write an equivalent function in C#, since a) I don't really do VB or VBS, and b) as junior C# coder, anything I can convert over is a good thing as I get to learn while doing it.

Not too much of the VBS code could be used -- it uses "CreateObject("WindowsInstaller.Installer")" to spawn the Installer object, which is not the C# way.  The big thing to find in the VBS code is the "msiOpenDatabaseModeListScript" constant (which is set to 5) -- the MSDN page for OpenDatabase doesn't list a value of 5 (just 1, 2, 3, 4, and 32).

Armed with the knowledge that OpenDatabase with an OpenMode of 5 cracks open AAS files, we end up with this (yes, you get no fancy colored source - looks like I get my choice of colors or indent, and I choose proper indentation):

 if (Environment.GetCommandLineArgs().Length == 1)
                Environment.Exit(0);
            String AASPath = Environment.GetCommandLineArgs()[1];

            //accept paths with spaces and no quotes
            for (int i = 2; i <= Environment.GetCommandLineArgs().GetUpperBound(0); i++)
            {
                AASPath = AASPath + " " + Environment.GetCommandLineArgs()[i];
            }

            IntPtr dbhandle = IntPtr.Zero;
            IntPtr viewhandle = IntPtr.Zero;
            IntPtr rechandle = IntPtr.Zero;

            MsiOpenDatabase(AASPath, (IntPtr)msiOpenDatabaseModeListScript, ref dbhandle);

            int nres = MsiDatabaseOpenView(dbhandle, "", ref viewhandle);
            while (MsiViewFetch(viewhandle, ref rechandle) == 0)
            {
                int Col0Len = 512;
                StringBuilder Definition = new StringBuilder(Col0Len);

                nres = MsiRecordGetString(rechandle, 0, Definition, ref Col0Len);
                for (int i = 1; i < 20; i++)
                {
                    int outlen = 255;
                    StringBuilder outbuff = new StringBuilder(outlen);
                    nres = MsiRecordGetString(rechandle, i, outbuff, ref outlen);
                    if (nres == 0)
                    {
                        if (Definition.ToString().Contains("[" + i + "]"))
                        {
                            Definition.Replace("[" + i + "]", outbuff.ToString());
                        }
                        else if (outbuff.Length > 0)
                            Definition.Append(", " + outbuff);
                    }
                }
                txtOut1.Text += Definition.ToString() + "\n";
            }

You'll need the declarations and P/Invoke definitions (here I don't care so much about indent)

public enum tagMSIColInfo

{

MSICOLINFO_NAMES = 0,

MSICOLINFO_TYPES = 1

}

public const int msiOpenDatabaseModeListScript = 5;

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiOpenDatabase(string dbpath, IntPtr openMode, ref IntPtr msihandle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiDatabaseOpenView(IntPtr handle, string query, ref IntPtr viewhandle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiViewExecute(IntPtr viewhandle, IntPtr recordhandle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiViewFetch(IntPtr viewhandle, ref IntPtr recordhandle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiRecordGetString(IntPtr recordhandle, int recno, StringBuilder szbuff, ref int len);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiCloseHandle(IntPtr handle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiViewClose(IntPtr viewhandle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiSummaryInfoGetProperty(IntPtr handle, int uiProperty, ref int puiDataType, ref int piValue, ref System.Runtime.InteropServices.ComTypes.FILETIME pftValue, String szValueBuf, ref int pcchValueBuf);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiGetSummaryInformation(IntPtr msihandle, string szDatabasePath, int uiUpdateCount, ref IntPtr SummaryInfo);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiSummaryInfoPersist(IntPtr summary_handle);

[DllImport("msi", CharSet = CharSet.Auto)]

public static extern int MsiViewGetColumnInfo(ref IntPtr hView, tagMSIColInfo tag, IntPtr record);

 

Column zero in a given row contains the definition for the row in a strange format.  The first row of the same AAS as the VBS went through looks like this:

{Header({Signature=[1]},{Version=[2]},{Timestamp=[3]},{LangId=[4]},{Platform=[5]},{ScriptType=[6]},{ScriptMajorVersion=[7]},{ScriptMinorVersion=[8]},{ScriptAttributes=[9]})}

and then columns 1 through 9 contain the values for those items.

The output of this code looks something like this:

Header({Signature=1397708873},{Version=200},{Timestamp=879849785},{LangId=1033},{Platform=0},{ScriptType=3},{ScriptMajorVersion=21},{ScriptMinorVersion=4},{ScriptAttributes=0})
ProductInfo({ProductKey={E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E}},{ProductName=MyApp 1.0},{PackageName=MyApp.msi},{Language=1033},{Version=151060480},{Assignment=1},{ObsoleteArg=0},{ProductIcon=ARPICON.80486C74_ABED_4227_AF5C_9B1791CFA89C.exe},{PackageMediaPath=},{PackageCode={1B96C48C-2DD6-4D4C-ABCD-B00570F26EC7}},{AppCompatDB=},{AppCompatID=},{InstanceType=0},{LUASetting=},{RemoteURTInstalls=})
DialogInfo({Type=0},{Argument=1033}), 1252
DialogInfo({Type=1},{Argument=MyApp 1.0})
RollbackInfo({Reserved=},{RollbackAction=Rollback},{RollbackDescription=Rolling back action:},{RollbackTemplate=[1]},{CleanupAction=RollbackCleanup},{CleanupDescription=Removing backup files},{CleanupTemplate=File: [1]})
ActionStart({Name=CreateShortcuts},{Description=Creating shortcuts},{Template=Shortcut: [1]})
SetTargetFolder({Folder=23\MyApp 1.0\})
ShortcutCreate({Name=PROGRA~2|MyAppPN},{Feature=PN},{Component={2AE8A409-AA18-4780-856F-DE6ED0FA4BAB}},{FileName=},{Arguments=},{WorkingDir=C:\Program Files\MyApp\},{Icon=Icon80951CEC.exe.C76E2E86_AE54_4AF5_997C_63EBB83C7651.exe},{IconIndex=0},{HotKey=0},{ShowCmd=1},{Description=})
SetTargetFolder({Folder=23\MyApp\MyApp Clients\})
ShortcutCreate({Name=PROGRA~1|Program Neighborhood Agent},{Feature=PN_AGENT},{Component={1DD10EF4-2557-4F04-A23C-9B8963D65DE0}},{FileName=},{Arguments=},{WorkingDir=C:\Program Files\MyApp\},{Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe},{IconIndex=0},{HotKey=},{ShowCmd=1},{Description=})
ActionStart({Name=RegisterClassInfo},{Description=Registering Class servers},{Template=Class Id: [1]})
RegClassInfoRegister({Feature=My_App},{Component={6E02C3A5-9184-4E16-8282-B40F3516DA46}},{FileName=},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{ProgId=MyApp.App.2.5},{VIProgId=MyApp.App},{Description=My App},{Context=InprocServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=},{DefInprocHandler=},{Argument=},{AssemblyName=},{AssemblyType=})
RegClassInfoRegister({Feature=My_App},{Component={6E02C3A5-9184-4E16-8282-B40F3516DA46}},{FileName=},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{ProgId=MyApp.AppProp.2.4},{VIProgId=MyApp.AppProp},{Description=My App Properties},{Context=InprocServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=},{DefInprocHandler=},{Argument=},{AssemblyName=},{AssemblyType=})
RegClassInfoRegister({Feature=SSON_BINARIES},{Component={103B82C3-601D-400C-BC42-CCF14C324A2F}},{FileName=},{ClsId={2C22A8C9-B8C8-4B0C-8063-D63F18DB075F}},{ProgId=},{VIProgId=},{Description=PSFactoryBuffer},{Context=InprocServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=0},{DefInprocHandler=},{Argument=},{AssemblyName=},{AssemblyType=})
RegClassInfoRegister({Feature=My_App},{Component={6C858A94-FC28-40F8-9BE1-F745061A2C2B}},{FileName=},{ClsId={666006C6-C743-11D5-BA02-00C04F2EFC0F}},{ProgId=ProxySup.ProxySupMain.1},{VIProgId=ProxySup.ProxySupMain},{Description=ProxySupMain},{Context=InprocServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=0},{DefInprocHandler=},{Argument=},{AssemblyName=},{AssemblyType=})
RegClassInfoRegister({Feature=SSON_BINARIES},{Component={614BA753-7004-4BAD-95FC-0AAB52140FE6}},{FileName=},{ClsId={E63F16AA-7C16-4697-826C-98B7A5092299}},{ProgId=SSON.Cmpnt1.1},{VIProgId=SSON.Cmpnt1},{Description=SSON COM component},{Context=LocalServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=0},{DefInprocHandler=ssoncom.exe},{Argument=},{AssemblyName=},{AssemblyType=})
RegClassInfoRegister({Feature=PN_AGENT},{Component={260DAD21-3007-4FDB-90A5-F1390D2E2977}},{FileName=},{ClsId={B94E2601-D7A1-11D4-A1EE-444553540000}},{ProgId=DesktopPortalfile.IconHandler1.0},{VIProgId=DesktopPortalfile.IconHandler},{Description=DesktopPortal Icon Handler},{Context=InprocServer32},{Insertable=},{AppID=},{FileTypeMask=},{Icon=},{IconIndex=},{DefInprocHandler=},{Argument=},{AssemblyName=},{AssemblyType=})
ActionStart({Name=RegisterExtensionInfo},{Description=Registering extension servers},{Template=Extension: [1]})
RegExtensionInfoRegister({Feature=My_App},{Component={DEAEF21B-4507-4142-9853-BE482CCA8FB2}},{FileName=},{Extension=app},{ProgId=MyApp.App.2.5},{ShellNew=},{ShellNewValue=},{ContentType=application/x-myapp},{Order=1}), open, "%1"
RegExtensionInfoRegister({Feature=PN_AGENT},{Component={1DD10EF4-2557-4F04-A23C-9B8963D65DE0}},{FileName=},{Extension=pnagent},{ProgId=PNAgentFile},{ShellNew=},{ShellNewValue=},{ContentType=application/x-pnagent},{Order=1}), open, "%1"
ActionStart({Name=RegisterProgIdInfo},{Description=Unregistering program identifiers},{Template=ProgId: [1]})
RegProgIdInfoRegister({ProgId=MyApp.App.2.5},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=app},{Description=My App},{Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe},{IconIndex=0},{VIProgId=MyApp.App},{VIProgIdDescription=My App},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.AppProp.2.4},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App Properties},{Icon=},{IconIndex=},{VIProgId=MyApp.AppProp},{VIProgIdDescription=My App Properties},{Insertable=})
RegProgIdInfoRegister({ProgId=ProxySup.ProxySupMain.1},{ClsId={666006C6-C743-11D5-BA02-00C04F2EFC0F}},{Extension=},{Description=ProxySupMain},{Icon=},{IconIndex=},{VIProgId=ProxySup.ProxySupMain},{VIProgIdDescription=ProxySupMain},{Insertable=})
RegProgIdInfoRegister({ProgId=SSON.Cmpnt1.1},{ClsId={E63F16AA-7C16-4697-826C-98B7A5092299}},{Extension=},{Description=SSON COM component},{Icon=},{IconIndex=},{VIProgId=SSON.Cmpnt1},{VIProgIdDescription=SSON COM component},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.App.2},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.App.2.1},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.App.2.2},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.App.2.3},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.App.2.4},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.AppProp.2},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.AppProp.2.1},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App Properties},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.AppProp.2.2},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App Properties},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp.AppProp.2.3},{ClsId={238F6F85-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=My App Properties},{Icon=},{IconIndex=},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=MyApp},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}},{Extension=},{Description=MyApp Connection},{Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe},{IconIndex=0},{VIProgId=},{VIProgIdDescription=},{Insertable=})
RegProgIdInfoRegister({ProgId=DesktopPortalfile.IconHandler1.0},{ClsId={B94E2601-D7A1-11D4-A1EE-444553540000}},{Extension=},{Description=DesktopPortal Icon Handler},{Icon=},{IconIndex=},{VIProgId=DesktopPortalfile.IconHandler},{VIProgIdDescription=DesktopPortal Icon Handler},{Insertable=})
RegProgIdInfoRegister({ProgId=PNAgentFile},{ClsId=},{Extension=pnagent},{Description=MyAppPN Agent File},{Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe},{IconIndex=0},{VIProgId=},{VIProgIdDescription=},{Insertable=})
ActionStart({Name=RegisterMIMEInfo},{Description=Registering MIME info},{Template=MIME Content Type: [1], Extension: [2]})
RegMIMEInfoRegister({ContentType=application/x-myapp},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=euc-jp},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=UTF8},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=UTF-8},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=MS950},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=MS949},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=MS936},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp;charset=ISO-8859-1},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=euc-jp},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=UTF8},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=UTF-8},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=MS950},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=MS949},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=MS936},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-myapp; charset=ISO-8859-1},{Extension=app},{ClsId={238F6F83-B8B4-11CF-8771-00A024541EE3}})
RegMIMEInfoRegister({ContentType=application/x-pnagent},{Extension=pnagent},{ClsId={B94E2601-D7A1-11D4-A1EE-444553540000}})
ActionStart({Name=PublishFeatures},{Description=Publishing Product Features},{Template=Feature: [1]})
FeaturePublish({Feature=My_App},{Parent=},{Absent=0},{Component=})
FeaturePublish({Feature=PN},{Parent=My_App},{Absent=0},{Component=})
FeaturePublish({Feature=PN_AGENT},{Parent=My_App},{Absent=0},{Component=})
FeaturePublish({Feature=WEB_CLIENT},{Parent=My_App},{Absent=0},{Component=})
FeaturePublish({Feature=SSON_BINARIES},{Parent=},{Absent=0},{Component=})
FeaturePublish({Feature=SSON_SETTINGS},{Parent=},{Absent=1},{Component=})
ActionStart({Name=PublishProduct},{Description=Publishing product information},{Template=})
IconCreate({Icon=ARPICON.80486C74_ABED_4227_AF5C_9B1791CFA89C.exe},{Data=[2]})
IconCreate({Icon=Icon80951CEC.exe.C76E2E86_AE54_4AF5_997C_63EBB83C7651.exe},{Data=[2]})
IconCreate({Icon=Iconlights.ico.827545C6_7013_4DE1_8E6C_DAEE4C57F54A.exe},{Data=[2]})
IconCreate({Icon=Icon80951CEC.exe.20FBBF0A_A7E5_4BDE_9798_9811C3D135AC.exe},{Data=[2]})
ProductPublish({PackageKey={1B96C48C-2DD6-4D4C-ABCD-B00570F26EC7}})
UpgradeCodePublish({UpgradeCode={94F321B9-45B0-4125-970D-DE3D98CBCA1C}})
SourceListPublish({PatchCode=},{PatchPackageName=},{DiskPromptTemplate=},{PackagePath=},{NumberOfDisks=3}), 1, LABEL, 2, LABEL, 3, LABEL, \\Server\share\MyApp.10\
ProductPublishClient({Parent=},{ChildPackagePath=},{ChildDiskId=})
ActionStart({Name=HideCancelButton.827545C6_7013_4DE1_8E6C_DAEE4C57F54A},{Description=},{Template=})
CustomActionSchedule({Action=HideCancelButton.827545C6_7013_4DE1_8E6C_DAEE4C57F54A},{ActionType=3137},{Source=[3]},{Target=HideCancelButton},{CustomActionData=})
ActionStart({Name=AdvertiseLNK2Type.827545C6_7013_4DE1_8E6C_DAEE4C57F54A},{Description=},{Template=})
CustomActionSchedule({Action=AdvertiseLNK2Type.827545C6_7013_4DE1_8E6C_DAEE4C57F54A},{ActionType=3137},{Source=[3]},{Target=AdvertiseLNK2Type},{CustomActionData=})
ActionStart({Name=FixDesktopPNIcon.C76E2E86_AE54_4AF5_997C_63EBB83C7651},{Description=},{Template=})
CustomActionSchedule({Action=FixDesktopPNIcon.C76E2E86_AE54_4AF5_997C_63EBB83C7651},{ActionType=3137},{Source=[3]},{Target=FixDesktopPNIcon},{CustomActionData=C:\Documents and Settings\All Users\Desktop\MyAppPN.lnk2})
End({Checksum=0},{ProgressTotalHDWord=0},{ProgressTotalLDWord=})

It's not the same -- possibly even harder to read; but I can work with this versus the VBS. 

As written, if an extra value is found it's appended to the line:

DialogInfo({Type=0},{Argument=1033}), 1252

started as

DialogInfo({Type=[0]},{Argument=[1]})

No idea what the 1252 is supposed to be.

The code has issues: witness the unfilled text boxes in lines such as

RollbackInfo({Reserved=},{RollbackAction=Rollback},{RollbackDescription=Rolling back action:},{RollbackTemplate=[1]},{CleanupAction=RollbackCleanup},{CleanupDescription=Removing backup files},{CleanupTemplate=File: [1]})

In these cases the initial line was:

{RollbackInfo({Reserved=[1]},{RollbackAction=[2]},{RollbackDescription=[3]},{RollbackTemplate=[4]},{CleanupAction=[5]},{CleanupDescription=[6]},{CleanupTemplate=[7]})}

but the value for [4] and [7] was the characters "[1]".  No extra values were found in that row.  I'm vaguely vindicated by the fact that the VBS also has [1] for those values, although there are a few cases where the output differs (IconCreate, ActionStart).  Hey, I warned you that I was the junior C# guy, right?

The AAS file is only half of the equation for app publishing via GPO though; next time we'll dig through AD and the following couple of posts will tie it together. 

 

Edit: Oh -- and apparently the BLOCKQUOTE tag breaks things with this software. Sorry about that. Posted on Saturday, January 6, 2007 2:13 AM | Back to top


Comments on this post: AAS: Under the hood

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © derekf | Powered by: GeeksWithBlogs.net