Skip to content

Commit

Permalink
Add Makefile projects for installers and creating debug and release z…
Browse files Browse the repository at this point in the history
…ip files
  • Loading branch information
DanTheMan827 committed Sep 16, 2018
1 parent 175a567 commit 17f3b83
Show file tree
Hide file tree
Showing 23 changed files with 766 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ driver/usb_driver/
obj/
.vs/
*.csproj.user
*.vcxproj.user
*.pfx
commit.txt
basehmods.tar
Expand All @@ -12,3 +13,5 @@ mods/hmods/hakchi.hmod
tools/arm/detached-fallback
Web Installer/*.exe
driver/classic_driver.exe
Makefile Projects/Release/
Makefile Projects/Debug/
116 changes: 116 additions & 0 deletions Makefile Projects/Installer.vcxproj
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{15F9D451-9DAF-4904-B2EC-6B485FCA86FD}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<NMakeBuildCommandLine>msbuild.exe "$(SolutionDir)NSI\nsi-helper\nsi-helper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)bin\Debug"
del /S /Q "$(SolutionDir)bin\Release"

rmdir /S /Q "$(SolutionDir)bin\Debug"
rmdir /S /Q "$(SolutionDir)bin\Release"

msbuild.exe "$(SolutionPath)" /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /p:Configuration=Debug

"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)bin\Release" "$(SolutionDir)NSI\release-uninstall.nsh"
"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)bin\Debug" "$(SolutionDir)NSI\debug-uninstall.nsh"

makensis.exe "$(SolutionDir)NSI\Installer.nsi"

del "$(SolutionDir)NSI\release-uninstall.nsh"
del "$(SolutionDir)NSI\debug-uninstall.nsh"</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>msbuild.exe "$(SolutionDir)NSI\nsi-helper\nsi-helper.csproj" /p:Configuration=Release

del /S /Q "$(SolutionDir)bin\Debug"
del /S /Q "$(SolutionDir)bin\Release"

rmdir /S /Q "$(SolutionDir)bin\Debug"
rmdir /S /Q "$(SolutionDir)bin\Release"

msbuild.exe "$(SolutionPath)" /t:Clean /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /t:Clean /p:Configuration=Debug

msbuild.exe "$(SolutionPath)" /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /p:Configuration=Debug

"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)bin\Release" "$(SolutionDir)NSI\release-uninstall.nsh"
"$(SolutionDir)NSI\nsi-helper\bin\Release\nsi-helper.exe" "$(SolutionDir)bin\Debug" "$(SolutionDir)NSI\debug-uninstall.nsh"

makensis.exe "$(SolutionDir)NSI\Installer.nsi"

del "$(SolutionDir)NSI\release-uninstall.nsh"
del "$(SolutionDir)NSI\debug-uninstall.nsh"</NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeCleanCommandLine>del "$(SolutionDir)bin\hakchi2-ce-*-installer.exe"</NMakeCleanCommandLine>
<ExecutablePath>$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);C:\Program Files\NSIS;C:\Program Files (x86)\NSIS;</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
81 changes: 81 additions & 0 deletions Makefile Projects/Web Installer.vcxproj
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{1994C582-5BCD-45B1-A825-93123C16E33D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectName>Installer (Web)</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<NMakeBuildCommandLine>makensis.exe "$(SolutionDir)NSI\Web Installer.nsi"</NMakeBuildCommandLine>
<NMakeOutput>Web Installer.exe</NMakeOutput>
<NMakeCleanCommandLine>del "$(SolutionDir)bin\hakchi2-ce-webinstaller.exe"</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>makensis.exe "$(SolutionDir)NSI\Web Installer.nsi"</NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<ExecutablePath>$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);C:\Program Files\NSIS;C:\Program Files (x86)\NSIS;</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
100 changes: 100 additions & 0 deletions Makefile Projects/ZIP Files.vcxproj
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{2A876B34-06C7-4CD4-AF78-6783AC37DBAC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<NMakeCleanCommandLine>del "$(SolutionDir)bin\hakchi2-ce-*.zip"</NMakeCleanCommandLine>
<NMakeBuildCommandLine>del /S /Q "$(SolutionDir)bin\Debug"
del /S /Q "$(SolutionDir)bin\Release"

rmdir /S /Q "$(SolutionDir)bin\Debug"
rmdir /S /Q "$(SolutionDir)bin\Release"

msbuild.exe "$(SolutionPath)" /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /p:Configuration=Debug

"$(SolutionDir)Zipper\bin\$(Configuration)\Zipper.exe" "$(SolutionDir)bin\Release" "$(SolutionDir)bin\hakchi2-ce-release.zip"
"$(SolutionDir)Zipper\bin\$(Configuration)\Zipper.exe" "$(SolutionDir)bin\Debug" "$(SolutionDir)bin\hakchi2-ce-debug.zip"</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>del /S /Q "$(SolutionDir)bin\Debug"
del /S /Q "$(SolutionDir)bin\Release"

rmdir /S /Q "$(SolutionDir)bin\Debug"
rmdir /S /Q "$(SolutionDir)bin\Release"

msbuild.exe "$(SolutionPath)" /t:Clean /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /t:Clean /p:Configuration=Debug

msbuild.exe "$(SolutionPath)" /p:Configuration=Release
msbuild.exe "$(SolutionPath)" /p:Configuration=Debug

"$(SolutionDir)Zipper\bin\$(Configuration)\Zipper.exe" "$(SolutionDir)bin\Release" "$(SolutionDir)bin\hakchi2-ce-release.zip"
"$(SolutionDir)Zipper\bin\$(Configuration)\Zipper.exe" "$(SolutionDir)bin\Debug" "$(SolutionDir)bin\hakchi2-ce-debug.zip"</NMakeReBuildCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
7 changes: 5 additions & 2 deletions Web Installer/Installer.nsi → NSI/Installer.nsi
Expand Up @@ -9,7 +9,7 @@ Name "Hakchi2 CE ${cever_1}.${cever_2}.${cever_3}"
Icon "..\icon_app.ico"

; The file to write
OutFile "hakchi2-ce-${cever_1}.${cever_2}.${cever_3}.exe"
OutFile "..\bin\hakchi2-ce-${cever_1}.${cever_2}.${cever_3}-installer.exe"

; The default installation directory
Var defaultInstDir
Expand Down Expand Up @@ -107,7 +107,10 @@ Section "Uninstall"
Delete "$DESKTOP\Hakchi2 CE.lnk"
RMDir /r "$SMPROGRAMS\Team Shinkansen\Hakchi2 CE"
RMDir "$SMPROGRAMS\Team Shinkansen"
RMDir /r "$INSTDIR"
!include "debug-uninstall.nsh"
Delete "$INSTDIR\nonportable.flag"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
;--------------------------------

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Web Installer/Web Installer.nsi → NSI/Web Installer.nsi
Expand Up @@ -8,7 +8,7 @@ Name "Hakchi2 CE"
Icon "..\icon_app.ico"

; The file to write
OutFile "Hakchi2 CE Web Installer.exe"
OutFile "..\bin\hakchi2-ce-webinstaller.exe"

; The default installation directory
InstallDir "$PROGRAMFILES\Team Shinkansen\Hakchi2 CE"
Expand Down
6 changes: 6 additions & 0 deletions NSI/nsi-helper/App.config
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
27 changes: 27 additions & 0 deletions NSI/nsi-helper/Program.cs
@@ -0,0 +1,27 @@
using System;
using System.IO;
using System.Linq;

namespace nsi_helper
{
class Program
{
static void Main(string[] args)
{
using (var sr = new StreamWriter(args.Length > 1 ? File.Create(args[1]) : Console.OpenStandardOutput()))
{
var files = Directory.EnumerateFiles(args[0], "*", SearchOption.AllDirectories);
var directories = Directory.EnumerateDirectories(args[0], "*", SearchOption.AllDirectories).Reverse();

foreach (var file in files)
{
sr.WriteLine($"Delete \"$INSTDIR\\{file.Substring(args[0].Length).TrimStart("\\"[0])}\"");
}
foreach (var directory in directories)
{
sr.WriteLine($"RMDir \"$INSTDIR\\{directory.Substring(args[0].Length).TrimStart("\\"[0])}\"");
}
}
}
}
}

0 comments on commit 17f3b83

Please sign in to comment.