The Free Software Media System - Server Backend & API
Switch to using config file for installer
Eric Reede43f66ef0764
diff --git a/MediaBrowser.Installer/App.config b/MediaBrowser.Installer/App.configindex 8e15646352..eb69b68d0d 100644--- a/MediaBrowser.Installer/App.config+++ b/MediaBrowser.Installer/App.config@@ -1,5 +1,9 @@<?xml version="1.0" encoding="utf-8" ?><configuration>+ <appSettings>+ <add key="product" value="server" />+ <add key="class" value="Release" />+ </appSettings><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>diff --git a/MediaBrowser.Installer/Icon.ico b/MediaBrowser.Installer/Icon.iconew file mode 100644index 0000000000..4acd8f9219Binary files /dev/null and b/MediaBrowser.Installer/Icon.ico differdiff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.csindex efa2c71774..00b314b54b 100644--- a/MediaBrowser.Installer/MainWindow.xaml.cs+++ b/MediaBrowser.Installer/MainWindow.xaml.cs@@ -1,5 +1,6 @@using System;using System.Collections.Generic;+using System.Configuration;using System.Diagnostics;using System.IO;using System.Net;@@ -19,7 +20,7 @@ namespace MediaBrowser.Installerpublic partial class MainWindow : Window{protected PackageVersionClass PackageClass = PackageVersionClass.Release;- protected Version PackageVersion = new Version(10,0,0,0);+ protected Version PackageVersion = new Version(4,0,0,0);protected string PackageName = "MBServer";protected string RootSuffix = "-Server";protected string TargetExe = "MediaBrowser.ServerApplication.exe";@@ -64,29 +65,26 @@ namespace MediaBrowser.Installerprotected void GetArgs(){- var args = Environment.GetCommandLineArgs();+ var product = ConfigurationManager.AppSettings["product"] ?? "server";+ PackageClass = (PackageVersionClass) Enum.Parse(typeof (PackageVersionClass), ConfigurationManager.AppSettings["class"] ?? "Release");-- var parameters = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);- foreach (var arg in args)+ switch (product.ToLower()){- var nameValue = arg.Split('=');- try- {- parameters[nameValue[0]] = nameValue[1];- }- catch // let it default below- {- }+ case "mbt":+ PackageName = "MBTheater";+ RootSuffix = "-UI";+ TargetExe = "MediaBrowser.UI.exe";+ FriendlyName = "Media Browser Theater";+ break;++ default:+ PackageName = "MBServer";+ RootSuffix = "-Server";+ TargetExe = "MediaBrowser.ServerApplication.exe";+ FriendlyName = "Media Browser Server";+ break;}- // fill in our arguments if there- PackageName = parameters.GetValueOrDefault("package","MBServer");- PackageClass = (PackageVersionClass)Enum.Parse(typeof(PackageVersionClass), parameters.GetValueOrDefault("class","Release"));- PackageVersion = new Version(parameters.GetValueOrDefault("version","10.0.0.0"));- RootSuffix = parameters.GetValueOrDefault("suffix", "-Server");- TargetExe = parameters.GetValueOrDefault("target", "MediaBrowser.ServerApplication.exe");- FriendlyName = parameters.GetValueOrDefault("name", PackageName);RootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MediaBrowser" + RootSuffix);}diff --git a/MediaBrowser.Installer/MediaBrowser.Installer.csproj b/MediaBrowser.Installer/MediaBrowser.Installer.csprojindex ff6537b21f..ae7277abec 100644--- a/MediaBrowser.Installer/MediaBrowser.Installer.csproj+++ b/MediaBrowser.Installer/MediaBrowser.Installer.csproj@@ -28,8 +28,8 @@<ProductName>Media Browser Installer</ProductName><PublisherName>Media Browser Team</PublisherName><SuiteName>Media Browser</SuiteName>- <TrustUrlParameters>true</TrustUrlParameters>- <ApplicationRevision>10</ApplicationRevision>+ <OpenBrowserOnPublish>false</OpenBrowserOnPublish>+ <ApplicationRevision>11</ApplicationRevision><ApplicationVersion>0.1.1.%2a</ApplicationVersion><UseApplicationTrust>false</UseApplicationTrust><PublishWizardCompleted>true</PublishWizardCompleted>@@ -61,7 +61,7 @@<ManifestKeyFile>MediaBrowser.Installer_1_TemporaryKey.pfx</ManifestKeyFile></PropertyGroup><PropertyGroup>- <GenerateManifests>false</GenerateManifests>+ <GenerateManifests>true</GenerateManifests></PropertyGroup><PropertyGroup><SignManifests>true</SignManifests>@@ -72,6 +72,9 @@<PropertyGroup><ApplicationManifest>Properties\app.manifest</ApplicationManifest></PropertyGroup>+ <PropertyGroup>+ <ApplicationIcon>Icon.ico</ApplicationIcon>+ </PropertyGroup><ItemGroup><Reference Include="Ionic.Zip"><HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>@@ -80,6 +83,7 @@<HintPath>..\packages\ServiceStack.Text.3.9.37\lib\net35\ServiceStack.Text.dll</HintPath></Reference><Reference Include="System" />+ <Reference Include="System.Configuration" /><Reference Include="System.Data" /><Reference Include="System.Web" /><Reference Include="System.Xml" />@@ -145,6 +149,7 @@<Generator>ResXFileCodeGenerator</Generator><LastGenOutput>Resources.Designer.cs</LastGenOutput></EmbeddedResource>+ <None Include="mbt.config" /><None Include="MediaBrowser.Installer_1_TemporaryKey.pfx" /><None Include="Properties\app.manifest" /><None Include="Properties\Settings.settings">@@ -196,6 +201,9 @@<EmbedInteropTypes>True</EmbedInteropTypes></COMReference></ItemGroup>+ <ItemGroup>+ <Resource Include="Icon.ico" />+ </ItemGroup><Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /><!-- To modify your build process, add your task inside one of the targets below and uncomment it.Other similar extension points exist, see Microsoft.Common.targets.diff --git a/MediaBrowser.Installer/Properties/app.manifest b/MediaBrowser.Installer/Properties/app.manifestindex f499e6ab6d..887fa2b9d7 100644--- a/MediaBrowser.Installer/Properties/app.manifest+++ b/MediaBrowser.Installer/Properties/app.manifest@@ -19,8 +19,8 @@<requestedExecutionLevel level="asInvoker" uiAccess="false" /></requestedPrivileges><applicationRequestMinimum>- <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" /><defaultAssemblyRequest permissionSetReference="Custom" />+ <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" /></applicationRequestMinimum></security></trustInfo>diff --git a/MediaBrowser.Installer/mbt.config b/MediaBrowser.Installer/mbt.confignew file mode 100644index 0000000000..b94d81797d--- /dev/null+++ b/MediaBrowser.Installer/mbt.config@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="utf-8" ?>+<configuration>+ <appSettings>+ <add key="product" value="mbt" />+ <add key="class" value="Release" />+ </appSettings>+ <startup>+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />+ </startup>+</configuration>\ No newline at end of file