Ejemplo n.º 1
0
        public static void Main()
        {
            string srcDir = @"..\..\..\..\";
            Debug.WriteLine(Path.GetFullPath(srcDir));
            List<XmlElement> doozers = new List<XmlElement>();
            List<XmlElement> conditions = new List<XmlElement>();

            if (!ReadXmlDocu(srcDir + "Main\\Core\\Project", doozers, conditions))
                return;
            if (!ReadXmlDocu(srcDir + "Main\\Base\\Project", doozers, conditions))
                return;

            // build normal SharpDevelop:
            ProcessStartInfo info = new ProcessStartInfo("cmd", "/c debugbuild.bat");
            info.WorkingDirectory = srcDir;
            Process p = Process.Start(info);
            if (!p.WaitForExit(60000)) {
                Debug.WriteLine("msbuild did not exit");
                return;
            }
            if (p.ExitCode != 0) {
                Debug.WriteLine("msbuild exit code: " + p.ExitCode);
                return;
            }

            sdVersion = FileVersionInfo.GetVersionInfo(Path.GetFullPath(Path.Combine(srcDir, "..\\bin\\SharpDevelop.exe")));

            //sdVersion = FileVersionInfo.GetVersionInfo(Path.GetFullPath(Path.Combine(srcDir, "..\\bin\\ICSharpCode.Core.dll")));
            Comparison<XmlElement> comparison = delegate(XmlElement a, XmlElement b) {
                string shortNameA = a.GetAttribute("name").Substring(a.GetAttribute("name").LastIndexOf('.') + 1);
                string shortNameB = b.GetAttribute("name").Substring(b.GetAttribute("name").LastIndexOf('.') + 1);
                return shortNameA.CompareTo(shortNameB);
            };
            doozers.Sort(comparison);
            conditions.Sort(comparison);

            Debug.WriteLine("Writing doozer list");
            using (StreamWriter html = new StreamWriter(Path.Combine(srcDir, "..\\doc\\technotes\\DoozerList.html"))) {
                WriteHeader(html, "Doozer List");
                WriteList(html, doozers, true);
                WriteFooter(html);
            }
            Debug.WriteLine("Writing condition list");
            using (StreamWriter html = new StreamWriter(Path.Combine(srcDir, "..\\doc\\technotes\\ConditionList.html"))) {
                WriteHeader(html, "Condition List");
                WriteList(html, conditions, false);
                WriteFooter(html);
            }
            Debug.WriteLine("Building Addin schema");
            XmlDocument doc = new XmlDocument();
            doc.Load(Path.Combine(srcDir, "..\\data\\schemas\\Addin.xsd"));
            UpdateSchema(doc, doozers, conditions);
            using (XmlTextWriter writer = new XmlTextWriter(Path.Combine(srcDir, "..\\data\\schemas\\Addin.xsd"), System.Text.Encoding.UTF8)) {
                writer.Formatting = Formatting.Indented;
                writer.IndentChar = '\t';
                writer.Indentation = 1;
                doc.Save(writer);
            }
            Debug.WriteLine("Finished");
        }
        /// <summary>
        /// About window.
        /// </summary>
		/// <param name = "mainWindow">
		/// The parent window.
		/// </param>
        /// <param name="programInfo">
        /// This program's information (main project info).
        /// </param>
        /// <param name="assemblies">
        /// Assemblies to use.
        /// </param>
        public About (MainWindow mainWindow, FileVersionInfo programInfo, ProjectAssemblies assemblies)
        {
            this.VersionInfo = new VersionInfo (programInfo, assemblies, disclaimer);
            this.DataContext = this.VersionInfo;
            this.mainWindow = mainWindow;
            InitializeComponent();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取本地版本
        /// </summary>
        /// <returns></returns>
        public static string GetLocalVersion(string filePath)
        {
            FileInfo fi = new FileInfo(filePath);

            System.Diagnostics.FileVersionInfo mfv = System.Diagnostics.FileVersionInfo.GetVersionInfo(filePath);
            return(mfv.Comments);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates an array containing detailed information  for a file
        /// Note: Params 13 and 15 are not implemented. Param 13 specifies if file can self register and param 15 specified the translation code.
        ///<p/><pre>
        /// //Create an array of type string and pass it by reference to the AGetFileVersion() along with the name of the file
        /// //Fills MyArray with detailed information about the file
        /// string[] MyArray = new string[0];
        /// int i = VFPToolkit.arrays.AGetFileVersion(ref MyArray, "c:\\visio10\\gdiplus.dll");
        ///
        /// Tip: Note the use of double backslash \\ as a separator. In C# the backslash is used to specify escape sequence so you need to specify the \\ as a separator or specify the path using the @"c:\MyPath\MyFile".
        ///</pre>
        /// </summary>
        /// <param name="aFileInfoArray"></param>
        /// <param name="cFileName"></param>
        /// <returns></returns>
        public static int AGetFileVersion(ref string[] aFileInfoArray, string cFileName)
        {
            //Create the FileVersionInfo object from System.Diagnostics and pass the FileName for which we want to get information
            System.Diagnostics.FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(cFileName);

            //Specify the right dimensions for the array
            aFileInfoArray = new string[15];

            //Fill the array the right values
            aFileInfoArray[0]  = fvi.Comments;
            aFileInfoArray[1]  = fvi.CompanyName;
            aFileInfoArray[2]  = fvi.FileDescription;
            aFileInfoArray[3]  = fvi.FileVersion;
            aFileInfoArray[4]  = fvi.InternalName;
            aFileInfoArray[5]  = fvi.LegalCopyright;
            aFileInfoArray[6]  = fvi.LegalTrademarks;
            aFileInfoArray[7]  = fvi.OriginalFilename;
            aFileInfoArray[8]  = fvi.PrivateBuild;
            aFileInfoArray[9]  = fvi.ProductName;
            aFileInfoArray[10] = fvi.ProductVersion;
            aFileInfoArray[11] = fvi.SpecialBuild;
            aFileInfoArray[12] = "";
            aFileInfoArray[13] = fvi.Language;
            aFileInfoArray[14] = "";

            //Return the number of items back
            return(aFileInfoArray.Length);
        }
Ejemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();

            // エラーラベルは非表示にしておく
            HideError();

            // バージョン表示
            System.Diagnostics.FileVersionInfo ver =
                System.Diagnostics.FileVersionInfo.GetVersionInfo(
                    System.Reflection.Assembly.GetExecutingAssembly().Location);
            this.Title += " Ver" + ver.ProductVersion;

            // ユーザデータから前回のディレクトリ読み出し
            try
            {
                SavingDirectoryTextBox.Text = Properties.Settings.Default["SavingDirectory"].ToString();
                if (SavingDirectoryTextBox.Text == "")
                {
                    throw new Exception("");
                }
            }
            catch (Exception)
            {
                // Default directory
                SavingDirectoryTextBox.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            }

            // キーボードフック開始
            KeyboardHook.StartHook(OnCtrlF2);
        }
Ejemplo n.º 6
0
        public static string GetAssemblyVersion()
        {
            Assembly lAssembly = Assembly.GetExecutingAssembly();

            System.Diagnostics.FileVersionInfo lFileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(lAssembly.Location);
            return(lFileVersion.FileVersion);
        }
 public FileVersionInfoWrapper(FileVersionInfo fileVersionInfo)
 {
     Comments = fileVersionInfo.Comments;
     CompanyName = fileVersionInfo.CompanyName;
     FileBuildPart = fileVersionInfo.FileBuildPart;
     FileDescription = fileVersionInfo.FileDescription;
     FileMajorPart = fileVersionInfo.FileMajorPart;
     FileMinorPart = fileVersionInfo.FileMinorPart;
     FileName = fileVersionInfo.FileName;
     FilePrivatePart = fileVersionInfo.FilePrivatePart;
     FileVersion = fileVersionInfo.FileVersion;
     InternalName = fileVersionInfo.InternalName;
     IsDebug = fileVersionInfo.IsDebug;
     IsPatched = fileVersionInfo.IsPatched;
     IsPrivateBuild = fileVersionInfo.IsPrivateBuild;
     IsPreRelease = fileVersionInfo.IsPreRelease;
     IsSpecialBuild = fileVersionInfo.IsSpecialBuild;
     Language = fileVersionInfo.Language;
     LegalCopyright = fileVersionInfo.LegalCopyright;
     LegalTrademarks = fileVersionInfo.LegalTrademarks;
     OriginalFilename = fileVersionInfo.OriginalFilename;
     PrivateBuild = fileVersionInfo.PrivateBuild;
     ProductBuildPart = fileVersionInfo.ProductBuildPart;
     ProductMajorPart = fileVersionInfo.ProductMajorPart;
     ProductMinorPart = fileVersionInfo.ProductMinorPart;
     ProductName = fileVersionInfo.ProductName;
     ProductPrivatePart = fileVersionInfo.ProductPrivatePart;
     ProductVersion = fileVersionInfo.ProductVersion;
     SpecialBuild = fileVersionInfo.SpecialBuild;
 }
        /// <summary>
        /// Create an up to date NuSpec file and pack it into a NuGet file.
        /// </summary>
        public void Pack()
        {
            var dict = ArgumentParser.ParseMultiValues(_Arguments);ArgumentParser.Parse(_Arguments);

            CheckForRequiredCommands(dict);

            var update = Update(dict);

            if (update)
            {
                Console.WriteLine("Trying to update NuGet...");
                Console.WriteLine();

                StartProcess("NuGet.exe", "update -self");
            }

            if (update && dict.Count == 1)
                return;

            var outputdir = Join(dict["OUTPUTDIR"]);

            if (!outputdir.EndsWith("/") && !outputdir.EndsWith("\\"))
                outputdir = outputdir + "\\";

            var dll = outputdir + Join(dict["DLL"]);
            _FileVersionInfo = FileVersionInfo.GetVersionInfo(dll);

            string nuspec = CreateNuSpec(dict, outputdir);

            PackNuGet(nuspec);
        }
 private void KeppySynthDebugWindow_Load(object sender, EventArgs e)
 {
     Driver = FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\\keppysynth\\keppysynth.dll"); // Gets Keppy's Synthesizer version
     ContextMenu = MainCont; // Assign ContextMenu (Not the strip one) to the form
     richTextBox1.ContextMenu = MainCont; // Assign ContextMenu (Not the strip one) to the richtextbox
     DebugWorker.RunWorkerAsync(); // Creates a thread to show the info
 }
Ejemplo n.º 10
0
        public PluginInfo(string strFilePath, FileVersionInfo fvi,
			string strDisplayFilePath)
        {
            Debug.Assert(strFilePath != null);
            if(strFilePath == null) throw new ArgumentNullException("strFilePath");
            Debug.Assert(fvi != null);
            if(fvi == null) throw new ArgumentNullException("fvi");
            // strDisplayFilePath may be null

            m_strFilePath = strFilePath;
            m_strDisplayFilePath = strDisplayFilePath;

            m_strFileVersion = (fvi.FileVersion ?? string.Empty).Trim();

            string strName = (fvi.FileDescription ?? string.Empty).Trim();
            m_strDescription = (fvi.Comments ?? string.Empty).Trim();
            m_strAuthor = (fvi.CompanyName ?? string.Empty).Trim();

            // Workaround for Mono not storing the AssemblyTitle in
            // the file version information block when compiling an
            // assembly (PLGX plugin)
            if(strName.Length == 0)
                strName = UrlUtil.StripExtension(UrlUtil.GetFileName(
                    strFilePath));

            m_strName = strName;
        }
Ejemplo n.º 11
0
        public async Task <bool> checkLatestVersion()
        {
            var client   = new GitHubClient(new ProductHeaderValue("Code-Dani"));
            var releases = await client.Repository.Release.GetLatest("Code-Dani", "BnS_EffectRemover");

            System.Reflection.Assembly         assembly = System.Reflection.Assembly.GetExecutingAssembly();
            System.Diagnostics.FileVersionInfo fvi      = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
            if (releases != null)
            {
                if (releases.TagName == fvi.FileVersion)
                {
                    await LB_status.Dispatcher.BeginInvoke((Action)(() =>
                    {
                        LB_status.Content = "Status: version up to date";
                        LB_status.Foreground = new SolidColorBrush(Colors.Green);
                    }));
                }
                else
                {
                    await LB_status.Dispatcher.BeginInvoke((Action)(() =>
                    {
                        LB_status.Content = "Status: version outdated";
                        LB_status.Foreground = new SolidColorBrush(Colors.Red);
                    }));

                    return(false);
                }
            }
            return(true);
        }
 public UserApplication(Process process)
 {
     _process = process;
     _executablePath = ProcessUtils.GetExecutablePath(_process.Id);
     if (_executablePath == null)
     {
         // 何らかの原因で取得に失敗した場合は不明なアプリとして対象外にする。
         ProcessName = "";
         IsUnknown = true;
         IsExplorer = false;
     }
     else
     {
         try
         {
             _fileVersionInfo = FileVersionInfo.GetVersionInfo(_executablePath);
             ProcessName = Path.GetFileNameWithoutExtension(_executablePath);
             IsExplorer = ProcessName.ToLower() == "explorer";
         }
         catch (FileNotFoundException)
         {
             // GetVersionInfoで何故かFileNotFoundExceptionがスローされる場合があるので
             ProcessName = "";
             IsUnknown = true;
             IsExplorer = false;
         }
     }
 }
Ejemplo n.º 13
0
 public bool AppliesToVersion(FileVersionInfo fileVersion)
 {
     if ((this.MajorVersion < 0 || this.MajorVersion == fileVersion.ProductMajorPart) && (this.MinorVersion < 0 || this.MinorVersion == fileVersion.ProductMinorPart) && (this.BuildVersion < 0 || this.BuildVersion == fileVersion.ProductBuildPart))
         return this.IsInRange(this.BuildVersionMin, this.BuildVersionMax, fileVersion.ProductBuildPart);
     else
         return false;
 }
Ejemplo n.º 14
0
        public string version()
        {
            try
            {
                string FileVersions = "";
                // Get the file version for the notepad.
                string filePath = this.GetType().Assembly.Location;


                System.Diagnostics.FileVersionInfo file1 = System.Diagnostics.FileVersionInfo.GetVersionInfo(filePath);
                FileVersions = file1.FileVersion;
                if (FileVersions != "")
                {
                    string[] strVer = FileVersions.Split('.');
                    if (strVer.Length == 2)
                    {
                        FileVersions = strVer[0] + ".00.0000";
                    }
                }
                string versions = "TMT : " + FileVersions;
                return(versions);
            }
            catch (Exception ex)
            {
                return("TMT : " + "FileVersions Exception error");
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public SettingForm()
        {
            // 共通設定エラー時処理
            commonFileReadCompleted = this.CommonSettingRead();
            if (commonFileReadCompleted == false)
            {
                return;
            }

            // 各コンポーネント初期化
            InitializeComponent();

            // タイトル
            System.Diagnostics.FileVersionInfo ver =
                System.Diagnostics.FileVersionInfo.GetVersionInfo(
                    System.Reflection.Assembly.GetExecutingAssembly().Location);

            // タイトル
            string AssemblyName = ver.FileVersion;

            this.Text = this.Text + " " + AssemblyName;

            // 言語設定を表示
            this.lblLanguage.Text = System.Threading.Thread.CurrentThread.CurrentUICulture.ToString();
#if DEBUG
            this.lblLanguage.Visible = true;
#endif
        }
Ejemplo n.º 16
0
 private void WriteValidatorData(System.Diagnostics.FileVersionInfo cver)
 {
     System.IO.StreamWriter sw = System.IO.File.CreateText(System.IO.Path.Combine(set.ReleaseDir, @"Data\release.nfo"));
     try
     {
         sw.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
         sw.WriteLine("<simperelease version=\"" + SimPe.Helper.VersionToLong(cver) + "\">");
         foreach (FileDescriptor f in listing)
         {
             if (f.FileName.Trim().ToLower().StartsWith("simpe-setup"))
             {
                 continue;
             }
             if (f.FileName == "validator.exe")
             {
                 continue;
             }
             sw.Write(f.ToString());
         }
         sw.WriteLine("</simperelease>");
     }
     finally
     {
         sw.Close();
     }
 }
Ejemplo n.º 17
0
        public static FileVersionInfo GetFileVersionInfo()
        {
            if ( fvi == null ) {
                fvi = FileVersionInfo.GetVersionInfo( System.Reflection.Assembly.GetEntryAssembly().Location );
            }

            return fvi;
        }
Ejemplo n.º 18
0
 static Info()
 {
     //ensamblado = System.Reflection.Assembly.GetExecutingAssembly();
     // Usar esto para evitar sobrecargar la memoria
     ensamblado = typeof(My).Assembly;
     fvi        = FileVersionInfo.GetVersionInfo(ensamblado.Location);
     an         = ensamblado.GetName();
 }
Ejemplo n.º 19
0
        public AutoUpdater(string url, TimeSpan interval)
        {
            _url = url;
            _interval = interval;

            Assembly assembly = Assembly.GetExecutingAssembly();
            _versionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
        }
Ejemplo n.º 20
0
    private void PrintFileVersionInfo(string path)
    {
        var fileInfo = new FileInfo(path);

        System.Diagnostics.FileVersionInfo info = System.Diagnostics.FileVersionInfo.GetVersionInfo(path);
        fileSizeText.text      = "视频大小:" + (fileInfo.Length / 1024.0 / 1024.0f).ToString("F2") + "M";
        fileExtensionText.text = "文件格式:" + Path.GetExtension(path);
    }
Ejemplo n.º 21
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public SettingForm()
        {
            // タイトル
            System.Diagnostics.FileVersionInfo ver = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string AssemblyName = ver.FileVersion;

            this.Text = this.Text + " " + AssemblyName;
        }
Ejemplo n.º 22
0
        static ErrorCode ProcShowVersion(Program.ShowVersion opt)
        {
            ErrorCode ret_code = ErrorCode.NO_ERROR;

            System.Diagnostics.FileVersionInfo ver =
                System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
            System.Console.WriteLine(ver.FileVersion);
            return(ret_code);
        }
Ejemplo n.º 23
0
        private void CollectFileInformations(out bool isqa, out System.Diagnostics.FileVersionInfo cver)
        {
            isqa = false;
            cver = null;
            long csize = 0;

            listing.Clear();
            frm.lv.Items.Clear();
            string[] files = System.IO.Directory.GetFiles(set.ReleaseDir, "*.dll");
            foreach (string file in files)
            {
                listing.Add(new FileDescriptor(set.ReleaseDir, file));
            }

            files = System.IO.Directory.GetFiles(set.ReleaseDir, "*.exe");
            foreach (string file in files)
            {
                listing.Add(new FileDescriptor(set.ReleaseDir, file));
            }

            files = System.IO.Directory.GetFiles(System.IO.Path.Combine(set.ReleaseDir, "Plugins"), "*.dll");
            foreach (string file in files)
            {
                listing.Add(new FileDescriptor(set.ReleaseDir, file));
            }

            foreach (FileDescriptor f in listing)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Text = f.FileName;
                if (f.FileName.Trim().ToLower().StartsWith("simpe-setup"))
                {
                    continue;
                }

                if (f.FileName == "simpe.helper.dll")
                {
                    frm.tbVer.Text = SimPe.Helper.VersionToString(f.Version);
                    if ((f.Version.FileMinorPart % 2) == 1)
                    {
                        frm.lbQaVer.Text = SimPe.Helper.LongVersionToString(qaver) + " (" + SimPe.Helper.VersionToString(f.Version) + ")";
                        isqa             = true;
                    }
                    else
                    {
                        frm.lbVer.Text = SimPe.Helper.LongVersionToString(publicver) + " (" + SimPe.Helper.VersionToString(f.Version) + ")";
                    }

                    csize = f.Size;
                    cver  = f.Version;
                }
                lvi.SubItems.Add(f.Size.ToString());
                lvi.SubItems.Add(SimPe.Helper.VersionToString(f.Version));

                frm.lv.Items.Add(lvi);
            }
        }
Ejemplo n.º 24
0
        public Hidemaru()
        {
            System.Diagnostics.FileVersionInfo vi = System.Diagnostics.FileVersionInfo.GetVersionInfo(strExecuteFullpath);
            _ver = 100 * vi.FileMajorPart + 10 * vi.FileMinorPart + 1 * vi.FileBuildPart + 0.01 * vi.FilePrivatePart;

            SetUnManagedDll();

            Edit  = new TEdit();
            Macro = new TMacro();
        }
Ejemplo n.º 25
0
        public MainForm()
        {
            InitializeComponent();

            intentionalClose = false;

            assemblyInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);

            LoadSettings();
        }
Ejemplo n.º 26
0
        public void ShowVersionInfo()
        {
            System.Diagnostics.FileVersionInfo version =
                System.Diagnostics.FileVersionInfo.GetVersionInfo(
                    System.Reflection.Assembly.GetExecutingAssembly().Location);

            MessageBox.Show(version.FileDescription + " version " + version.FileVersion + "\n" +
                            "--------------------------------" + "\n" +
                            LICENSE, version.FileDescription);
        }
Ejemplo n.º 27
0
		internal ProcessModule(IntPtr baseaddr, IntPtr entryaddr,
				       string filename,
				       FileVersionInfo version_info,
				       int memory_size, string modulename) {
			this.baseaddr=baseaddr;
			this.entryaddr=entryaddr;
			this.filename=filename;
			this.version_info=version_info;
			this.memory_size=memory_size;
			this.modulename=modulename;
		}
Ejemplo n.º 28
0
        private void formDangNhap_Load(object sender, EventArgs e)
        {
            txtMK.Text    = "admin";
            txtTenDN.Text = "admin";
            System.Reflection.Assembly         assembly = System.Reflection.Assembly.GetExecutingAssembly();
            System.Diagnostics.FileVersionInfo fvi      = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
            string version = fvi.ProductVersion;

            // Debug.WriteLine(OSInfo.Name);
            Debug.WriteLine("ver: " + typeof(string).Assembly.ImageRuntimeVersion);
        }
 /// <summary>
 ///     新しいインスタンスを初期化します。
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="libraryName"></param>
 /// <param name="categroy"></param>
 /// <param name="license"></param>
 /// <param name="copyright"></param>
 /// <param name="url"></param>
 public DynamicLinkLibraryInfo(string filePath, string libraryName, string categroy, string license,
     string copyright, string url)
 {
     FilePath = filePath;
     Categroy = categroy;
     LibraryName = libraryName;
     License = license;
     Copyright = copyright;
     Url = url;
     _version = FilePath != null ? FileVersionInfo.GetVersionInfo(FilePath) : null;
 }
Ejemplo n.º 30
0
        private void Form1_Load(object sender, EventArgs e)
        {
            System.Diagnostics.FileVersionInfo myFileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
            LogoWindows = new Bitmap(Properties.Resources.logo);
            Icon        = Properties.Resources.IconRYIK;

            // Autorun allFunction
            GetInfo();
            SetDesktopInfo();
            FormClosedFull();
        }
Ejemplo n.º 31
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (Process.GetProcessesByName("GW2PAO").Count() > 1)
            {
                // Application is already running
                Application.Current.Shutdown();
                return;
            }

            // Log application information
            var executingAssembly = System.Reflection.Assembly.GetExecutingAssembly();

            System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(executingAssembly.Location);
            logger.Info("Application starting - " + executingAssembly.GetName().Name + " - " + executingAssembly.GetName().Version + " - " + fvi.FileVersion + " - " + fvi.ProductVersion);

            // Software only mode provides improved performance when using transparent windows and hardware acceleration is not available
            if ((System.Windows.Media.RenderCapability.Tier >> 16) == 0)
            {
                logger.Info("Hardware acceleration unavailable - setting ProcessRenderMode to SoftwareOnly");
                System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
            }
            else
            {
                logger.Info("Hardware acceleration available - leaving ProcessRenderMode");
            }

            base.OnStartup(e);

            this.InitializeSettings();
            this.InitializeLogging();

            // Initialize the last chance exception handlers
            logger.Debug("Registering last chance exception handlers");
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            this.InitializeInternationalization();

            if (GW2PAO.Properties.Settings.Default.CheckForUpdates)
            {
                UpdateChecker.CheckForUpdateAndNotify();
            }

            ApplicationBootstrapper ab = new ApplicationBootstrapper();

            ab.Run();

            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.DoShutdown));

            GW2PAO.Properties.Settings.Default.FirstTimeRun = false;
            GW2PAO.Properties.Settings.Default.Save();

            // Disable client-side connection throttling
            ServicePointManager.DefaultConnectionLimit = int.MaxValue;
        }
