System.Data.SQLite
Check-in [f2f160939a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further refinements to the global assembly cache handling in the design-time components installer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | designOptions
Files: files | file ages | folders
SHA1: f2f160939a126a2a27a83bf42d842d40bab8d1f8
User & Date: mistachkin 2014-08-09 01:29:54
Context
2014-08-20
19:40
Merge updates from trunk. check-in: e3dd6dc7e0 user: mistachkin tags: designOptions
2014-08-09
01:29
Further refinements to the global assembly cache handling in the design-time components installer. check-in: f2f160939a user: mistachkin tags: designOptions
2014-08-08
23:17
Merge updates from trunk. check-in: eeff47049c user: mistachkin tags: designOptions
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/install/Installer.cs.

95
96
97
98
99
100
101
102


103
104
105
106
107
108
109
110
111
112
113
114






115
116
117
118
119
120
121
122
123
124





125
126
127
128
129
130
131
132
133
134
135
136
137
....
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
....
3631
3632
3633
3634
3635
3636
3637
































3638
3639
3640
3641
3642
3643
3644
....
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
....
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
....
3919
3920
3921
3922
3923
3924
3925









3926
3927
3928
3929
3930
3931
3932
....
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
....
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193




7194

7195

7196
7197

7198
7199
7200
7201
7202
7203






7204
7205
7206

7207

7208

7209
7210
7211
7212
7213
7214
7215
7216





7217
7218
7219

7220

7221

7222
7223
7224
7225
7226
7227
7228
7229


7230
7231

7232
7233

7234

7235

7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247

7248
7249

7250

7251

7252
7253
7254
7255
7256
7257
7258
7259





7260
7261
7262

7263

7264

7265
7266
7267
7268
7269
7270
7271
7272





7273
7274
7275

7276

7277

7278
7279
7280
7281
7282
7283
7284
7285






7286

7287

7288
7289

7290
7291
7292
7293
7294

7295
7296
7297
7298
7299
7300
7301

    #region Public Enumerations
    [Flags()]
    public enum InstallFlags
    {
        #region Normal Values
        None = 0x0,
        GlobalAssemblyCache = 0x1,


        AssemblyFolders = 0x2,
        DbProviderFactory = 0x4,
        VsPackage = 0x8,
        VsPackageGlobalAssemblyCache = 0x10,
        VsDataSource = 0x20,
        VsDataProvider = 0x40,
        VsDevEnvSetup = 0x80,
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Composite Values






        Framework = GlobalAssemblyCache | AssemblyFolders |
                    DbProviderFactory,

        ///////////////////////////////////////////////////////////////////////

        Vs = VsPackage | VsPackageGlobalAssemblyCache | VsDataSource |
             VsDataProvider | VsDevEnvSetup,

        ///////////////////////////////////////////////////////////////////////






        All = Framework | Vs,

        ///////////////////////////////////////////////////////////////////////

        AllExceptGlobalAssemblyCache = All & ~(GlobalAssemblyCache |
                                       VsPackageGlobalAssemblyCache),
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Suggested Default Values
        Default = All
        #endregion
................................................................................
            #endregion

            ///////////////////////////////////////////////////////////////////

            #region Private Methods
            private string GetInvariantName()
            {
                return IsEf6Supported() ? Ef6InvariantName : InvariantName;
            }
            #endregion

            ///////////////////////////////////////////////////////////////////

            #region Public Methods
            public bool HasFlags(
................................................................................
                //
                return HasFlags(ProviderFlags.SystemEf6MustBeGlobal, true) ?
                    IsSystemEf6AssemblyGlobal() : true;
            }

            ///////////////////////////////////////////////////////////////////

































            /* REQUIRED */
            public AssemblyName GetCoreAssemblyName() /* throw */
            {
                if (coreAssemblyName == null)
                {
                    coreAssemblyName = AssemblyName.GetAssemblyName(
                        CoreFileName); /* throw */
................................................................................
            }

            ///////////////////////////////////////////////////////////////////

            /* REQUIRED */
            public AssemblyName GetProviderAssemblyName() /* throw */
            {
                return IsEf6Supported() ?
                    GetEf6AssemblyName() : GetCoreAssemblyName();
            }

            ///////////////////////////////////////////////////////////////////

            public string GetConfigInvariantName()
            {
................................................................................
                return GetInvariantName();
            }

            ///////////////////////////////////////////////////////////////////

            public string GetFactoryTypeName()
            {
                return IsEf6Supported() ? Ef6FactoryTypeName : FactoryTypeName;
            }

            ///////////////////////////////////////////////////////////////////

            public void Dump(
                TraceCallback traceCallback
                )
................................................................................
                    traceCallback(String.Format(NameAndValueFormat,
                        "IsLinqSupported", ForDisplay(IsLinqSupported())),
                        traceCategory);

                    traceCallback(String.Format(NameAndValueFormat,
                        "IsEf6Supported", ForDisplay(IsEf6Supported())),
                        traceCategory);










                    ///////////////////////////////////////////////////////////

                    try
                    {
                        traceCallback(String.Format(NameAndValueFormat,
                            "GetCoreAssemblyName", ForDisplay(
................................................................................

                    InitializeVsPackage(
                        configuration.GetProviderInvariantName(),
                        configuration.GetFactoryTypeName(),
                        configuration.GetProviderAssemblyName(),
                        configuration.GetDesignerAssemblyName(),
                        configuration.HasFlags(
                            InstallFlags.GlobalAssemblyCache, true) &&
                        configuration.HasFlags(
                            InstallFlags.VsPackageGlobalAssemblyCache, true),
                        ref package);

                    ///////////////////////////////////////////////////////////

                    InitializeFrameworkList(configuration.PerUser ?
................................................................................
                        configuration.DesignerFileName, configuration.Install);
                    #endregion

                    ///////////////////////////////////////////////////////////

                    #region .NET GAC Install/Remove
                    if (configuration.HasFlags(
                            InstallFlags.GlobalAssemblyCache, true))
                    {
                        Publish publish = null;

                        if (!configuration.WhatIf)
                            publish = new Publish();

                        if (configuration.Install)
                        {




                            if (!configuration.WhatIf)

                                /* throw */

                                publish.GacInstall(configuration.CoreFileName);


                            TraceOps.DebugAndTrace(TracePriority.Highest,
                                debugCallback, traceCallback, String.Format(
                                "GacInstall: assemblyPath = {0}",
                                ForDisplay(configuration.CoreFileName)),
                                traceCategory);







                            if (configuration.IsLinqSupported())
                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacInstall(configuration.LinqFileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.LinqFileName)),
                                    traceCategory);
                            }






                            if (configuration.IsEf6Supported())
                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacInstall(configuration.Ef6FileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.Ef6FileName)),
                                    traceCategory);
                            }



                            if (configuration.HasFlags(
                                    InstallFlags.VsPackageGlobalAssemblyCache, true))

                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacInstall(configuration.DesignerFileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.DesignerFileName)),
                                    traceCategory);
                            }
                        }
                        else
                        {
                            if (configuration.HasFlags(
                                    InstallFlags.VsPackageGlobalAssemblyCache, true))

                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacRemove(configuration.DesignerFileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.DesignerFileName)),
                                    traceCategory);
                            }






                            if (configuration.IsEf6Supported())
                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacRemove(configuration.Ef6FileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.Ef6FileName)),
                                    traceCategory);
                            }






                            if (configuration.IsLinqSupported())
                            {
                                if (!configuration.WhatIf)

                                    /* throw */

                                    publish.GacRemove(configuration.LinqFileName);


                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.LinqFileName)),
                                    traceCategory);
                            }







                            if (!configuration.WhatIf)

                                /* throw */

                                publish.GacRemove(configuration.CoreFileName);


                            TraceOps.DebugAndTrace(TracePriority.Highest,
                                debugCallback, traceCallback, String.Format(
                                "GacRemove: assemblyPath = {0}",
                                ForDisplay(configuration.CoreFileName)),
                                traceCategory);

                        }
                    }
                    #endregion

                    ///////////////////////////////////////////////////////////

                    #region .NET AssemblyFolders







