diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2015-02-03 10:40:25 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2015-02-03 14:18:50 -0800 |
commit | aba57a20134e06fe8c81836ccdf9b94ad1ce2d71 (patch) | |
tree | b182abedef411752b65805f22ea4c64d249bfe1e /platform/windows/gsview/MainWindow.xaml.cs | |
parent | ff89d591b7ed859534bfdf31c6a48913ab22ab5b (diff) | |
download | mupdf-aba57a20134e06fe8c81836ccdf9b94ad1ce2d71.tar.xz |
Installer changes for gsview.nsi
Addition of license information. Also changes to ensure registry keys used
by application are removed during the uninstall. Many changes in the
installer code to ensure that the file type associations are made and the
proper icons are displayed for each file type.
Diffstat (limited to 'platform/windows/gsview/MainWindow.xaml.cs')
-rw-r--r-- | platform/windows/gsview/MainWindow.xaml.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/platform/windows/gsview/MainWindow.xaml.cs b/platform/windows/gsview/MainWindow.xaml.cs index fd26a50b..c6979231 100644 --- a/platform/windows/gsview/MainWindow.xaml.cs +++ b/platform/windows/gsview/MainWindow.xaml.cs @@ -21,6 +21,9 @@ using System.Printing; using System.Windows.Markup; using System.Runtime.InteropServices; using Microsoft.Win32; /* For registry */ +using System.Reflection; +using System.Diagnostics; + public enum AA_t { @@ -597,12 +600,23 @@ namespace gsview return result; } + private String GetVersion() + { + Assembly assembly = Assembly.GetExecutingAssembly(); + FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); + String vers = fileVersionInfo.ProductVersion; + String[] parts = vers.Split('.'); + String simple_vers = parts[0] + '.' + parts[1]; + return simple_vers; + } + /* Initialize from registry */ private void InitFromRegistry() { RegistryKey key = Registry.CurrentUser.CreateSubKey("Software"); RegistryKey keyA = key.CreateSubKey("Artifex Software"); - RegistryKey keygs = keyA.CreateSubKey("GSview 6.0"); + String vers = GetVersion(); + RegistryKey keygs = keyA.CreateSubKey("gsview " + vers); String filepath = null; Int32 page; AA_t aa = AA_t.HIGH; @@ -640,7 +654,8 @@ namespace gsview RegistryKey key = Registry.CurrentUser.CreateSubKey("Software"); RegistryKey keyA = key.CreateSubKey("Artifex Software"); - RegistryKey keygs = keyA.CreateSubKey("GSview 6.0"); + String vers = GetVersion(); + RegistryKey keygs = keyA.CreateSubKey("gsview " + vers); if (m_origfile != null && (m_document_type == DocumentTypes.PS || m_document_type == DocumentTypes.EPS)) |