示例#1
0
        public string GetLastGeneratedMaintenanceFile(ClientFileType cft)
        {
            var list = _citiTestRepository.GetFileList(cft.ClientFileTypeId);
            var file = list.FirstOrDefault();

            if (file != null)
            {
                Console.WriteLine("Generated file is: " + file.UNCPath + file.FileName);
                return(file.UNCPath + file.FileName);
            }

            return(null);
        }
示例#2
0
        public JobQueueEntry GetJobQueueBasedOnClientFileType(ClientFileType cft, JobType jobType)
        {
            var jobQueue = commonTestRepository.GetJobQueueBasedOnJobType(cft.ClientFileTypeId, (int)jobType).FirstOrDefault();

            return(jobQueue);
        }
示例#3
0
        void ProcessArguments(Arguments commands)
        {
            if (commands["supdf"] != null)
            {
                //the client is in self update mode
                selfUpdateFileLoc = commands["supdf"];

                // check if this instance is the "new self"
                if (commands["ns"] != null)
                {
                    IsNewSelf = true;
                }
            }
            else
            {
                PasswordUpdateCmd     = commands["password"];
                forcedLanguageCulture = commands["forcelang"];

                // automatic update mode
                if (commands["autoupdate"] != null)
                {
                    // the actual pipe will be created when OnHandleCreated is called
                    isAutoUpdateMode = true;

                    // check if this instance is the "new self"
                    if (commands["ns"] != null)
                    {
                        IsNewSelf = true;
                    }
                }
                else if (commands["uninstall"] != null)
                {
                    // uninstall any newly created folders, files, or registry
                    uninstalling = true;
                }
                else // standalone updater mode
                {
                    if (commands["quickcheck"] != null)
                    {
                        WindowState   = FormWindowState.Minimized;
                        ShowInTaskbar = false;

                        QuickCheck = true;

                        if (commands["noerr"] != null)
                        {
                            QuickCheckNoErr = true;
                        }

                        if (commands["justcheck"] != null)
                        {
                            QuickCheckJustCheck = true;
                        }

                        // for outputting errors & update information to
                        // STDOUT or to a file
                        if (QuickCheckNoErr || QuickCheckJustCheck)
                        {
                            OutputInfo = commands["outputinfo"];
                        }
                    }
                    else if (commands["fromservice"] != null)
                    {
                        SkipUpdateInfo      = true;
                        UpdatingFromService = true;

                        if (!string.IsNullOrEmpty(commands["logfile"]))
                        {
                            log = new Logger(commands["logfile"]);
                        }
                    }

                    if (commands["skipinfo"] != null)
                    {
                        SkipUpdateInfo = true;
                    }

                    StartOnErr     = commands["startonerr"];
                    StartOnErrArgs = commands["startonerra"];
                }

                // client data file
                if (commands["cdata"] != null)
                {
                    clientFileLoc = commands["cdata"];

                    if (clientFileLoc.EndsWith("iuc", StringComparison.OrdinalIgnoreCase))
                    {
                        clientFileType = ClientFileType.PreRC2;
                    }
                    else if (clientFileLoc.EndsWith("iucz", StringComparison.OrdinalIgnoreCase))
                    {
                        clientFileType = ClientFileType.RC2;
                    }
                    else
                    {
                        clientFileType = ClientFileType.Final;
                    }
                }
                else
                {
                    clientFileLoc  = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "client.wyc");
                    clientFileType = ClientFileType.Final;

                    //try the RC-2 filename
                    if (!File.Exists(clientFileLoc))
                    {
                        clientFileLoc  = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "iuclient.iucz");
                        clientFileType = ClientFileType.RC2;
                    }

                    //try Pre-RC2 filename
                    if (!File.Exists(clientFileLoc))
                    {
                        //if it doesn't exist, try without the 'z'
                        clientFileLoc  = clientFileLoc.Substring(0, clientFileLoc.Length - 1);
                        clientFileType = ClientFileType.PreRC2;
                    }
                }

                //set basedirectory as the location of the executable
                baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

                if (commands["basedir"] != null && Directory.Exists(commands["basedir"]))
                {
                    //if the specified directory exists, then set as directory
                    // also trim the trailing space
                    baseDirectory = commands["basedir"].TrimEnd();
                }

                // only generate a temp directory if we're not in AutoUpdate mode
                if (!isAutoUpdateMode)
                {
                    // create "random" temp dir.
                    tempDirectory = Path.Combine(Path.GetTempPath(), @"w" + DateTime.Now.ToString("sff"));
                    Directory.CreateDirectory(tempDirectory);
                }

                // load the passed server argument
                serverOverwrite = commands["server"];

                // load the custom updatepath directory
                updatePathVar = commands["updatepath"];

                // custom url arguments
                customUrlArgs = commands["urlargs"];

                customProxyUrl      = commands["proxy"];
                customProxyUser     = commands["proxyu"];
                customProxyPassword = commands["proxyp"];
                customProxyDomain   = commands["proxyd"];

                // only allow silent uninstalls
                if (uninstalling && commands["s"] != null)
                {
                    isSilent = true;

                    WindowState   = FormWindowState.Minimized;
                    ShowInTaskbar = false;
                }
            }
        }
