download SetupNgen.cs
Language: C#
LOC: 544
Project Info
paint-mono - An unofficial effort to port ...Mono.(paint-mono)
Server: Google
Type: svn
...t‑mono\trunk\src\SetupNgen\
   AssemblyInfo.cs
   SetupNgen.cs
   SetupNgen.csproj

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
/////////////////////////////////////////////////////////////////////////////////
// Mono Paint                                                                   //
// Copyright (C) Rick Brewster, Tom Jackson, and past contributors.            //
// Portions Copyright (C) Microsoft Corporation. All Rights Reserved.          //
// See src/Resources/Files/License.txt for full licensing and attribution      //
// details.                                                                    //
// .                                                                           //
/////////////////////////////////////////////////////////////////////////////////

using Microsoft.Win32;
using PaintDotNet;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace PaintDotNet
{
    class SetupNgen
    {
        [ComImport]
        [Guid("0000010c-0000-0000-c000-000000000046")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IPersist
        {
            [PreserveSig]
            void GetClassID(out Guid pClassID);
        }

        [ComImport]
        [Guid("0000010b-0000-0000-C000-000000000046")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IPersistFile
            : IPersist
        {
            new void GetClassID(out Guid pClassID);

            [PreserveSig]
            int IsDirty();

            [PreserveSig]
            void Load(
                [MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
                uint dwMode);

            [PreserveSig]
            void Save(
                [MarshalAs(UnmanagedType.LPWStr)] string pszFileName,
                [MarshalAs(UnmanagedType.Bool)] bool fRemember);

            [PreserveSig]
            void SaveCompleted([MarshalAs(UnmanagedType.LPWStr)] string pszFileName);

            [PreserveSig]
            void GetCurFile([MarshalAs(UnmanagedType.LPWStr)] string ppszFileName);
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct FILETIME
        {
            uint dwLowDateTime;
            uint dwHighDateTime;
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
        public struct WIN32_FIND_DATA
        {
            public const int MAX_PATH = 260;

            uint dwFileAttributes;
            FILETIME ftCreationTime;
            FILETIME ftLastAccessTime;
            FILETIME ftLastWriteTime;
            uint nFileSizeHight;
            uint nFileSizeLow;
            uint dwOID;

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
            string cFileName;
        }

        [ComImport]
        [Guid("000214F9-0000-0000-C000-000000000046")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        public interface IShellLink
        {
            [PreserveSig]
            void GetPath(
                [MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 1)] out string pszFile,
                int cch,
                ref WIN32_FIND_DATA pfd,
                uint fFlags);

            [PreserveSig]
            void GetIDList(out IntPtr ppidl);

            [PreserveSig]
            void SetIDList(IntPtr ppidl);

            [PreserveSig]
            void GetDescription(
                [MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 1)] out string pszName,
                int cch);

            [PreserveSig]
            void SetDescription(
                [MarshalAs(UnmanagedType.LPWStr)] string pszName);

            [PreserveSig]
            void GetWorkingDirectory(
                [MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 1)] out string pszDir,
                int cch);

            [PreserveSig]
            void SetWorkingDirectory(
                [MarshalAs(UnmanagedType.LPWStr)] string pszDir);

            [PreserveSig]
            void GetArguments(
                [MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 1)] out string pszArgs,
                int cch);

            [PreserveSig]
            void SetArguments(
                [MarshalAs(UnmanagedType.LPWStr)] string pszArgs);

            [PreserveSig]
            void GetHotkey(out ushort pwHotkey);

            [PreserveSig]
            void SetHotkey(ushort wHotkey);

            [PreserveSig]
            void GetShowCmd(out int piShowCmd);

            [PreserveSig]
            void SetShowCmd(int iShowCmd);

            [PreserveSig]
            void GetIconLocation(
                [MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 1)] out string pszIconPath,
                int cch,
                out int piIcon);

            [PreserveSig]
            void SetIconLocation(
                [MarshalAs(UnmanagedType.LPWStr)] string pszIconPath,
                int iIcon);

            [PreserveSig]
            void SetRelativePath(
                [MarshalAs(UnmanagedType.LPWStr)] string pszPathRel,
                uint dwReserved);

            [PreserveSig]
            void Resolve(
                IntPtr hwnd,
                uint fFlags);

            [PreserveSig]
            void SetPath(
                [MarshalAs(UnmanagedType.LPWStr)] string pszFile);
        }

        [GuidAttribute("00021401-0000-0000-C000-000000000046")]
        [ClassInterfaceAttribute(ClassInterfaceType.None)]
        [ComImportAttribute()]
        public class CShellLink
        {
        }

        public const int SW_SHOWNORMAL = 1;

        private static readonly string ourPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

        static void InstallAssembly(string name, bool delete, bool queue)
        {
            InstallAssembly(name, delete, queue, false);
        }

        static void InstallAssembly(string name, bool delete, bool queue, bool force32bit)
        {
            // ngen it
            if (delete)
            {
                name = Path.GetFileName(name);
                name = Path.ChangeExtension(name, null);
            }
            else
            {
                name = Path.Combine(ourPath, name);
            }

            string actionArg = delete ? "uninstall" : "install";
            string nameArg = "\"" + name + "\"";

            string queueArg = (queue && !delete) ? "/queue" : "";
            string appBaseArg = " /AppBase:\"" + ourPath + "\"";
            string optionsArg = queueArg + appBaseArg;

            string argList = actionArg + " " + nameArg + " " + optionsArg;

            string ngenExe = PaintDotNet.PdnInfo.GetNgenPath(force32bit);
            ProcessStartInfo psi1 = new ProcessStartInfo(ngenExe, argList);

            psi1.UseShellExecute = false;
            psi1.CreateNoWindow = true;
            Console.WriteLine("run:" + ngenExe + " " + argList);
            Process process1 = Process.Start(psi1);
            process1.WaitForExit();
        }

        private enum Platform
        {
            X86,
            X64,
            Unknown
        }

        internal const ushort PROCESSOR_ARCHITECTURE_INTEL = 0;
        internal const ushort PROCESSOR_ARCHITECTURE_IA64 = 6;
        internal const ushort PROCESSOR_ARCHITECTURE_AMD64 = 9;
        internal const ushort PROCESSOR_ARCHITECTURE_UNKNOWN = 0xFFFF;

        [StructLayout(LayoutKind.Sequential)]
        internal struct SYSTEM_INFO
        {
            public ushort wProcessorArchitecture;
            public ushort wReserved;
            public uint dwPageSize;
            public IntPtr lpMinimumApplicationAddress;
            public IntPtr lpMaximumApplicationAddress;
            public UIntPtr dwActiveProcessorMask;
            public uint dwNumberOfProcessors;
            public uint dwProcessorType;
            public uint dwAllocationGranularity;
            public ushort wProcessorLevel;
            public ushort wProcessorRevision;
        };

        [DllImport("kernel32.dll")]
        internal static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);        
        
        private static Platform GetPlatform()
        {
            SYSTEM_INFO sysInfo = new SYSTEM_INFO();
            GetNativeSystemInfo(ref sysInfo);

            switch (sysInfo.wProcessorArchitecture)
            {
                case PROCESSOR_ARCHITECTURE_AMD64:
                    return Platform.X64;

                case PROCESSOR_ARCHITECTURE_INTEL:
                    return Platform.X86;

                default:
                    return Platform.Unknown;
            }
        }

        public static bool IsPathInDirectory(string path, string directory)
        {
            try
            {
                string pathCanon = path.ToLowerInvariant();
                string directoryCanon = directory.ToLowerInvariant();

                string fullPath = Path.GetFullPath(pathCanon);
                string fullDirectory = Path.GetFullPath(directoryCanon);

                bool a = (fullPath.Length > fullDirectory.Length);
                bool b = (fullPath.IndexOf(fullDirectory) == 0);
                bool c = fullPath[fullDirectory.Length] == Path.DirectorySeparatorChar;

                if (a && b && c)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

            catch
            {
                return false;
            }
        }

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        public static void Main(string[] args)
        {
            try
            {
                MainImpl(args);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }

        public static void CreateShortcut(string shortcutPath, string targetPath, string workingDirectory, string description)
        {
            CShellLink cShellLink = new CShellLink();
            IShellLink iShellLink = (IShellLink)cShellLink;
            iShellLink.SetDescription(description);
            iShellLink.SetShowCmd(SW_SHOWNORMAL);
            iShellLink.SetPath(targetPath);
            iShellLink.SetWorkingDirectory(workingDirectory);
            IPersistFile iPersistFile = (IPersistFile)iShellLink;
            iPersistFile.Save(shortcutPath, false);
            Marshal.ReleaseComObject(iPersistFile);
            iPersistFile = null;
            Marshal.ReleaseComObject(iShellLink);
            iShellLink = null;
            Marshal.ReleaseComObject(cShellLink);
            cShellLink = null;
        }

        [DllImport("shell32.dll", CharSet = CharSet.Unicode, PreserveSig = false)]
        internal static extern void SHGetFolderPathW(
            IntPtr hwndOwner,
            int nFolder,
            IntPtr hToken,
            uint dwFlags,
            IntPtr pszPath);

        internal static string SHGetFolderPath(int nFolder)
        {
            string pszPath = new string(' ', MAX_PATH);
            IntPtr bstr = Marshal.StringToBSTR(pszPath);
            SHGetFolderPathW(IntPtr.Zero, nFolder, IntPtr.Zero, SHGFP_TYPE_CURRENT, bstr);
            string path = Marshal.PtrToStringBSTR(bstr);
            int index = path.IndexOf('\0');
            string path2 = path.Substring(0, index);
            Marshal.FreeBSTR(bstr);
            return path2;
        }

        internal const uint SHGFP_TYPE_CURRENT = 0;
        internal const int MAX_PATH = 260; 
        internal const uint CSIDL_COMMON_STARTMENU = 0x0016;              // All Users\Start Menu
        internal const uint CSIDL_COMMON_PROGRAMS = 0x0017;               // All Users\Start Menu\Programs
        internal const uint CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019;       // All Users\Desktop
        internal const uint CSIDL_PROGRAM_FILES = 0x0026;                 // C:\Program Files
        internal const uint CSIDL_FLAG_CREATE = 0x8000;                   // new for Win2K, or this in to force creation of folder

        public static string GetSpecialFolderPath(uint csidl)
        {
            string path = SHGetFolderPath((int)(csidl | CSIDL_FLAG_CREATE));
            return path;
        }

        public static void SplitArg(string arg, out string name, out string value)
        {
            const char splitChar = '=';
            string[] fields = arg.Split(splitChar);
            name = fields[0];
            value = fields[1];
        }

        public static void MainImpl(string[] args)
        {
            //System.Windows.Forms.MessageBox.Show(Environment.CommandLine);

            // Syntax:
            //     SetupNgen </cleanUpStaging | </install | /delete> DESKTOPSHORTCUT=<0|1> PDNUPDATING=<0|1> SKIPCLEANUP=<0|1> PROGRAMSGROUP=relativeName QUEUENGEN=<0|1>>

            if (args.Length >= 2 && args[0] == "/cleanUpStaging")
            {
                // SetupNgen.exe is overloaded for cleaning up the "Staging" directory
                string stagingPath = args[1];

                // Sanity check: staging directory must ALWAYS have the word Staging in it (capitalized that way too)
                // It must exist, too.
                if (Directory.Exists(stagingPath) &&
                    -1 != stagingPath.IndexOf("Staging"))
                {
                    foreach (string filePath in Directory.GetFiles(stagingPath, "*.msi"))
                    {
                        try
                        {
                            Console.WriteLine("delete: " + filePath);
                            System.IO.File.Delete(filePath);
                        }

                        catch
                        {
                        }
                    }

                    try
                    {
                        Console.WriteLine("rmdir: " + stagingPath);
                        Directory.Delete(stagingPath);
                    }

                    catch
                    {
                    }
                }
            }
            else
            {
                bool delete = false;

                if (args.Length < 5)
                {
                    return;
                }

                if (args[0] == "/delete")
                {
                    delete = true;
                }

                // otherwise we assume args[0] == "/install"

                bool queueNgen;

                if (args[5] == "QUEUENGEN=1")
                {
                    queueNgen = true;
                }
                else
                {
                    queueNgen = false;
                }

                // Pre-JIT via ngen. These are in alphabetical order.
                string[] names = 
                    new string[] 
                    {
                        "ICSharpCode.SharpZipLib.dll",
                        "PaintDotNet.Data.dll",
                        "PaintDotNet.Effects.dll",
                        "PaintDotNet.exe",
                        "PaintDotNet.Resources.dll",
                        "PaintDotNet.StylusReader.dll",
                        "PaintDotNet.SystemLayer.dll",
                        "PdnLib.dll"
                    };

                string[] names32 =
                    new string[]
                    {
                        "Interop.WIA.dll",
                        "WiaProxy32.exe"
                    };

                foreach (string name in names)
                {
                    try
                    {
                        InstallAssembly(name, delete, queueNgen, false);
                    }

                    // We don't raise a stink if ngen fails.
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                }

                foreach (string name in names32)
                {
                    try
                    {
                        InstallAssembly(name, delete, queueNgen, true);
                    }

                    // We don't raise a stink if ngen fails.
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                }

                // Create desktop shortcut
                bool createDesktopShortcut = false;
                bool updating = false;
                bool skipCleanup = false;
                
                if (args[1] == "DESKTOPSHORTCUT=1")
                {
                    createDesktopShortcut = true;
                }

                if (args[2] == "PDNUPDATING=1")
                {
                    updating = true;
                }

                if (args[3] == "SKIPCLEANUP=1")
                {
                    skipCleanup = true;
                }

                string programsShortcutGroup = string.Empty;
                const string programsGroup = "PROGRAMSGROUP";
                if (args[4].StartsWith(programsGroup + "=")) // starts with "PROGRAMSGROUP="
                {
                    programsShortcutGroup = args[4].Substring(1 + programsGroup.Length);
                }

                // Create shortcuts

                // Set up out strings
                string desktopDir = GetSpecialFolderPath(CSIDL_COMMON_DESKTOPDIRECTORY);
                string programsDir = GetSpecialFolderPath(CSIDL_COMMON_PROGRAMS);

                string linkName = PaintDotNet.PdnResources.GetString("Setup.DesktopShortcut.LinkName");
                string description = PaintDotNet.PdnResources.GetString("Setup.DesktopShortcut.Description");
                string desktopLinkPath = Path.Combine(desktopDir, linkName) + ".lnk"; // if we just use ChangeExtension it will overwrite the .NET part of Mono Paint :)
                string programsShortcutDir = Path.Combine(programsDir, programsShortcutGroup);
                string programsLinkPath = Path.Combine(programsShortcutDir, linkName) + ".lnk";
                string workingDirectory = PdnInfo.GetApplicationDir();
                string targetPath = Path.Combine(workingDirectory, "PaintDotNet.exe");

                // Desktop shortcut
                if ((delete && !skipCleanup) || (!createDesktopShortcut && skipCleanup))
                {
                    if (System.IO.File.Exists(desktopLinkPath))
                    {
                        Console.WriteLine("delete: " + desktopLinkPath);

                        try
                        {
                            System.IO.File.Delete(desktopLinkPath);
                        }

                        catch
                        {
                        }
                    }
                }
                else if (createDesktopShortcut && !delete && !updating)
                {
                    CreateShortcut(desktopLinkPath, targetPath, workingDirectory, description);
                }
                
                // Programs shortcut
                const string programsShortcutPathKey = "ProgramsShortcutPath";
                const string pdnKey = @"SOFTWARE\Mono Paint";
                    
                if (delete && !skipCleanup)
                {
                    string path = programsLinkPath;

                    // For the purposes of deleting the shortcut, we actually store the file's location in the registry
                    using (RegistryKey hklmPDN = Registry.LocalMachine.OpenSubKey(pdnKey, false))
                    {
                        if (hklmPDN != null)
                        {
                            object pathObj = hklmPDN.GetValue(programsShortcutPathKey, programsLinkPath);

                            if (pathObj is string)
                            {
                                path = (string)pathObj;
                            }
                        }
                    }

                    // Do some quick checks to make sure we don't delete something we don't want to
                    bool allowDelete = true;

                    // Verify that it is a .lnk file
                    allowDelete &= (Path.GetExtension(path) == ".lnk");

                    // Verify that it is in a subdirectory of Programs
                    allowDelete &= IsPathInDirectory(path, programsDir);

                    // Delete it
                    if (allowDelete && System.IO.File.Exists(path))
                    {
                        Console.WriteLine("delete: " + path);
                        System.IO.File.Delete(path);

                        // If we're the last shortcut, then delete that directory.
                        string dir = Path.GetDirectoryName(path);

                        try
                        {
                            System.IO.Directory.Delete(dir, false);
                        }

                        catch
                        {
                        }
                    }
                }
                else if (!delete && !updating)
                {
                    // Create it
                    if (!Directory.Exists(programsShortcutDir))
                    {
                        Directory.CreateDirectory(programsShortcutDir);
                    }

                    CreateShortcut(programsLinkPath, targetPath, workingDirectory, description);

                    // Save the location to the registry
                    using (RegistryKey hklmPDN = Registry.LocalMachine.CreateSubKey(pdnKey))                        
                    {
                        if (hklmPDN != null)
                        {
                            hklmPDN.SetValue(programsShortcutPathKey, programsLinkPath);
                        }
                    }
                }

                // Register shell extension
                const string shellExtensionName_x86 = "ShellExtension_x86.dll";
                const string shellExtensionName_x64 = "ShellExtension_x64.dll";
                const string shellExtensionGuid = "{D292F82A-50BE-4351-96CC-E86F3F8049DA}";
                const string regKeyName = @"CLSID\" + shellExtensionGuid;
                const string regKeyWow64Name = @"Wow6432Node\" + regKeyName;
                const string shellExtension_regName = "Mono Paint Shell Extension";
                const string inProcServer32 = "InProcServer32";
                const string threadingModel = "ThreadingModel";
                const string apartment = "Apartment";

                string[] shellExtensionFileNames;
                string[] regKeyNames;

                if (UIntPtr.Size == 4)
                {
                    shellExtensionFileNames = new string[1] { shellExtensionName_x86 };
                    regKeyNames = new string[1] { regKeyName };
                }
                else
                {
                    Platform platform = GetPlatform();
                    string dll64bitName = shellExtensionName_x64;

                    shellExtensionFileNames = new string[2] { dll64bitName, shellExtensionName_x86 };
                    regKeyNames = new string[2] { regKeyName, regKeyWow64Name };
                }

                string[] shellExtensionPaths = new string[shellExtensionFileNames.Length];

                for (int i = 0; i < shellExtensionFileNames.Length; ++i)
                {
                    shellExtensionPaths[i] = Path.Combine(ourPath, shellExtensionFileNames[i]);
                }

                if (!delete)
                {
                    // Register the shell extension
                    try
                    {
                        for (int i = 0; i < shellExtensionPaths.Length; ++i)
                        {
                            RegistryKey clsidKey = Registry.ClassesRoot.CreateSubKey(regKeyNames[i], RegistryKeyPermissionCheck.ReadWriteSubTree);
                            RegistryKey ips32key = clsidKey.CreateSubKey(inProcServer32);

                            clsidKey.SetValue(null, shellExtension_regName);
                            ips32key.SetValue(threadingModel, apartment);
                            ips32key.SetValue(null, shellExtensionPaths[i]);
                        }
                    }

                    catch
                    {
                    }
                }
                else
                {
                    // Unregister the shell extension
                    try
                    {
                        for (int i = 0; i < regKeyNames.Length; ++i)
                        {
                            Registry.ClassesRoot.DeleteSubKeyTree(regKeyNames[i]);
                        }
                    }

                    catch
                    {
                    }
                }
            }
        }
    }
}

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us