Example #1
0
        public async Task Run(string txtCaseNr, Action <string, MessageLevels, string> notify)
        {
            _notify = notify;
            var caseNr = txtCaseNr?.Trim().Replace("_", "") + "";

            if (!string.IsNullOrEmpty(caseNr))
            {
                caseNr += "_";
            }
            Settings.ApplicatonBaseName = "QlikViewCollector";
            var resultPathRutine = new GetOutputFolder().FallbackRutine(Settings.ApplicatonBaseName);

            Settings.LogFilePath      = Path.Combine(resultPathRutine, "QvCollector.log");
            Settings.OutputFolderPath = resultPathRutine;
            Log.Init(Settings.LogFilePath);//todo: remove and move into local log implimentation. Warning init with empty string will create a device zero logging.
            _logger.Add($"started with version {Application.ProductVersion}");
            _notify("Connecting to QlikView Installation", MessageLevels.Animate, "Connecting");

            CollectorService = new QlikViewCollectorService(_logger, _notify, DoneAction)
            {
                ConnectToApiManuallyDlg = ShowConnectionFailuresDialogue,
                PathToLogFolderDlg      = ShowLogFolderDialogue,
                PathToArchivedLogsDlg   = ShowArchivedLogsFolderDialogue,
            };
            //_settings.StartDateForLogs = _startDate;
            //_settings.StopDateForLogs = _stopDate;
            Settings.UseOnlineDelivery = false; //chkOnline.Checked;
            Settings.AllowRemoteLogs   = FreyrCollectorCommon.Common.Settings.AllowRemoteLogs;
            Settings.AllowArchivedLogs = FreyrCollectorCommon.Common.Settings.AllowArchivedLogs;

            Settings.AllowSenseInfo        = FreyrCollectorCommon.Common.Settings.AllowSenseInfo;
            Settings.DnsHostName           = (Dns.GetHostEntry(Dns.GetHostName()).HostName).ToLower();
            Settings.CustomerKey           = "";
            Settings.Key                   = caseNr;
            Settings.QvSettings.QmsAddress = $"http://{Settings.DnsHostName}:4799/QMS/Service";

            try
            {
                await CollectorService.Start(Settings).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Log.Add("Failed accessing installation.", ex);
                DoneAction.Invoke(@"Failed accessing installation.", @"We unfortunately had a problem reading the QlikView installation. You will have to manually send us your logs.", CollectorService);
            }
        }
Example #2
0
        private void Done(string header, string msg, QlikViewCollectorService service)
        {
            if (service.AbortAndExit)
            {
                Invoke(new Action(Close));
                return;
            }
            ResetUi();
            if (!string.IsNullOrEmpty(msg))
            {
                Invoke(new Action(() =>
                {
                    MessageBox.Show(this, msg, header);
                    //MessageBox.Show(this,$@"We are now finished collecting information. {Environment.NewLine}{Environment.NewLine}Hopefully we will solve your issue shortly.", @"Qlik Diagnostics has finished");
                }));
            }

            if (!string.IsNullOrEmpty(service.ServiceVariables.CollectorOutput.ZipFile) && File.Exists(service.ServiceVariables.CollectorOutput.ZipFile))
            {
                Process.Start("c:\\windows\\explorer.exe", $"/select,\"{service.ServiceVariables.CollectorOutput.ZipFile}\"");
            }

            ResetUiFinished();
        }