示例#4
0
 public void GenerateOutboundMaintenanceFile(ClientFileType cft)
 {
     _citiTestRepository.GeneratingOutboundMaintenance(cft.ClientFileTypeId);
 }
示例#5
0
        void ProcessArguments(Arguments commands)
        {
            if (commands["supdf"] != null)
            {
                //the client is in self update mode
                selfUpdateFileLoc = commands["supdf"];

                // check if this instance is the "new self"
                if (commands["ns"] != null)
                    IsNewSelf = true;
            }
            else
            {
                PasswordUpdateCmd = commands["password"];
                forcedLanguageCulture = commands["forcelang"];

                // automatic update mode
                if (commands["autoupdate"] != null)
                {
                    // the actual pipe will be created when OnHandleCreated is called
                    isAutoUpdateMode = true;

                    // check if this instance is the "new self"
                    if (commands["ns"] != null)
                        IsNewSelf = true;
                }
                else if (commands["uninstall"] != null)
                {
                    // uninstall any newly created folders, files, or registry
                    uninstalling = true;
                }
                else // standalone updater mode
                {
                    if (commands["quickcheck"] != null)
                    {
                        WindowState = FormWindowState.Minimized;
                        ShowInTaskbar = false;

                        QuickCheck = true;

                        if (commands["noerr"] != null)
                            QuickCheckNoErr = true;

                        if (commands["justcheck"] != null)
                            QuickCheckJustCheck = true;

                        // for outputting errors & update information to
                        // STDOUT or to a file
                        if (QuickCheckNoErr || QuickCheckJustCheck)
                            OutputInfo = commands["outputinfo"];
                    }
                    else if (commands["fromservice"] != null)
                    {
                        SkipUpdateInfo = true;
                        UpdatingFromService = true;

                        if (!string.IsNullOrEmpty(commands["logfile"]))
                            log = new Logger(commands["logfile"]);
                    }

                    if (commands["skipinfo"] != null)
                        SkipUpdateInfo = true;

                    StartOnErr = commands["startonerr"];
                    StartOnErrArgs = commands["startonerra"];
                }

                // client data file
                if (commands["cdata"] != null)
                {
                    clientFileLoc = commands["cdata"];

                    if (clientFileLoc.EndsWith("iuc", StringComparison.OrdinalIgnoreCase))
                        clientFileType = ClientFileType.PreRC2;
                    else if (clientFileLoc.EndsWith("iucz", StringComparison.OrdinalIgnoreCase))
                        clientFileType = ClientFileType.RC2;
                    else
                        clientFileType = ClientFileType.Final;
                }
                else
                {
                    clientFileLoc = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "client.wyc");
                    clientFileType = ClientFileType.Final;

                    //try the RC-2 filename
                    if (!File.Exists(clientFileLoc))
                    {
                        clientFileLoc = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "iuclient.iucz");
                        clientFileType = ClientFileType.RC2;
                    }
                    
                    //try Pre-RC2 filename
                    if (!File.Exists(clientFileLoc))
                    {
                        //if it doesn't exist, try without the 'z'
                        clientFileLoc = clientFileLoc.Substring(0, clientFileLoc.Length - 1);
                        clientFileType = ClientFileType.PreRC2;
                    }
                }

                //set basedirectory as the location of the executable
                baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

                if (commands["basedir"] != null && Directory.Exists(commands["basedir"]))
                {
                    //if the specified directory exists, then set as directory
                    // also trim the trailing space
                    baseDirectory = commands["basedir"].TrimEnd();
                }

                // only generate a temp directory if we're not in AutoUpdate mode
                if (!isAutoUpdateMode)
                {
                    // create "random" temp dir.
                    tempDirectory = Path.Combine(Path.GetTempPath(), @"w" + DateTime.Now.ToString("sff"));
                    Directory.CreateDirectory(tempDirectory);
                }

                // load the passed server argument
                serverOverwrite = commands["server"];

                // load the custom updatepath directory
                updatePathVar = commands["updatepath"];

                // custom url arguments
                customUrlArgs = commands["urlargs"];

                customProxyUrl = commands["proxy"];
                customProxyUser = commands["proxyu"];
                customProxyPassword = commands["proxyp"];
                customProxyDomain = commands["proxyd"];

                // only allow silent uninstalls 
                if (uninstalling && commands["s"] != null)
                {
                    isSilent = true;

                    WindowState = FormWindowState.Minimized;
                    ShowInTaskbar = false;
                }
            }
        }