diff --git a/.gitignore b/.gitignore index c7580fb76..d2cf15e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ xcodebuild/* *.vcxproj *.vcxproj.filters *.vcxproj.user -*.sln *.pbxuser *.perspective diff --git a/Gruntfile.js b/Gruntfile.js index 3335e0664..2603d6977 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -192,6 +192,19 @@ module.exports = function (grunt) { } ] }, + "winInstallerDLLs": { + "files": [ + { + "flatten" : true, + "expand" : true, + "src" : [ + "installer/win/LaunchBrackets/LaunchBrackets/bin/Release/LaunchBrackets.CA.dll", + "installer/win/BracketsConfigurator/BracketsConfigurator/bin/Release/BracketsConfigurator.CA.dll" + ], + "dest" : "installer/win/" + } + ] + }, "mac": { "files": [ { diff --git a/installer/mac/buildInstaller.sh b/installer/mac/buildInstaller.sh index 54ac0d373..7cfb4c72b 100755 --- a/installer/mac/buildInstaller.sh +++ b/installer/mac/buildInstaller.sh @@ -15,6 +15,13 @@ rm -rf $tempDir mkdir $tempDir cp -r "./staging/${BRACKETS_APP_NAME}.app/" "$tempDir/$appName" +# copy update.sh to hidden location in the dmg +if [ -f ./update.sh ]; then + echo "Adding update.sh" + chmod +x ./update.sh + cp ./update.sh "$tempDir/.update.sh" +fi + # create symlink to Applications folder in staging area # with a single space as the name so it doesn't show an unlocalized name ln -s /Applications "$tempDir/ " diff --git a/installer/mac/dropDmgConfig/layouts/bracketsLayout/Info.plist b/installer/mac/dropDmgConfig/layouts/bracketsLayout/Info.plist index a31d731a1..49d108063 100644 --- a/installer/mac/dropDmgConfig/layouts/bracketsLayout/Info.plist +++ b/installer/mac/dropDmgConfig/layouts/bracketsLayout/Info.plist @@ -46,6 +46,16 @@ type file + + identifier + LayoutItem.3E1B7344-C175-4BE0-87DB-880A4A30E80F + name + .update.sh + position + {228, 424} + type + file + identifier LayoutItem.0679B008-641D-4857-A4B8-156BF67D8320 diff --git a/installer/mac/update.sh b/installer/mac/update.sh old mode 100644 new mode 100755 diff --git a/installer/win/Brackets.wxs b/installer/win/Brackets.wxs index baf637419..d7558bfbf 100644 --- a/installer/win/Brackets.wxs +++ b/installer/win/Brackets.wxs @@ -77,7 +77,7 @@ - + ADDCONTEXTMENU="1" OR CONTEXTMENUREGISTRY @@ -114,18 +114,70 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + 1 - + --> @@ -137,6 +189,7 @@ + UPDATEPATH="1" - + + LAUNCH_APPLICATION_SILENT = 1 + LAUNCH_APPLICATION_SILENT = 1 + LAUNCH_APPLICATION_SILENT = 1 + LAUNCH_APPLICATION_SILENT = 1 + LAUNCH_APPLICATION_SILENT = 1 + diff --git a/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.cs b/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.cs new file mode 100644 index 000000000..9f0324dd0 --- /dev/null +++ b/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using Microsoft.Deployment.WindowsInstaller; + +namespace BracketsConfigurator +{ + public class BracketsConfiguratorClass + { + [CustomAction] + public static ActionResult BracketsConfigurator(Session session) + { + session.Log("Begin BracketsConfigurator"); + + //Set Install Directory if available + string installRegistry = session["INSTALLDIRREGISTRY"]; + string installDirValue = ""; + if (!string.IsNullOrEmpty(installRegistry)) + { + session.Log("Install Registry Value: " + installRegistry); + string[] path = installRegistry.Split('\\'); + //Remove executable name + path = path.Take(path.Count() - 1).ToArray(); + //Get path without executable + installDirValue = string.Join("\\", path) + "\\"; + session["INSTALLDIR"] = installDirValue; + session.Log("Updating Install Dir To: " + installDirValue); + } + else + { + session.Log("No Registry Value for installation directory"); + } + + //Set AddContextMenu if required + string contextMenuRegistry = session["CONTEXTMENUREGISTRY"]; + if (!string.IsNullOrEmpty(contextMenuRegistry)) + { + session.Log("Context Menu Registry Value: " + contextMenuRegistry); + session["ADDCONTEXTMENU"] = "1"; + session.Log("Setting Context Menu Option"); + } + else + { + session["ADDCONTEXTMENU"] = "0"; + session.Log("Not Adding to Context Menu"); + } + + //Set UpdatePath if required + string currentPathValue = session["CURRENTPATH"]; + session.Log("Current Path Value: " + currentPathValue); + if (!string.IsNullOrEmpty(currentPathValue) && currentPathValue.Contains(installDirValue)) + { + session["UPDATEPATH"] = "1"; + session.Log("Updating Path for Brackets"); + } + else + { + session["UPDATEPATH"] = "0"; + session.Log("Not Updating Path"); + } + + session.Log("End BracketsConfigurator"); + return ActionResult.Success; + } + } +} diff --git a/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.csproj b/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.csproj new file mode 100644 index 000000000..73f272e53 --- /dev/null +++ b/installer/win/BracketsConfigurator/BracketsConfigurator/BracketsConfigurator.csproj @@ -0,0 +1,53 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {CECF9330-C626-4D7F-87DA-5387E97881B2} + Library + Properties + BracketsConfigurator + BracketsConfigurator + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + True + + + + + + + + + + + + + \ No newline at end of file diff --git a/installer/win/BracketsConfigurator/BracketsConfigurator/CustomAction.config b/installer/win/BracketsConfigurator/BracketsConfigurator/CustomAction.config new file mode 100644 index 000000000..472d2dda5 --- /dev/null +++ b/installer/win/BracketsConfigurator/BracketsConfigurator/CustomAction.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/installer/win/BracketsConfigurator/BracketsConfigurator/Properties/AssemblyInfo.cs b/installer/win/BracketsConfigurator/BracketsConfigurator/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5e1a3e721 --- /dev/null +++ b/installer/win/BracketsConfigurator/BracketsConfigurator/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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("BracketsConfigurator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("BracketsConfigurator")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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("cecf9330-c626-4d7f-87da-5387e97881b2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/installer/win/BracketsConfigurator/BracketsConfiguratorSolution.sln b/installer/win/BracketsConfigurator/BracketsConfiguratorSolution.sln new file mode 100644 index 000000000..40dfec9ef --- /dev/null +++ b/installer/win/BracketsConfigurator/BracketsConfiguratorSolution.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BracketsConfigurator", "BracketsConfigurator\BracketsConfigurator.csproj", "{CECF9330-C626-4D7F-87DA-5387E97881B2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CECF9330-C626-4D7F-87DA-5387E97881B2}.Debug|x86.ActiveCfg = Debug|x86 + {CECF9330-C626-4D7F-87DA-5387E97881B2}.Debug|x86.Build.0 = Debug|x86 + {CECF9330-C626-4D7F-87DA-5387E97881B2}.Release|x86.ActiveCfg = Release|x86 + {CECF9330-C626-4D7F-87DA-5387E97881B2}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/installer/win/LaunchBrackets/LaunchBrackets/CustomAction.config b/installer/win/LaunchBrackets/LaunchBrackets/CustomAction.config new file mode 100644 index 000000000..472d2dda5 --- /dev/null +++ b/installer/win/LaunchBrackets/LaunchBrackets/CustomAction.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.cs b/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.cs new file mode 100644 index 000000000..0badc5ade --- /dev/null +++ b/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Deployment.WindowsInstaller; +using System.IO; + +namespace LaunchBrackets +{ + public class LaunchBracketsClass + { + [CustomAction] + public static ActionResult LaunchBrackets(Session session) + { + session.Log("Begin LaunchBrackets"); + string bracketsInstallLocation = session["INSTALLDIRREGISTRY"]; + if (!string.IsNullOrEmpty(bracketsInstallLocation)) + { + session.Log("Received Brackets Install Location: " + bracketsInstallLocation); + if (File.Exists(bracketsInstallLocation)) + { + session.Log("Running brackets"); + System.Diagnostics.Process.Start(bracketsInstallLocation); + } + } + session.Log("Begin LaunchBrackets"); + + return ActionResult.Success; + } + } +} diff --git a/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.csproj b/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.csproj new file mode 100644 index 000000000..d764396b5 --- /dev/null +++ b/installer/win/LaunchBrackets/LaunchBrackets/LaunchBrackets.csproj @@ -0,0 +1,53 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {4922460C-3623-4C0D-900B-3E69E8F1EE98} + Library + Properties + LaunchBrackets + LaunchBrackets + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + True + + + + + + + + + + + + + \ No newline at end of file diff --git a/installer/win/LaunchBrackets/LaunchBrackets/Properties/AssemblyInfo.cs b/installer/win/LaunchBrackets/LaunchBrackets/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..effac1ce9 --- /dev/null +++ b/installer/win/LaunchBrackets/LaunchBrackets/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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("LaunchBrackets")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LaunchBrackets")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[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("4922460c-3623-4c0d-900b-3e69e8f1ee98")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/installer/win/LaunchBrackets/LaunchBracketsSolution.sln b/installer/win/LaunchBrackets/LaunchBracketsSolution.sln new file mode 100644 index 000000000..f791b7e65 --- /dev/null +++ b/installer/win/LaunchBrackets/LaunchBracketsSolution.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchBrackets", "LaunchBrackets\LaunchBrackets.csproj", "{4922460C-3623-4C0D-900B-3E69E8F1EE98}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4922460C-3623-4C0D-900B-3E69E8F1EE98}.Debug|x86.ActiveCfg = Debug|x86 + {4922460C-3623-4C0D-900B-3E69E8F1EE98}.Debug|x86.Build.0 = Debug|x86 + {4922460C-3623-4C0D-900B-3E69E8F1EE98}.Release|x86.ActiveCfg = Release|x86 + {4922460C-3623-4C0D-900B-3E69E8F1EE98}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/scripts/brackets_installer_projects.bat b/scripts/brackets_installer_projects.bat new file mode 100644 index 000000000..9f3c77634 --- /dev/null +++ b/scripts/brackets_installer_projects.bat @@ -0,0 +1,39 @@ +:: Batch file that creates the custom DLLs required to build the windows installers +:: This file should *not* be called directly. It is called by the build.sh script. +@ECHO OFF + +IF DEFINED VS140COMNTOOLS GOTO VS2015 +IF DEFINED VS120COMNTOOLS GOTO VS2013 +IF DEFINED VS110COMNTOOLS GOTO VS2012 +IF DEFINED VS100COMNTOOLS GOTO VS2010 + +:VSNotInstalled +ECHO Visual Studio 2010, 2012, 2013 or 2015 must be installed. +GOTO Error + +:VS2015 +call "%VS140COMNTOOLS%/vsvars32.bat" +GOTO Build + +:VS2013 +call "%VS120COMNTOOLS%/vsvars32.bat" +GOTO Build + +:VS2012 +call "%VS110COMNTOOLS%/vsvars32.bat" +GOTO Build + +:VS2010 +call "%VS100COMNTOOLS%/vsvars32.bat" +GOTO Build + +:Build +msbuild.exe installer\win\LaunchBrackets\LaunchBracketsSolution.sln /nr:false /t:Clean /p:Platform=x86 /p:Configuration=Release +msbuild.exe installer\win\LaunchBrackets\LaunchBracketsSolution.sln /nr:false /t:Build /p:Platform=x86 /p:Configuration=Release + +msbuild.exe installer\win\BracketsConfigurator\BracketsConfiguratorSolution.sln /nr:false /t:Clean /p:Platform=x86 /p:Configuration=Release +msbuild.exe installer\win\BracketsConfigurator\BracketsConfiguratorSolution.sln /nr:false /t:Build /p:Platform=x86 /p:Configuration=Release +exit /b %ERRORLEVEL% + +:Error +exit /b 1 diff --git a/tasks/build.js b/tasks/build.js index d1ca204c4..bf5b05e35 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -85,7 +85,7 @@ module.exports = function (grunt) { grunt.registerTask("build-win", "Build windows shell", function () { var done = this.async(); - spawn("cmd.exe /c scripts\\build_projects.bat").then(function () { + spawn(["cmd.exe /c scripts\\build_projects.bat", "cmd.exe /c scripts\\brackets_installer_projects.bat"]).then(function () { done(); }, function (err) { grunt.log.error(err); @@ -154,6 +154,7 @@ module.exports = function (grunt) { // task: stage-win grunt.registerTask("stage-win", "Stage win executable files", function () { // stage platform-specific binaries, then package www files + grunt.task.run("copy:winInstallerDLLs"); grunt.task.run("copy:win"); });