Skip to content

Instantly share code, notes, and snippets.

@billinkc
Created April 19, 2016 04:44
Show Gist options
  • Save billinkc/494418809cf199e741a57e23d2dc1443 to your computer and use it in GitHub Desktop.
Save billinkc/494418809cf199e741a57e23d2dc1443 to your computer and use it in GitHub Desktop.
If it would build, this biml would generate an SSIS package with a Script task to play the intro bars to Star Wars.
<!--
This is the relevant bit of the include that VS makes for the dll
-->
<ItemGroup>
<COMReference Include="WMPLib">
<Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<ScriptProjects>
<ScriptTaskProject ProjectCoreName="ST_PlayMidi" Name="ST_PlayMidi" VstaMajorVersion="0">
<Files>
<File Path="ScriptMain.cs" BuildAction="Compile">
<![CDATA[namespace IRule
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
using WMPLib;
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
WindowsMediaPlayer wmp = new WindowsMediaPlayer();
wmp.URL = @"C:\Users\BillFellows\Downloads\Movie_Themes_-_Star_Wars_-_by_John_Willams.mid";
wmp.controls.play();
System.Threading.Thread.Sleep(6000);
Dts.TaskResult = (int)ScriptResults.Success;
}
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
}
}
]]></File>
<File Path="Properties\AssemblyInfo.cs" BuildAction="Compile">
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("AssemblyTitle")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Bill Fellows")]
[assembly: AssemblyProduct("I do bad things with SSIS")]
[assembly: AssemblyCopyright("Copyright @ 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.*")]
</File>
</Files>
<AssemblyReferences>
<AssemblyReference AssemblyPath="System" />
<AssemblyReference AssemblyPath="System.Core" />
<AssemblyReference AssemblyPath="System.Data" />
<AssemblyReference AssemblyPath="System.Data.DataSetExtensions" />
<AssemblyReference AssemblyPath="System.Windows.Forms" />
<AssemblyReference AssemblyPath="System.Xml" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.ManagedDTS.dll" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.ScriptTask.dll" />
<!--
Neither of the following work :(
Metadata file 'c:\Windows\System32\wmp.dll' could not be opened -- 'An attempt was made to load a program with an incorrect format.
-->
<AssemblyReference AssemblyPath="C:\Windows\System32\wmp.dll" />
<AssemblyReference AssemblyPath="C:\Windows\SysWOW64\wmp.dll" />
</AssemblyReferences>
</ScriptTaskProject>
</ScriptProjects>
<Packages>
<Package Name="PleaseDoThis">
<Tasks>
<Script ProjectCoreName="ST_PlayMidi" Name="SCR Be Epic">
<ScriptTaskProjectReference ScriptTaskProjectName="ST_PlayMidi" />
</Script>
</Tasks>
</Package>
</Packages>
</Biml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment