diff --git a/README.md b/README.md new file mode 100644 index 0000000..2931351 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Disable Live Content for P2G packages + +**Issue:** + +IIS 7.0 on Windows Server 2012 does not support WMV streaming (Microsoft Media Server); cannot setup following Mediasite content server. + +**Why is it an issue?** + +You can't proceed at importing such presentations (usually those from previous Mediasite Server versions). + +**So?** + +Update Mediasite Presentation XML file with `IsLive` set to **false** and `LiveStatus` **0**. + +## SYNOPSIS + +`p2g_fix.exe --live *P2G *P2G *P2G [...]` + +## NOTES + +* Does not support zipped packages (unzip them first). +* [Perl2Exe](http://www.indigostar.com/perl2exe.php) +* _IDE_ Notepad + +## DISCLAIMER + +Don't blame me. diff --git a/p2g_fix.pl b/p2g_fix.pl new file mode 100644 index 0000000..bce8b53 --- /dev/null +++ b/p2g_fix.pl @@ -0,0 +1,50 @@ +use strict; +use warnings 'all'; + +use File::Glob 'bsd_glob'; + +# ===== MAIN ===== +# --- OPTIONS --- +err(qq(bad option, use '--live')) + unless shift eq '--live'; +# --- RUN --- +p2g_fix(@ARGV); +# ================ + +sub p2g_fix { + +# PERLDOC +# Win32 users should use the real slash. +# If you really want to use backslashes, +# consider using Sarathy's File::DosGlob + +while (defined(my $p2g = shift)) { +err(qq("$p2g" not a directory)) unless -d $p2g; + +my ($xml) = grep( +/MediasitePresentation_\d{2}\.xml$/i, +bsd_glob(qq($p2g/*), File::Glob::GLOB_ERR | File::Glob::GLOB_NOSORT) +); +err(qq(Error reading "$p2g")) if File::Glob::GLOB_ERROR; + +local @ARGV = $xml || err(qq("$p2g" please specify P2G directory)); + +# live_content_fix +my $fix = 0; +msg($p2g, 'found backup file, not proceeding'),next + if -e $xml.'.bak'; + +# in-place edit with a backup file +local $^I = '.bak'; +while (<>) { +s/$1/false/,$fix++ if /(true)(1)> ', shift, "\n"} +sub err {die '(ERR) ' . shift . "\n"} \ No newline at end of file