|
>
>
|
|
|
|
|
|
|





>
>
>
>
>
>
|









>
>
>
>
>




|
<







 







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







 







|







 







>
>
>
>
>
>
>
>
>







 







|







 







|








>
>
>
>
|
>
|
>
|
|
>
|
|
|
|
|
|
>
>
>
>
>
>
|


>

>
|
>








>
>
>
>
>
|


>

>
|
>








>
>

|
>


>

>
|
>











|
>


>

>
|
>








>
>
>
>
>
|


>

>
|
>








>
>
>
>
>
|


>

>
|
>








>
>
>
>
>
>
|
>
|
>
|
|
>
|
|
|
|
|
>







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
....
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
....
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
....
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
....
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
....
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
....
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
....
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414

    #region Public Enumerations
    [Flags()]
    public enum InstallFlags
    {
        #region Normal Values
        None = 0x0,
        CoreGlobalAssemblyCache = 0x1,
        LinqGlobalAssemblyCache = 0x2,
        Ef6GlobalAssemblyCache = 0x4,
        AssemblyFolders = 0x8,
        DbProviderFactory = 0x10,
        VsPackage = 0x20,
        VsPackageGlobalAssemblyCache = 0x40,
        VsDataSource = 0x80,
        VsDataProvider = 0x100,
        VsDevEnvSetup = 0x200,
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Composite Values
        FrameworkGlobalAssemblyCache = CoreGlobalAssemblyCache |
                                       LinqGlobalAssemblyCache |
                                       Ef6GlobalAssemblyCache,

        ///////////////////////////////////////////////////////////////////////

        Framework = FrameworkGlobalAssemblyCache | AssemblyFolders |
                    DbProviderFactory,

        ///////////////////////////////////////////////////////////////////////

        Vs = VsPackage | VsPackageGlobalAssemblyCache | VsDataSource |
             VsDataProvider | VsDevEnvSetup,

        ///////////////////////////////////////////////////////////////////////

        AllGlobalAssemblyCache = FrameworkGlobalAssemblyCache |
                                 VsPackageGlobalAssemblyCache,

        ///////////////////////////////////////////////////////////////////////

        All = Framework | Vs,

        ///////////////////////////////////////////////////////////////////////

        AllExceptGlobalAssemblyCache = All & ~AllGlobalAssemblyCache,

        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Suggested Default Values
        Default = All
        #endregion
................................................................................
            #endregion

            ///////////////////////////////////////////////////////////////////

            #region Private Methods
            private string GetInvariantName()
            {
                return UseEf6Provider() ? Ef6InvariantName : InvariantName;
            }
            #endregion

            ///////////////////////////////////////////////////////////////////

            #region Public Methods
            public bool HasFlags(
................................................................................
                //
                return HasFlags(ProviderFlags.SystemEf6MustBeGlobal, true) ?
                    IsSystemEf6AssemblyGlobal() : true;
            }

            ///////////////////////////////////////////////////////////////////

            private bool IsEf6AssemblyGlobal()
            {
                if (ef6AssemblyName == null)
                    return false;

                Assembly assembly = Assembly.ReflectionOnlyLoad(
                    ef6AssemblyName.ToString());

                return (assembly != null) && assembly.GlobalAssemblyCache;
            }

            ///////////////////////////////////////////////////////////////////

            public bool UseEf6Provider()
            {
                //
                // NOTE: We cannot use the EF6 assembly as the provider if it
                //       is not supported by this installation.
                //
                if (!IsEf6Supported())
                    return false;

                //
                // NOTE: For the EF6 assembly to be usable as a provider in
                //       the machine configuration file, it must be in the
                //       global assembly cache.
                //
                return IsEf6AssemblyGlobal();
            }

            ///////////////////////////////////////////////////////////////////

            /* REQUIRED */
            public AssemblyName GetCoreAssemblyName() /* throw */
            {
                if (coreAssemblyName == null)
                {
                    coreAssemblyName = AssemblyName.GetAssemblyName(
                        CoreFileName); /* throw */
................................................................................
            }

            ///////////////////////////////////////////////////////////////////

            /* REQUIRED */
            public AssemblyName GetProviderAssemblyName() /* throw */
            {
                return UseEf6Provider() ?
                    GetEf6AssemblyName() : GetCoreAssemblyName();
            }

            ///////////////////////////////////////////////////////////////////

            public string GetConfigInvariantName()
            {
................................................................................
                return GetInvariantName();
            }

            ///////////////////////////////////////////////////////////////////

            public string GetFactoryTypeName()
            {
                return UseEf6Provider() ? Ef6FactoryTypeName : FactoryTypeName;
            }

            ///////////////////////////////////////////////////////////////////

            public void Dump(
                TraceCallback traceCallback
                )
................................................................................
                    traceCallback(String.Format(NameAndValueFormat,
                        "IsLinqSupported", ForDisplay(IsLinqSupported())),
                        traceCategory);

                    traceCallback(String.Format(NameAndValueFormat,
                        "IsEf6Supported", ForDisplay(IsEf6Supported())),
                        traceCategory);

                    traceCallback(String.Format(NameAndValueFormat,
                        "IsEf6AssemblyGlobal", ForDisplay(
                        IsEf6AssemblyGlobal())),
                        traceCategory);

                    traceCallback(String.Format(NameAndValueFormat,
                        "UseEf6Provider", ForDisplay(UseEf6Provider())),
                        traceCategory);

                    ///////////////////////////////////////////////////////////

                    try
                    {
                        traceCallback(String.Format(NameAndValueFormat,
                            "GetCoreAssemblyName", ForDisplay(
................................................................................

                    InitializeVsPackage(
                        configuration.GetProviderInvariantName(),
                        configuration.GetFactoryTypeName(),
                        configuration.GetProviderAssemblyName(),
                        configuration.GetDesignerAssemblyName(),
                        configuration.HasFlags(
                            InstallFlags.AllGlobalAssemblyCache, true) &&
                        configuration.HasFlags(
                            InstallFlags.VsPackageGlobalAssemblyCache, true),
                        ref package);

                    ///////////////////////////////////////////////////////////

                    InitializeFrameworkList(configuration.PerUser ?
................................................................................
                        configuration.DesignerFileName, configuration.Install);
                    #endregion

                    ///////////////////////////////////////////////////////////

                    #region .NET GAC Install/Remove
                    if (configuration.HasFlags(
                            InstallFlags.AllGlobalAssemblyCache, false))
                    {
                        Publish publish = null;

                        if (!configuration.WhatIf)
                            publish = new Publish();

                        if (configuration.Install)
                        {
                            if (configuration.HasFlags(
                                    InstallFlags.CoreGlobalAssemblyCache,
                                    true))
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacInstall(
                                        configuration.CoreFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.CoreFileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.LinqGlobalAssemblyCache,
                                    true) &&
                                configuration.IsLinqSupported())
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacInstall(
                                        configuration.LinqFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.LinqFileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.Ef6GlobalAssemblyCache,
                                    true) &&
                                configuration.IsEf6Supported())
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacInstall(
                                        configuration.Ef6FileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.Ef6FileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.VsPackageGlobalAssemblyCache,
                                    true))
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacInstall(
                                        configuration.DesignerFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacInstall: assemblyPath = {0}",
                                    ForDisplay(configuration.DesignerFileName)),
                                    traceCategory);
                            }
                        }
                        else
                        {
                            if (configuration.HasFlags(
                                    InstallFlags.VsPackageGlobalAssemblyCache,
                                    true))
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacRemove(
                                        configuration.DesignerFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.DesignerFileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.Ef6GlobalAssemblyCache,
                                    true) &&
                                configuration.IsEf6Supported())
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacRemove(
                                        configuration.Ef6FileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.Ef6FileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.LinqGlobalAssemblyCache,
                                    true) &&
                                configuration.IsLinqSupported())
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacRemove(
                                        configuration.LinqFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.LinqFileName)),
                                    traceCategory);
                            }

                            ///////////////////////////////////////////////////

                            if (configuration.HasFlags(
                                    InstallFlags.CoreGlobalAssemblyCache,
                                    true))
                            {
                                if (!configuration.WhatIf)
                                {
                                    /* throw */
                                    publish.GacRemove(
                                        configuration.CoreFileName);
                                }

                                TraceOps.DebugAndTrace(TracePriority.Highest,
                                    debugCallback, traceCallback, String.Format(
                                    "GacRemove: assemblyPath = {0}",
                                    ForDisplay(configuration.CoreFileName)),
                                    traceCategory);
                            }
                        }
                    }
                    #endregion

                    ///////////////////////////////////////////////////////////

                    #region .NET AssemblyFolders