Ejemplo n.º 32
0
        private void UpdateForm_Load(object sender, EventArgs e)
        {
            downloadClient = new WebClient();
            //イベントハンドラの作成
            downloadClient.DownloadProgressChanged +=
                new System.Net.DownloadProgressChangedEventHandler(
                    downloadClient_DownloadProgressChanged);
            downloadClient.DownloadFileCompleted +=
                new System.ComponentModel.AsyncCompletedEventHandler(downloadClient_DownloadFileCompleted);

            if (Program.isForceUpdate)
            {
                update();
                return;
            }

            // アップデートする必要があるか?
            string nowVersion = "";

            if (File.Exists(LINEAR_DIR + "\\LinearAudioPlayer.exe"))
            {
                System.Diagnostics.FileVersionInfo appver = System.Diagnostics.FileVersionInfo.GetVersionInfo(
                    LINEAR_DIR + "\\LinearAudioPlayer.exe");
                nowVersion = appver.FileMajorPart.ToString() + "."
                             + appver.FileMinorPart.ToString() + "."
                             + appver.FileBuildPart.ToString();
            }

            WebResponse res            = new WebManager().request(LINEAR_URL);
            string      newFileVersion = "";

            newFileVersion = Path.GetFileNameWithoutExtension(res.ResponseUri.ToString());
            res.Close();
            newFileVersion = newFileVersion.Substring(newFileVersion.Length - 5, 5);

            if (newFileVersion.CompareTo(nowVersion) > 0)
            {
                if (MessageUtils.showQuestionMessage("最新バージョンが見つかりました。\nver." + newFileVersion + "にアップデートしますか?\nアップデートするとLinearAudioPlayerは再起動します。") == DialogResult.OK)
                {
                    update();
                }
                else
                {
                    // 終了
                    Application.Exit();
                }
            }
            else
            {
                MessageUtils.showMessage(MessageBoxIcon.Information, "最新バージョンのLinearAudioPlayerを使用しています。");
                // 終了
                Application.Exit();
            }
        }
 public FileVersionHelper(string name)
 {
     exeName = name;
     try
     {
         fileInfo = FileVersionInfo.GetVersionInfo(exeName);
     }
     catch (Exception e)
     {
         fileInfo = null;
     }
 }
