System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation

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

Overview
Comment:Fix method names in trace messages and require the -confirm command line option prior to making any changes to the system.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 793e9b039d165c768114c4c646c9ee1b2e44e03d
User & Date: mistachkin 2011-08-09 20:52:00
Context
2011-08-09
22:24
Refactor installer registry key helper methods into their own class and keep track of basic usage stats for reporting at the end. check-in: 7ff0314780 user: mistachkin tags: trunk
20:52
Fix method names in trace messages and require the -confirm command line option prior to making any changes to the system. check-in: 793e9b039d user: mistachkin tags: trunk
07:32
Make sure the output directory exists prior to creating the source and binary release packages. check-in: c00b53012c user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/install/Installer.cs.

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355

            public static string Trace(
                TraceCallback traceCallback,
                string message,
                string category
                )
            {
                return Trace(traceCallback, null, 1, message, category);
            }

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

            private static string Trace(
                TraceCallback traceCallback,
                StackTrace stackTrace,







|







341
342
343
344
345
346
347
348
349
350
351
352
353
354
355

            public static string Trace(
                TraceCallback traceCallback,
                string message,
                string category
                )
            {
                return Trace(traceCallback, null, 0, message, category);
            }

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

            private static string Trace(
                TraceCallback traceCallback,
                StackTrace stackTrace,
2836
2837
2838
2839
2840
2841
2842
2843

2844
2845
2846
2847
2848
2849
2850
                bool noNetFx40,
                bool noVs2008,
                bool noVs2010,
                bool noTrace,
                bool noConsole,
                bool noLog,
                bool whatIf,
                bool verbose

                )
            {
                this.assembly = assembly;
                this.logFileName = logFileName;
                this.directory = directory;
                this.coreFileName = coreFileName;
                this.linqFileName = linqFileName;







|
>







2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
                bool noNetFx40,
                bool noVs2008,
                bool noVs2010,
                bool noTrace,
                bool noConsole,
                bool noLog,
                bool whatIf,
                bool verbose,
                bool confirm
                )
            {
                this.assembly = assembly;
                this.logFileName = logFileName;
                this.directory = directory;
                this.coreFileName = coreFileName;
                this.linqFileName = linqFileName;
2858
2859
2860
2861
2862
2863
2864

2865
2866
2867
2868
2869
2870
2871
                this.noVs2008 = noVs2008;
                this.noVs2010 = noVs2010;
                this.noTrace = noTrace;
                this.noConsole = noConsole;
                this.noLog = noLog;
                this.whatIf = whatIf;
                this.verbose = verbose;

            }
            #endregion

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

            #region Private Static Methods
            private static void GetDefaultFileNames(







>







2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
                this.noVs2008 = noVs2008;
                this.noVs2010 = noVs2010;
                this.noTrace = noTrace;
                this.noConsole = noConsole;
                this.noLog = noLog;
                this.whatIf = whatIf;
                this.verbose = verbose;
                this.confirm = confirm;
            }
            #endregion

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

            #region Private Static Methods
            private static void GetDefaultFileNames(
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
                    ref directory, ref coreFileName, ref linqFileName,
                    ref designerFileName);

                return new Configuration(
                    thisAssembly, null, directory, coreFileName, linqFileName,
                    designerFileName, InstallFlags.Default, true, false, true,
                    false, false, false, false, false, false, false, true,
                    true);
            }

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

            public static bool FromArgs(
                string[] args,
                bool strict,







|







3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
                    ref directory, ref coreFileName, ref linqFileName,
                    ref designerFileName);

                return new Configuration(
                    thisAssembly, null, directory, coreFileName, linqFileName,
                    designerFileName, InstallFlags.Default, true, false, true,
                    false, false, false, false, false, false, false, true,
                    true, false);
            }

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

            public static bool FromArgs(
                string[] args,
                bool strict,
3227
3228
3229
3230
3231
3232
3233



















3234
3235
3236
3237
3238
3239
3240
                                    if (strict)
                                        return false;

                                    continue;
                                }

                                configuration.verbose = (bool)value;



















                            }
                            else if (MatchOption(newArg, "noDesktop"))
                            {
                                bool? value = ParseBoolean(text);

                                if (value == null)
                                {







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







3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
                                    if (strict)
                                        return false;

                                    continue;
                                }

                                configuration.verbose = (bool)value;
                            }
                            else if (MatchOption(newArg, "confirm"))
                            {
                                bool? value = ParseBoolean(text);

                                if (value == null)
                                {
                                    error = TraceOps.Trace(traceCallback, String.Format(
                                        "Invalid {0} boolean value: {1}",
                                        ForDisplay(arg), ForDisplay(text)),
                                        traceCategory);

                                    if (strict)
                                        return false;

                                    continue;
                                }

                                configuration.confirm = (bool)value;
                            }
                            else if (MatchOption(newArg, "noDesktop"))
                            {
                                bool? value = ParseBoolean(text);

                                if (value == null)
                                {
3506
3507
3508
3509
3510
3511
3512
















3513
3514
3515
3516
3517
3518
3519
                    //
                    if (!configuration.whatIf && Debugger.IsAttached)
                    {
                        TraceOps.Trace(traceCallback,
                            "Forced to disable \"what-if\" mode with " +
                            "debugger attached.", traceCategory);
                    }

















                    return true;
                }
                catch (Exception e)
                {
                    TraceOps.Trace(traceCallback, e, traceCategory);








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







3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
                    //
                    if (!configuration.whatIf && Debugger.IsAttached)
                    {
                        TraceOps.Trace(traceCallback,
                            "Forced to disable \"what-if\" mode with " +
                            "debugger attached.", traceCategory);
                    }

                    //
                    // NOTE: If the command line has not been manually
                    //       confirmed (i.e. via the explicit command line
                    //       option), then stop processing now.  We enforce
                    //       this rule so that simply double-clicking the
                    //       executable will not result in any changes being
                    //       made to the system.
                    //
                    if (!configuration.confirm)
                    {
                        error = "Cannot continue, the \"confirm\" option is " +
                            "not enabled.";

                        return false;
                    }

                    return true;
                }
                catch (Exception e)
                {
                    TraceOps.Trace(traceCallback, e, traceCategory);

3615
3616
3617
3618
3619
3620
3621




3622
3623
3624
3625
3626
3627
3628
                    traceCallback(String.Format(NameAndValueFormat,
                        "WhatIf", ForDisplay(whatIf)),
                        traceCategory);

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




                }
            }
            #endregion

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

            #region Public Properties







>
>
>
>







3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
                    traceCallback(String.Format(NameAndValueFormat,
                        "WhatIf", ForDisplay(whatIf)),
                        traceCategory);

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

                    traceCallback(String.Format(NameAndValueFormat,
                        "Confirm", ForDisplay(confirm)),
                        traceCategory);
                }
            }
            #endregion

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

            #region Public Properties
3790
3791
3792
3793
3794
3795
3796









3797
3798
3799
3800
3801
3802
3803

            private bool verbose;
            public bool Verbose
            {
                get { return verbose; }
                set { verbose = value; }
            }









            #endregion
        }
        #endregion

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

        #region Application Entry Point







>
>
>
>
>
>
>
>
>







3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853

            private bool verbose;
            public bool Verbose
            {
                get { return verbose; }
                set { verbose = value; }
            }

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

            private bool confirm;
            public bool Confirm
            {
                get { return confirm; }
                set { confirm = value; }
            }
            #endregion
        }
        #endregion

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

        #region Application Entry Point