Skip to content

Commit

Permalink
Merge pull request #4 from hansdude/master
Browse files Browse the repository at this point in the history
Created a simple installer for the PowerShell module.
  • Loading branch information
rpmoore committed Apr 16, 2014
2 parents 4b21ee3 + 96a3a5f commit 232bbdc
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Ds3Client/BuildModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ New-ModuleManifest `
-FileList @() `
-ClrVersion $clrVersion `
-ModuleVersion $moduleVersion

# Write to zip.
$zipfile = $moduleDir + ".zip"
if ((Test-Path $zipFile) -eq $true) { rm $zipFile }
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") > $null
[System.IO.Compression.ZipFile]::CreateFromDirectory(
$moduleDir,
$zipFile,
[System.IO.Compression.CompressionLevel]::Optimal,
$false
)
2 changes: 1 addition & 1 deletion Ds3Client/Ds3Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ds3Client</RootNamespace>
<AssemblyName>Ds3Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions Ds3ClientInstaller/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
72 changes: 72 additions & 0 deletions Ds3ClientInstaller/Ds3ClientInstaller.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<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>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ds3ClientInstaller</RootNamespace>
<AssemblyName>Ds3ClientInstaller</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersionInfo.cs">
<Link>VersionInfo.cs</Link>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Ds3Client\bin\Release\Modules\Ds3Client.zip">
<Link>Ds3Client.zip</Link>
</EmbeddedResource>
<None Include="App.config" />
<EmbeddedResource Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ds3Client\Ds3Client.csproj">
<Project>{354c57fe-7738-4040-9726-59476513b06a}</Project>
<Name>Ds3Client</Name>
</ProjectReference>
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
25 changes: 25 additions & 0 deletions Ds3ClientInstaller/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.IO;
using System.IO.Compression;
using System.Reflection;

namespace Ds3ClientInstaller
{
class Program
{
static void Main(string[] args)
{
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ds3ClientInstaller.Ds3Client.zip"))
using (var zip = new ZipArchive(stream))
{
var myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var moduleDirectory = Path.Combine(myDocs, @"WindowsPowerShell\Modules\Ds3Client");
if (Directory.Exists(moduleDirectory))
{
Directory.Delete(moduleDirectory, true);
}
zip.ExtractToDirectory(moduleDirectory);
}
}
}
}
23 changes: 23 additions & 0 deletions Ds3ClientInstaller/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Ds3ClientInstaller")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ds3ClientInstaller")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("24058941-581a-4617-98e4-7edf19807896")]
44 changes: 44 additions & 0 deletions Ds3ClientInstaller/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Windows will automatically select the most compatible environment.-->

<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>

<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>

<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>

<!-- If your application is designed to work with Windows 8.1, uncomment the following supportedOS node-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>

</application>
</compatibility>

</asmv1:assembly>
4 changes: 2 additions & 2 deletions VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
6 changes: 6 additions & 0 deletions ds3_net_sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestDs3", "TestDs3\TestDs3.csproj", "{E9315C7A-23BC-4D7D-BF63-FBB94B0F80E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ds3ClientInstaller", "Ds3ClientInstaller\Ds3ClientInstaller.csproj", "{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -45,6 +47,10 @@ Global
{E9315C7A-23BC-4D7D-BF63-FBB94B0F80E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9315C7A-23BC-4D7D-BF63-FBB94B0F80E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9315C7A-23BC-4D7D-BF63-FBB94B0F80E7}.Release|Any CPU.Build.0 = Release|Any CPU
{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED10E7CE-FBB5-4A64-B821-B30A9F7CAD40}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 232bbdc

Please sign in to comment.