Ejemplo n.º 34
0
        static public void setVersionInfo()
        {
            //自分自身のバージョン情報を取得する
            System.Diagnostics.FileVersionInfo appver =
                System.Diagnostics.FileVersionInfo.GetVersionInfo(
                    System.Reflection.Assembly.GetExecutingAssembly().Location);

            LinearGlobal.ApplicationVersion = "ver."
                                              + appver.FileMajorPart.ToString() + "."
                                              + appver.FileMinorPart.ToString() + "."
                                              + appver.FileBuildPart.ToString();
        }
Ejemplo n.º 35
0
 /// <summary>
 /// 获取文件版本号
 /// </summary>
 /// <param name="filePath"></param>
 /// <returns></returns>
 public static string GetFileVersion(string filePath)
 {
     try
     {
         System.Diagnostics.FileVersionInfo fv = System.Diagnostics.FileVersionInfo.GetVersionInfo(filePath);
         return(fv.FileVersion);
     }
     catch
     {
         return("");
     }
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Get author from library
 /// </summary>
 /// <param name="t">Type</param>
 public static string GetAuthorFromLibrary(Type t)
 {
     try
     {
         // Extract author from company of assembly
         // Todo: Cache this
         System.Diagnostics.FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetAssembly(t).Location);
         return(versionInfo.CompanyName);
     }
     catch { }
     return(null);
 }
Ejemplo n.º 37
0
    // Read version of executable from app
    // Note: This is usually not updated by FFG and is not used for validity checks
    public string AppVersion()
    {
        string ffgVersion = "";

        try
        {
            System.Diagnostics.FileVersionInfo info = System.Diagnostics.FileVersionInfo.GetVersionInfo(exeLocation);
            ffgVersion = info.ProductVersion;
        }
        catch (System.Exception) { }
        return(ffgVersion);
    }
Ejemplo n.º 38
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ErrorLogging.Initialize();
            ErrorLogging.Log(string.Format("Starting TEdit {0}",ErrorLogging.Version));
            ErrorLogging.Log(string.Format("OS: {0}",Environment.OSVersion));

            Assembly asm = Assembly.GetExecutingAssembly();
            Version = FileVersionInfo.GetVersionInfo(asm.Location);

            if (!DependencyChecker.VerifyTerraria())
            {
                ErrorLogging.Log("Unable to locate Terraria. No texture data will be available.");
            }
            else
            {
                ErrorLogging.Log(string.Format("Terraria Data Path: {0}", DependencyChecker.PathToContent));
            }

            if (e.Args != null && e.Args.Count() > 0)
            {
                ErrorLogging.Log(string.Format("Command Line Open: {0}", e.Args[0]));
                this.Properties["OpenFile"] = e.Args[0];
            }

            if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Length > 0)
            {
                string fname = "No filename given";
                try
                {
                    fname = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];

                    // It comes in as a URI; this helps to convert it to a path.
                    var uri = new Uri(fname);
                    fname = uri.LocalPath;

                    this.Properties["OpenFile"] = fname;
                }
                catch (Exception ex)
                {
                    // For some reason, this couldn't be read as a URI.
                    // Do what you must...
                    ErrorLogging.LogException(ex);
                }
            }

            DispatcherHelper.Initialize();
            TaskFactoryHelper.Initialize();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            base.OnStartup(e);
        }
