Skip to content

Commit

Permalink
Upgrade VS2019/.NET4.7.2, Migrate Wix as NuGet package, and Update AWS
Browse files Browse the repository at this point in the history
SDK version
  • Loading branch information
hohno-panopto committed Sep 1, 2020
1 parent b11a84a commit 7f25300
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 36 deletions.
30 changes: 15 additions & 15 deletions WatchFolderService/App.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<appSettings>
<add key="Server" value="your.panopto.servername" />
<add key="InfoFilePath" value="C:\Users\Default\Documents\WatchFolder\WatchFolderInfo.txt" />
<add key="WatchFolder" value="C:\Users\Default\Documents\WatchFolder" />
<add key="UserID" value="PanoptoUserName" />
<add key="UserKey" value="PanoptoUserPassword" />
<add key="FolderID" value="00000000-0000-0000-0000-000000000000" />
<add key="Verbose" value="false" />
<add key="PartSize" value="6000000" />
<add key="ElapseTime" value="10000" />
<add key="FileWaitTime" value="30" />
<add key="UploadExtensions" value=".avi;.asf;.wmv;.mpg;.mpeg;.ps;.ts;.m2v;.mp2;.mod;.mp4;.m4v;.mov;.qt;.3gp;.flv;.f4v;.mp3;.wma;.m2a;.m4a;.f4a" />
<add key="AllowedNumberFailedAttempts" value="3" />
<add key="Server" value="your.panopto.servername"/>
<add key="InfoFilePath" value="C:\Users\Default\Documents\WatchFolder\WatchFolderInfo.txt"/>
<add key="WatchFolder" value="C:\Users\Default\Documents\WatchFolder"/>
<add key="UserID" value="PanoptoUserName"/>
<add key="UserKey" value="PanoptoUserPassword"/>
<add key="FolderID" value="00000000-0000-0000-0000-000000000000"/>
<add key="Verbose" value="false"/>
<add key="PartSize" value="6000000"/>
<add key="ElapseTime" value="10000"/>
<add key="FileWaitTime" value="30"/>
<add key="UploadExtensions" value=".avi;.asf;.wmv;.mpg;.mpeg;.ps;.ts;.m2v;.mp2;.mod;.mp4;.m4v;.mov;.qt;.3gp;.flv;.f4v;.mp3;.wma;.m2a;.m4a;.f4a"/>
<add key="AllowedNumberFailedAttempts" value="3"/>
</appSettings>
</configuration>
</configuration>
5 changes: 4 additions & 1 deletion WatchFolderService/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,14 @@ public static AmazonS3Client CreateS3Client(

Uri serviceUri = new Uri(GetServiceUrlFromUploadTarget(uploadTarget));

// Panopto server supports signature version 2 at this time.
Amazon.AWSConfigsS3.UseSignatureVersion4 = false;
AmazonS3Config s3Config = new AmazonS3Config()
{
// Amazon SDK will append uploadBucketName ("Upload") to the path and hence hit the actual service endpoint
ServiceURL = serviceUri.AbsoluteUri,
UseHttp = serviceUri.Scheme == "http"
UseHttp = serviceUri.Scheme == "http",
SignatureVersion = "2",
};

AmazonS3Client s3Client = new AmazonS3Client(
Expand Down
6 changes: 3 additions & 3 deletions WatchFolderService/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PanoptoWatchFolderService")]
[assembly: AssemblyCopyright("Copyright © 2017 Panopto")]
[assembly: AssemblyCopyright("Copyright © 2020 Panopto")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
43 changes: 38 additions & 5 deletions WatchFolderService/WatchFolderService.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -9,8 +9,24 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WatchFolderService</RootNamespace>
<AssemblyName>WatchFolderService</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -36,9 +52,11 @@
</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="AWSSDK, Version=2.3.55.2, Culture=neutral, PublicKeyToken=9f476d3089b52be3, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.2.3.55.2\lib\net45\AWSSDK.dll</HintPath>
<Private>True</Private>
<Reference Include="AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.5.1.2\lib\net45\AWSSDK.Core.dll</HintPath>
</Reference>
<Reference Include="AWSSDK.S3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.S3.3.5.0.4\lib\net45\AWSSDK.S3.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down Expand Up @@ -90,6 +108,21 @@
<DependentUpon>WatchFolderService.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.S3.3.5.0.4\analyzers\dotnet\cs\AWSSDK.S3.CodeAnalysis.dll" />
</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.
Expand Down
3 changes: 2 additions & 1 deletion WatchFolderService/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AWSSDK" version="2.3.55.2" targetFramework="net45" />
<package id="AWSSDK.Core" version="3.5.1.2" targetFramework="net472" />
<package id="AWSSDK.S3" version="3.5.0.4" targetFramework="net472" />
</packages>
20 changes: 9 additions & 11 deletions WatchFolderServiceInstaller/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Panopto Watch Folder Service" Version="1.2.0.0" Manufacturer="Panopto" Language="1033" UpgradeCode="841957fd-9904-43a3-8c78-84b9a7c8219e">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" />
<Product Id="*" Name="Panopto Watch Folder Service" Version="1.3.0.0" Manufacturer="Panopto" Language="1033" UpgradeCode="841957fd-9904-43a3-8c78-84b9a7c8219e">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perMachine" />
<Media Id="1" Cabinet="Cab1.cab" EmbedCab="yes" />

<!-- AllowSameVersionUpgrades allows easier development iteration. This causes ICE61 warning, but it may be ignored. -->
Expand All @@ -21,7 +21,7 @@

<!-- Add files + service installation -->
<ComponentGroup Id="ProductComponents" Directory="INSTALLDIR">
<Component Id="WatchFolderService.exe" Guid="d12899d0-bbe7-4136-9858-809b07c926bd">
<Component Id="WatchFolderService.exe" Guid="12b6e2a8-450c-4c43-960d-765cc0cca76b">
<File Id="WatchFolderService.exe" Source="..\WatchFolderService\bin\$(var.Configuration)\WatchFolderService.exe" KeyPath="yes" />
<ServiceInstall
Id="ServiceInstaller"
Expand All @@ -42,19 +42,17 @@
Remove="uninstall"
Name="PanoptoWatchFolderService"
Wait="yes" />
</Component>
<Component Id="WatchFolderService.exe.config" Guid="bdb30cfe-e969-447d-a6cd-2a9444b872b8">
<File Id="WatchFolderService.exe.config" Source="..\WatchFolderService\bin\$(var.Configuration)\WatchFolderService.exe.config" KeyPath="yes" />
</Component>
<Component Id="AWSSDK.dll" Guid="802c91f9-d757-4e34-9b95-59a52c178379">
<File Id="AWSSDK.dll" Source="..\WatchFolderService\bin\$(var.Configuration)\AWSSDK.dll" KeyPath="yes" />

<File Id="WatchFolderService.exe.config" Source="..\WatchFolderService\bin\$(var.Configuration)\WatchFolderService.exe.config" />
<File Id="AWSSDK.Core.dll" Source="..\WatchFolderService\bin\$(var.Configuration)\AWSSDK.Core.dll" />
<File Id="AWSSDK.S3.dll" Source="..\WatchFolderService\bin\$(var.Configuration)\AWSSDK.S3.dll" />
</Component>
</ComponentGroup>

<!-- Action -->
<Feature Id="Service" Title="Panopto Watch Folder Service" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<ComponentGroupRef Id="ProductComponents" />
</Feature>

<!-- Use WiX pre-defined sequence -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
Expand Down
12 changes: 12 additions & 0 deletions WatchFolderServiceInstaller/WatchFolderServiceInstaller.wixproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\packages\WiX.3.11.2\build\wix.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand All @@ -10,6 +11,8 @@
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
Expand Down Expand Up @@ -40,7 +43,16 @@
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.2\build\wix.props'))" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
Expand Down
4 changes: 4 additions & 0 deletions WatchFolderServiceInstaller/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WiX" version="3.11.2" />
</packages>

0 comments on commit 7f25300

Please sign in to comment.