Skip to content

Commit

Permalink
Add Setup exe to install vcredist.
Browse files Browse the repository at this point in the history
SkiaSharp requires Visual C++ 2015 redistributable to be installed.
Add a WIX bootstrapper exe that installs Visual C++ 2015 dlls and then installs the Voxels.Installer.msi file.
Add Voxels.CommandLine.exe to installer and allow it to process multiple files and report usage if no files are present.
Remove unused nuget packages.
  • Loading branch information
Arlorean committed Aug 8, 2017
1 parent df6f605 commit dad9f18
Show file tree
Hide file tree
Showing 16 changed files with 488 additions and 75 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
/Voxels.SkiaSharp/obj
/Voxels.Test/bin/Release
/Voxels.Test/obj/Release
/Voxels.CommandLine/bin.old
/Voxels.Setup/bin/Release
/Voxels.Setup/obj/Release
*.user
/Voxels.Setup/Voxels.Setup.wixproj.user
Binary file added Voxels.CommandLine/2x2x2.vox
Binary file not shown.
21 changes: 13 additions & 8 deletions Voxels.CommandLine/Program.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Voxels.SkiaSharp;

namespace Voxels.CommandLine {
class Program {
static void Main(string[] args) {
var filename = args.Length == 1 ? args[0] : "wizard.vox";
using (var stream = File.OpenRead(filename)) {
var voxelData = MagicaVoxel.Read(stream);
if (args.Length == 0) {
Console.WriteLine("usage: Voxels.CommandLine.exe voxfiles...\n Converts .vox files to .png and .svg files.");
}
else {
NativeLibrary.Initialize();

foreach (var filename in args) {
using (var stream = File.OpenRead(filename)) {
var voxelData = MagicaVoxel.Read(stream);

File.WriteAllBytes(Path.ChangeExtension(filename, ".png"), Renderer.RenderPng(512, voxelData));
File.WriteAllBytes(Path.ChangeExtension(filename, ".svg"), Renderer.RenderSvg(512, voxelData));
File.WriteAllBytes(Path.ChangeExtension(filename, ".png"), Renderer.RenderPng(512, voxelData));
File.WriteAllBytes(Path.ChangeExtension(filename, ".svg"), Renderer.RenderSvg(512, voxelData));
}
}
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion Voxels.CommandLine/Voxels.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -56,6 +57,9 @@
<Content Include="1x2x3.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="2x2x2.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
<Content Include="wizard.vox">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -72,4 +76,7 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<PropertyGroup>
<PostBuildEvent>del libSkiaSharp.dll</PostBuildEvent>
</PropertyGroup>
</Project>
25 changes: 14 additions & 11 deletions Voxels.Installer/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"><?define Voxels.ShellExtensions_TargetDir=$(var.Voxels.ShellExtensions.TargetDir)?>
<Product Id="*" Name="Voxels.Installer" Language="1033" Version="1.0.0.3" Manufacturer="Arlorean" UpgradeCode="70e5c55f-1a55-4856-a0fc-a82ece384a74">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Voxels.Installer" Language="1033" Version="1.1.0.0" Manufacturer="Arlorean" UpgradeCode="70e5c55f-1a55-4856-a0fc-a82ece384a74">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
Expand Down Expand Up @@ -35,38 +35,41 @@
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="Voxels.ShellExtensions.dll" Guid="eced76bf-65e4-4dd4-92fc-757bf1d60ae2">
<File Id="Voxels.ShellExtensions.dll" Name="Voxels.ShellExtensions.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)Voxels.ShellExtensions.dll" />
<File Id="Voxels.ShellExtensions.dll" Name="Voxels.ShellExtensions.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)Voxels.ShellExtensions.dll" />
</Component>
<Component Id="Voxels.SkiaSharp.dll" Guid="1d21f5cc-cf46-4d58-86f4-dc21561c5550">
<File Id="Voxels.SkiaSharp.dll" Name="Voxels.SkiaSharp.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)Voxels.SkiaSharp.dll" />
<File Id="Voxels.SkiaSharp.dll" Name="Voxels.SkiaSharp.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)Voxels.SkiaSharp.dll" />
</Component>
<Component Id="Voxels.dll" Guid="a0af3960-3b51-4402-a5c6-fed81d1e9b4b">
<File Id="Voxels.dll" Name="Voxels.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)Voxels.dll" />
<File Id="Voxels.dll" Name="Voxels.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)Voxels.dll" />
</Component>
<Component Id="SharpShell.dll" Guid="93680dd3-e026-4344-b983-75bab9446df5">
<File Id="SharpShell.dll" Name="SharpShell.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)SharpShell.dll" />
<File Id="SharpShell.dll" Name="SharpShell.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)SharpShell.dll" />
</Component>
<Component Id="SkiaSharp.dll" Guid="e9aebeae-5129-424a-adba-1d4617255c0a">
<File Id="SkiaSharp.dll" Name="SkiaSharp.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)SkiaSharp.dll" />
<File Id="SkiaSharp.dll" Name="SkiaSharp.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)SkiaSharp.dll" />
</Component>
<Component Id="srm.exe" Guid="8AD977A7-89BA-4D9C-B7CB-0D595B6426EA">
<File Id="srm.exe" Source="$(var.Voxels.ShellExtensions_TargetDir)srm.exe" KeyPath="yes" />
<File Id="srm.exe" Source="$(var.Voxels.ShellExtensions.TargetDir)srm.exe" KeyPath="yes" />
</Component>
<Component Id="Voxels.CommandLine.exe" Guid="{37E18973-EA93-418D-ADDD-88375E068191}">
<File Id="Voxels.CommandLine.exe" Source="$(var.Voxels.CommandLine.TargetDir)Voxels.CommandLine.exe" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponentsx86" Directory="INSTALLFOLDERx86">
<Component Id="x86_libSkiaSharp.dll" Guid="6B6B3855-966E-4926-8D1D-1030C70F400D">
<File Id="x86_libSkiaSharp.dll" Name="libSkiaSharp.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)\x86\libSkiaSharp.dll" />
<File Id="x86_libSkiaSharp.dll" Name="libSkiaSharp.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)x86\libSkiaSharp.dll" />
</Component>
</ComponentGroup>
</Fragment>

<Fragment>
<ComponentGroup Id="ProductComponentsx64" Directory="INSTALLFOLDERx64">
<Component Id="x64_libSkiaSharp.dll" Guid="442D691A-9508-4FDF-9EE6-3B3A59595F10">
<File Id="x64_libSkiaSharp.dll" Name="libSkiaSharp.dll" Source="$(var.Voxels.ShellExtensions_TargetDir)\x64\libSkiaSharp.dll" />
<File Id="x64_libSkiaSharp.dll" Name="libSkiaSharp.dll" Source="$(var.Voxels.ShellExtensions.TargetDir)x64\libSkiaSharp.dll" />
</Component>
</ComponentGroup>
</Fragment>
Expand Down
8 changes: 8 additions & 0 deletions Voxels.Installer/Voxels.Installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
<Compile Include="Product.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Voxels.CommandLine\Voxels.CommandLine.csproj">
<Name>Voxels.CommandLine</Name>
<Project>{1e4d9af1-41e1-4c81-9d9a-ef22f101e69f}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\Voxels.ShellExtensions\Voxels.ShellExtensions.csproj">
<Name>Voxels.ShellExtensions</Name>
<Project>{f8a32354-da2b-406c-aebe-dcefd85fd033}</Project>
Expand Down
108 changes: 108 additions & 0 deletions Voxels.Setup/Bundle.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<!-- Source: https://gist.github.com/nathancorvussolis/6852ba282647aeb0c5c00e742e28eb48 -->
<Bundle Name="Voxels Shell Extensions" Version="1.1.0.0" Manufacturer="Arlorean"
Copyright="© 2017 Adam Davidson" AboutUrl="https://github.com/Arlorean/Voxels"
UpgradeCode="{1823F323-C07E-4502-A4BA-CA8EDCA46161}" Condition="VersionNT &gt;= v5.1"
IconSourceFile="Voxels.ico">

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="License.rtf" ShowVersion="yes" SuppressOptionsUI="yes"
LogoFile="Voxels.ico"/>
</BootstrapperApplicationRef>

<!-- v6.0 Service Pack 2 -->
<bal:Condition Message="This application requires Service Pack 2 for Windows Vista / Server 2008.">
(VersionNT &lt;&gt; v6.0) OR (VersionNT = v6.0 AND ServicePackLevel &gt;= 2)
</bal:Condition>

<!-- v6.1 Service Pack 1 -->
<bal:Condition Message="This application requires Service Pack 1 for Windows 7 / Server 2008 R2.">
(VersionNT &lt;&gt; v6.1) OR (VersionNT = v6.1 AND ServicePackLevel &gt;= 1)
</bal:Condition>

<!-- v6.3 KB2919355 -->
<util:FileSearch Id="HAL.DLL" Path="[WindowsFolder]System32\hal.dll"
Result="version" Variable="NT603HALVER" Condition="VersionNT = v6.3" />
<bal:Condition Message="This application requires S14 Update (KB2919355) for Windows 8.1 / Server 2012 R2.">
(VersionNT &lt;&gt; v6.3) OR (VersionNT = v6.3 AND NT603HALVER &gt; v6.3.9600.16500)
</bal:Condition>

<!-- Visual C++ 2015 Redistributable (x64) version -->
<util:ProductSearch
Id="VCRedist2015x64"
Result="version"
Variable="VCRedist2015x64"
UpgradeCode="C146EF48-4D31-3C3D-A2C5-1E91AF8A0A9B"
Condition="VersionNT64" />

<!-- Visual C++ 2015 Redistributable (x86) version -->
<util:ProductSearch
Id="VCRedist2015x86"
Result="version"
Variable="VCRedist2015x86"
UpgradeCode="F899BAD3-98ED-308E-A905-56B5338963FF" />

<!-- Visual C++ 2015 Redistributable version -->
<Variable Name="VCRedist2015" Type="version" Value="14.0.24215.1" />

<Chain>

<!-- Visual C++ 2015 Redistributable Update 3 (x64) -->
<ExePackage
Id="vc_redist.x64.exe"
Name="vc_redist.x64.14.0.24215.1.exe"
DisplayName="Visual C++ 2015 Redistributable Update 3 (x64)"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
InstallCondition="VersionNT64"
DetectCondition="VCRedist2015x64 &gt;= VCRedist2015"
DownloadUrl="https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe"
InstallCommand="/install /quiet /norestart"
RepairCommand="/repair /quiet /norestart"
UninstallCommand="/uninstall /quiet /norestart" >
<RemotePayload
ProductName="Visual C++ 2015 Redistributable Update 3 (x64)"
Version="14.0.24215.1"
Description="https://www.microsoft.com/en-us/download/details.aspx?id=53840"
Hash="10B1683EA3FF5F36F225769244BF7E7813D54AD0"
Size="15301888" />
</ExePackage>

<!-- Visual C++ 2015 Redistributable Update 3 (x86) -->
<ExePackage
Id="vc_redist.x86.exe"
Name="vc_redist.x86.14.0.24215.1.exe"
DisplayName="Visual C++ 2015 Redistributable Update 3 (x86)"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
InstallCondition="VersionNT"
DetectCondition="VCRedist2015x86 &gt;= VCRedist2015"
DownloadUrl="https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x86.exe"
InstallCommand="/install /quiet /norestart"
RepairCommand="/repair /quiet /norestart"
UninstallCommand="/uninstall /quiet /norestart" >
<RemotePayload
ProductName="Visual C++ 2015 Redistributable Update 3 (x86)"
Version="14.0.24215.1"
Description="https://www.microsoft.com/en-us/download/details.aspx?id=53840"
Hash="72211BD2E7DFC91EA7C8FAC549C49C0543BA791B"
Size="14456872" />
</ExePackage>

<MsiPackage Id="Voxels.Installer" DisplayName="$(var.Voxels.Installer.TargetFileName)" ForcePerMachine="yes" Compressed="yes"
SourceFile="$(var.Voxels.Installer.TargetPath)" />

</Chain>

</Bundle>

</Wix>
Loading

0 comments on commit dad9f18

Please sign in to comment.