Ejemplo n.º 39
0
 private bool getActualization(string versionNueva)
 {
     System.Reflection.Assembly         assem = System.Reflection.Assembly.GetExecutingAssembly();
     System.Diagnostics.FileVersionInfo ver   = System.Diagnostics.FileVersionInfo.GetVersionInfo(assem.Location);
     if (ver.FileVersion == versionNueva)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 40
0
        public static string GetMyVersion()
        {
            int a = Common.Constants.CONSTANTY.C_NEJAKA_VERZE;

            var test = new Oracle.ManagedDataAccess.Client.OracleConnection();
            //Debug.Assert(test == null);
            var test2 = new NUnit.Framework.Constraints.AndOperator();

            System.Reflection.Assembly         assembly = System.Reflection.Assembly.GetExecutingAssembly();
            System.Diagnostics.FileVersionInfo fvi      = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);

            return($"AdapterDB.OracleVer={fvi.FileVersion}{Environment.NewLine}Using EXTERNAL Oracle.ManagedDataAccess 19.9{Environment.NewLine}Using NUNIT and CommonId: {a}");
        }
Ejemplo n.º 41
0
 internal static string getSMAPIVersion(string gameFolder)
 {
     if (System.IO.File.Exists(System.IO.Path.Combine(gameFolder, "StardewModdingAPI.exe")))
     {
         System.Diagnostics.FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(System.IO.Path.Combine(gameFolder, "StardewModdingAPI.exe"));
         string Version = string.Join(".", myFileVersionInfo.FileVersion.Split('.').Take(3));
         return(Version);
     }
     else
     {
         return("");
     }
 }
Ejemplo n.º 42
0
 public void SerializeToFile(string path)
 {
     using (FileStream fs = new FileStream(path, FileMode.Create))
     {
         this.LastUpdated = DateTime.UtcNow;
         System.Reflection.Assembly         assembly = System.Reflection.Assembly.GetExecutingAssembly();
         System.Diagnostics.FileVersionInfo fvi      = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
         this.Version = fvi.FileVersion;
         DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(eSettings));
         ser.WriteObject(fs, this);
         fs.Close();
     }
 }
Ejemplo n.º 43
0
        public MainForm()
        {
            InitializeComponent();

            intentionalClose = false;
            random = new Random();

            assemblyInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);

            LoadSettings();

            timer2.Interval = settings.DelayCloseWindowMilliseconds;
        }
Ejemplo n.º 44
0
 public static System.Diagnostics.FileVersionInfo GetPictFileVersionInfo()
 {
     if (versionInfo == null)
     {
         lock (mutex)
         {
             if (versionInfo == null)
             {
                 versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(GetPictExecutableFullPath());
             }
         } // end lock
     }     // end outer if
     return(versionInfo);
 }
Ejemplo n.º 45
0
        /// <summary>
        /// Gets a string identifying the DpcUtil.dll version.
        /// </summary>
        /// <returns>A string identifying the DpcUtil.dll version or a 'not found' text.</returns>
        /// <exception cref="Ptr32Exception">An error occurred communicating with the device.</exception>
        protected static string GetDpcUtilsVersion()
        {
            string dllpath = System.IO.Path.Combine(Environment.SystemDirectory, "dpcutil.dll");

            if (System.IO.File.Exists(dllpath))
            {
                System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(dllpath);
                return(fvi.FileVersion);
            }
            else
            {
                return("... PTR-32 USB driver not found " + dllpath);
            }
        }
Ejemplo n.º 46
0
 private void Parse(FileVersionInfo versionInfo)
 {
     Name = versionInfo.ProductName;
     Summary = string.IsNullOrEmpty(versionInfo.Comments) ? versionInfo.FileDescription : versionInfo.Comments;
     if (!string.IsNullOrEmpty(versionInfo.ProductVersion))
     {
         try
         {
             Version = new ImplementationVersion(versionInfo.ProductVersion.Trim());
         }
         catch (FormatException)
         {}
     }
 }
Ejemplo n.º 47
0
        public AboutForm()
        {
            InitializeComponent();

            System.Diagnostics.FileVersionInfo fmodver      = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\fmod\\fmodex.dll");
            System.Diagnostics.FileVersionInfo fcver        = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\finalstream\\Finalstream.Commons.dll");
            System.Diagnostics.FileVersionInfo sqlitever    = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\sqlite\\System.Data.SQLite.DLL");
            System.Diagnostics.FileVersionInfo sgver        = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\sourcegrid\\SourceGrid.dll");
            System.Diagnostics.FileVersionInfo taglibsver   = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\taglib\\taglib-sharp.dll");
            System.Diagnostics.FileVersionInfo szsver       = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\sevenzip\\SevenZipSharp.dll");
            System.Diagnostics.FileVersionInfo szver        = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\sevenzip\\7z.dll");
            System.Diagnostics.FileVersionInfo bassver      = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\bass\\bass.dll");
            System.Diagnostics.FileVersionInfo bassnetver   = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\bass\\Bass.Net.dll");
            System.Diagnostics.FileVersionInfo gapiver      = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\google\\GAPI.dll");
            System.Diagnostics.FileVersionInfo migemover    = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\migemo\\migemo.dll");
            System.Diagnostics.FileVersionInfo restsharpver = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\rest\\RestSharp.dll");
            System.Diagnostics.FileVersionInfo jsonver      = System.Diagnostics.FileVersionInfo.GetVersionInfo("lib\\json\\Newtonsoft.Json.dll");

            string mes = "\r\nCommon Library:\r\nFinalstream Commons Library ver." + fcver.FileVersion + "\r\nCopyright © 2008-2014 FINALSTREAM.\r\nhttp://www.finalstream.net/";

            mes += "\r\n\r\nPlay Engine:\r\nPowered by FMOD Sound System ver." + fmodver.FileVersion + "\r\nCopyright © Firelight Technologies Pty, Ltd., 1994-2014.\r\nhttp://www.fmod.org/";
            mes += "               \r\n\r\nPowered by BASS Audio Library ver." + bassver.FileVersion + "\r\nCopyright © 1999-2013 Un4seen Developments Ltd.\r\nhttp://www.un4seen.com/";
            mes += "               \r\nPowered by BASS.NET ver." + bassnetver.FileVersion + "\r\nCopyright © 2005-2013 by radio42, Hamburg, Germany\r\nhttp://www.bass.radio42.com/";
            mes += "\r\n\r\nDatabase Engine:\r\nPowered by System.Data.SQLite ver." + sqlitever.FileVersion + "\r\nhttp://system.data.sqlite.org/";
            mes += "\r\n\r\nGrid Engine:\r\nPowered by SourceGrid ver." + sgver.FileVersion + "\r\nCopyright © 2009-2010 Davide Icardi, Darius Damalakas\r\nhttp://sourcegrid.codeplex.com/\rhttp://bitbucket.org/dariusdamalakas/sourcegrid";
            mes += "\r\n\r\nTagEdit Engine:\r\nPowered by TagLib# ver." + taglibsver.FileVersion + "\r\nCopyright © 2006-2013 Brian Nickel\r\nhttp://download.banshee-project.org/taglib-sharp/";
            mes += "\r\n\r\nArchive Engine:\r\nPowered by SevenZipSharp ver." + szsver.FileVersion + "\r\nCopyright © markhor\r\nhttp://sevenzipsharp.codeplex.com/";
            mes += "               \r\nPowered by 7-Zip ver." + szver.FileVersion + "\r\nCopyright © 1999-2010 Igor Pavlov.\r\nhttp://www.7-zip.org/";
            mes += "\r\n\r\nGoogle API:\r\nPowered by Gapi.NET ver." + gapiver.FileVersion + "\r\nhttp://gapidotnet.codeplex.com/";
            mes += "\r\n\r\nIcon Product by Copyright © 2004 SHIN-ICHI.\r\nhttp://surviveplus.net/";
            mes += "\r\nIcon Product by Copyright © Mark James\r\nhttp://www.famfamfam.com/";
            mes += "\r\nIcon Product by Copyright © 2010 Prax08. Some rights reserved.\r\nhttp://prax-08.deviantart.com/";
            mes += "\r\nIcon Product by Copyright © chrfb\r\nhttp://chrfb.deviantart.com";
            mes += "\r\nIcon Product by Copyright © Yusuke Kamiyamane\r\nhttp://p.yusukekamiyamane.com/";
            mes += "\r\nIcon Product by Copyright © 19eighty7\r\nhttp://www.19eighty7.com";
            mes += "\r\nIcon Product by Copyright © Jonas Rask\r\nhttp://jonasraskdesign.com/";
            mes += "\r\nIcon Product by Copyright © Laurent Baumann\r\nhttp://lbaumann.com/";
            mes += "\r\nIcon Product by Copyright © acidrums4\r\nhttp://acidrums4.deviantart.com/";
            mes += "\r\n\r\nWebService:\r\nPowered by Google\r\nhttp://www.google.com/\r\nPowered by Amazon Japan\r\nhttp://www.amazon.co.jp/\r\nPowered by Yahoo! JAPAN\r\nhttp://www.yahoo.co.jp/";
            mes += "\r\n\r\nIncremental Search Engine by C/Migemo ver." + migemover.FileVersion + "\r\nCopyright © 2003-2007 MURAOKA Taro (KoRoN).\r\nhttp://code.google.com/p/cmigemo/";
            mes += "\r\n\r\nREST API by RestSharp ver." + restsharpver.FileVersion + "\r\nCopyright © RestSharp Project 2009-2012\r\nhttp://restsharp.org/";
            mes += "\r\n\r\nJSON API by Json.NET ver." + jsonver.FileVersion + "\r\nCopyright © 2007 James Newton-King\r\nhttp://james.newtonking.com/json/";
            mes += "\r\n\r\nWEBUI Engine:\r\nPowered by Bootstrap Copyright © 2011-2014 Twitter, Inc\r\nhttp://getbootstrap.com/";
            mes += "               \r\n\r\nPowered by jQuery Copyright © 2014 jQuery Foundation\r\nhttp://jquery.com/";
            mes += "\r\n\r\n\r\nThank you All Developers & Users.";

            lblversion.Text = LinearGlobal.ApplicationVersion;
            txtMessage.Text = mes;
        }
Ejemplo n.º 48
0
        public PluginInfo(string strFilePath, FileVersionInfo fvi,
            string strDisplayFilePath)
        {
            Debug.Assert(strFilePath != null);
            if(strFilePath == null) throw new ArgumentNullException("strFilePath");
            Debug.Assert(fvi != null);
            if(fvi == null) throw new ArgumentNullException("fvi");

            m_strFilePath = strFilePath;
            m_strDisplayFilePath = strDisplayFilePath;

            if(fvi.FileVersion != null) m_strFileVersion = fvi.FileVersion;

            if(fvi.FileDescription != null) m_strName = fvi.FileDescription;
            if(fvi.Comments != null) m_strDescription = fvi.Comments;
            if(fvi.CompanyName != null) m_strAuthor = fvi.CompanyName;
        }
Ejemplo n.º 49
0
        private Program()
        {
            fvi = Assembly.GetExecutingAssembly().GetVersionInfo();
            sprite = new SpriteDescriptor();
            charSets = new List<string>();
            fontSize = 24.0f;
            spacing = 1;
            alignment = GlyphAlignment.BestFit;
            forceSpace = true;
            maxSize = 2048;

            // create services
            services = new object[]
            {
                new XmlDocCreator(),
                new CharSetProvider(),
                new AtlasBuilder(this)
            };
        }
Ejemplo n.º 50
0
 public static bool IsDriverInstalled(out FileVersionInfo versionInfo)
 {
     versionInfo = null;
     bool drvInstalled = false;
     const uint GENERIC_READ = 0x80000000;
     // open service manager
     IntPtr scmgr = OpenSCManager(null, null, GENERIC_READ);
     if (!scmgr.Equals(IntPtr.Zero))
     {
         // open busdog service
         const uint SERVICE_QUERY_CONFIG = 0x00000001;
         IntPtr service = OpenService(scmgr, "busdog", SERVICE_QUERY_CONFIG);
         if (!service.Equals(IntPtr.Zero))
         {
             // find the busdog binary and get its file version
             uint dwBytesNeeded = 0;
             QueryServiceConfig(service, IntPtr.Zero, dwBytesNeeded, out dwBytesNeeded);
             IntPtr ptr = Marshal.AllocHGlobal((int)dwBytesNeeded);
             if (QueryServiceConfig(service, ptr, dwBytesNeeded, out dwBytesNeeded))
             {
                 // success! found busdog service and binary path
                 QUERY_SERVICE_CONFIG qsConfig = new QUERY_SERVICE_CONFIG();
                 Marshal.PtrToStructure(ptr, qsConfig);
                 // get version info of busdog binary
                 string sysroot = Environment.ExpandEnvironmentVariables("%systemroot%");
                 versionInfo = FileVersionInfo.GetVersionInfo(sysroot + "\\" + qsConfig.lpBinaryPathName);
                 // driver is installed and got all needed info
                 drvInstalled = true;
             }
             Marshal.FreeHGlobal(ptr);
             CloseServiceHandle(service);
         }
         CloseServiceHandle(scmgr);
     }
     return drvInstalled;
 }
Ejemplo n.º 51
0
 /// <summary>
 /// Initializes the <see cref="QuartzScheduler"/> class.
 /// </summary>
 static QuartzScheduler()
 {
     Assembly asm = Assembly.GetAssembly(typeof (QuartzScheduler));
     if (asm != null)
     {
         versionInfo = FileVersionInfo.GetVersionInfo(asm.Location);
     }
 }
Ejemplo n.º 52
0
 public static string GetProductName(FileVersionInfo fileVersionInfo) {
     return fileVersionInfo.ProductName;
 }
Ejemplo n.º 53
0
 public static Version GetFileVersion(FileVersionInfo fileVersionInfo) {
     return new Version(fileVersionInfo.FileMajorPart, fileVersionInfo.FileMinorPart,
         fileVersionInfo.FileBuildPart, fileVersionInfo.FilePrivatePart);
 }
Ejemplo n.º 54
0
		public static FileVersionInfo GetVersionInfo (string fileName)
		{
#if FEATURE_MONO_CAS
			if (SecurityManager.SecurityEnabled) {
				new FileIOPermission (FileIOPermissionAccess.Read, fileName).Demand ();
			}
#endif

			string absolute = Path.GetFullPath (fileName);
			if (!File.Exists (absolute))
				throw new FileNotFoundException (fileName);

			FileVersionInfo fvi = new FileVersionInfo ();
			fvi.GetVersionInfo_internal (fileName);
			return fvi;
		}
Ejemplo n.º 55
0
 private void AddFileVersionInfo(FileVersionInfo fileVersionInfo) {
     Debug.Trace("HashCodeCombiner", "FileMajorPart: " + fileVersionInfo.FileMajorPart.GetHashCode().ToString("x", CultureInfo.InvariantCulture));
     Debug.Trace("HashCodeCombiner", "FileMinorPart: " + fileVersionInfo.FileMinorPart.GetHashCode().ToString("x", CultureInfo.InvariantCulture));
     Debug.Trace("HashCodeCombiner", "FileBuildPart: " + fileVersionInfo.FileBuildPart.GetHashCode().ToString("x", CultureInfo.InvariantCulture));
     Debug.Trace("HashCodeCombiner", "FilePrivatePart: " + fileVersionInfo.FilePrivatePart.GetHashCode().ToString("x", CultureInfo.InvariantCulture));
     AddInt(fileVersionInfo.FileMajorPart.GetHashCode());
     AddInt(fileVersionInfo.FileMinorPart.GetHashCode());
     AddInt(fileVersionInfo.FileBuildPart.GetHashCode());
     AddInt(fileVersionInfo.FilePrivatePart.GetHashCode());
 }
Ejemplo n.º 56
0
        /// <summary>
        /// Loads the fabricator data from disk.
        /// </summary>
        /// <param name="path">Path to load the facbricator information from.</param>
        public override void Open(string path)
        {
            Assembly[] assemblies = new Assembly[] { Assembly.GetExecutingAssembly() };
            Wix.CodeDomReader reader = new Wix.CodeDomReader(assemblies);

            IA.IsolatedApp isolatedApp = reader.Load(path) as IA.IsolatedApp;
            if (null == isolatedApp)
            {
                throw new ApplicationException("Failed to load isolated app data file.");
            }

            this.description = null;
            this.packageId = Guid.Empty;
            this.manufacturer = null;
            this.appId = Guid.Empty;
            this.appVersion = null;
            this.updateUrl = null;
            this.details = null;
            this.name = null;
            this.source = null;
            this.entryPoint = null;
            this.iconPath = null;
            this.previousFeedUrl = null;

            foreach (Wix.ISchemaElement child in isolatedApp.Children)
            {
                if (child is IA.Package)
                {
                    foreach (Wix.ISchemaElement grandchild in ((IA.Package)child).Children)
                    {
                        if (grandchild is IA.Description)
                        {
                            this.description = ((IA.Description)grandchild).Content;
                        }
                        else if (grandchild is IA.Feed)
                        {
                            if (((IA.Feed)grandchild).Content != null)
                            {
                                this.updateUrl = new Uri(((IA.Feed)grandchild).Content);
                            }
                        }
                        else if (grandchild is IA.UpdateRate)
                        {
                            if (((IA.UpdateRate)grandchild).Content != 0)
                            {
                                this.updateRate = Convert.ToInt32(((IA.UpdateRate)grandchild).Content);
                            }
                        }
                        else if (grandchild is IA.Icon)
                        {
                        }
                        else if (grandchild is IA.Id)
                        {
                            if (((IA.Id)grandchild).Content != null)
                            {
                                this.packageId = new Guid(((IA.Id)grandchild).Content);
                            }
                        }
                        else if (grandchild is IA.Manufacturer)
                        {
                            this.manufacturer = ((IA.Manufacturer)grandchild).Content;
                        }
                        else if (grandchild is IA.Version)
                        {
                            if (((IA.Version)grandchild).Content != null)
                            {
                                this.appVersion = new Version(((IA.Version)grandchild).Content);
                            }
                        }
                    }
                }
                else if (child is IA.Application)
                {
                    foreach (Wix.ISchemaElement grandchild in ((IA.Application)child).Children)
                    {
                        if (grandchild is IA.Details)
                        {
                            this.details = ((IA.Details)grandchild).Content;
                        }
                        else if (grandchild is IA.EntryPoint)
                        {
                            this.entryPoint = ((IA.EntryPoint)grandchild).Content;
                        }
                        else if (grandchild is IA.Icon)
                        {
                            this.iconPath = ((IA.Icon)grandchild).Content;
                        }
                        else if (grandchild is IA.Id)
                        {
                            this.appId = new Guid(((IA.Id)grandchild).Content);
                        }
                        else if (grandchild is IA.Name)
                        {
                            this.name = ((IA.Name)grandchild).Content;
                        }
                        else if (grandchild is IA.Source)
                        {
                            if (((IA.Source)grandchild).Content != null)
                            {
                                string expandedSource = System.Environment.ExpandEnvironmentVariables(((IA.Source)grandchild).Content);
                                this.source = Path.GetFullPath(expandedSource);
                            }
                        }
                    }
                }
                else if (child is IA.PreviousFeed)
                {
                    if (((IA.PreviousFeed)child).Content != null)
                    {
                        string expandedUrl = System.Environment.ExpandEnvironmentVariables(((IA.PreviousFeed)child).Content);
                        this.previousFeedUrl = new Uri(expandedUrl);
                    }
                }
            }

            if (this.entryPoint != null)
            {
                if (this.source != null)
                {
                    string fullPath = Path.Combine(this.source, this.entryPoint);
                    this.entryPointVersionInfo = FileVersionInfo.GetVersionInfo(fullPath);
                }
            }

            if (this.Opened != null)
            {
                this.Opened(this, new EventArgs());
            }
        }
Ejemplo n.º 57
0
 public static string GetCompanyName(FileVersionInfo fileVersionInfo) {
     return fileVersionInfo.CompanyName;
 }
Ejemplo n.º 58
0
		private bool VersionCheck()
		{
			if (File.Exists(Environment.CurrentDirectory + "\\mtndew.dll"))
			{
				_eldoritoVersion = FileVersionInfo.GetVersionInfo(Environment.CurrentDirectory + "\\mtndew.dll");
				_localEldoritoVersion = _eldoritoVersion.ProductVersion;
			}
			else
			{
				_eldoritoVersion = null;
			}
			if (_localEldoritoVersion == _eldoritoLatestVersion)
				return true;
			return false;
		}
            string linkTargetForVersionInfo(ShortcutLocation location, IPackage package, FileVersionInfo versionInfo)
            {
                var possibleProductNames = new[] {
                    versionInfo.ProductName,
                    package.Title,
                    versionInfo.FileDescription,
                    Path.GetFileNameWithoutExtension(versionInfo.FileName)
                };

                var possibleCompanyNames = new[] {
                    versionInfo.CompanyName,
                    package.Authors.FirstOrDefault() ?? package.Id,
                };

                var prodName = possibleCompanyNames.First(x => !String.IsNullOrWhiteSpace(x));
                var pkgName = possibleProductNames.First(x => !String.IsNullOrWhiteSpace(x));

                return getLinkTarget(location, pkgName, prodName);
            }
Ejemplo n.º 60
0
 public static Version GetProductVersion(FileVersionInfo fileVersionInfo) {
     return new Version(fileVersionInfo.ProductMajorPart, fileVersionInfo.ProductMinorPart,
         fileVersionInfo.ProductBuildPart, fileVersionInfo.ProductPrivatePart);
 }