-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging installer changes required for autoupdate to function #1
Changes from 12 commits
09199fc
f854334
a2716f1
9995169
16ae66c
2241c1a
47b00e9
39e24ab
98859d0
c885d5d
b50bfb4
9d44487
de725a8
3174b12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ xcodebuild/* | |
*.vcxproj | ||
*.vcxproj.filters | ||
*.vcxproj.user | ||
*.sln | ||
|
||
*.pbxuser | ||
*.perspective | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,16 @@ | |
<key>type</key> | ||
<string>file</string> | ||
</dict> | ||
<dict> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gavankar can you verify this layouting change and see if it's correct. The DMG GUI layout is getting messed up on my machine when I simply mount it. The container bounds seem to be off. @ayushrathi15 can you confirm this issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This layout change was added after this bug was found, to fix this bug |
||
<key>identifier</key> | ||
<string>LayoutItem.3E1B7344-C175-4BE0-87DB-880A4A30E80F</string> | ||
<key>name</key> | ||
<string>.update.sh</string> | ||
<key>position</key> | ||
<string>{228, 424}</string> | ||
<key>type</key> | ||
<string>file</string> | ||
</dict> | ||
<dict> | ||
<key>identifier</key> | ||
<string>LayoutItem.0679B008-641D-4857-A4B8-156BF67D8320</string> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gavankar In case we are unable to read the values from registry, I am seeing that we're defaulting to 0. Has this workflow been confirmed with upper management. Because the default values in case of a fresh launch I think is 1. @ayushrathi15 can you confirm this as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mbhavi Adding Brackets to the system path is an optional feature in the installer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gavankar , I think my comment was misunderstood. What i meant was, if we are unable to read the registry, irrespective of whatever value it contains, what are we doing with the registry entries? Do we default them back to 0, or do we don't do anything? If we don't touch the registry entries, does the installer at the time of update, pick up the already existing entries, so that the user selected options are kept intact for the new version as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mbhavi, in this piece of code we are not directly reading entries from the registry. We are asking the msi installer for a copy of the entries that it has loaded as part of its execution, this is very unlikely to fail. |
||
session.Log("Not Updating Path"); | ||
} | ||
|
||
session.Log("End BracketsConfigurator"); | ||
return ActionResult.Success; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{CECF9330-C626-4D7F-87DA-5387E97881B2}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>BracketsConfigurator</RootNamespace> | ||
<AssemblyName>BracketsConfigurator</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Microsoft.Deployment.WindowsInstaller"> | ||
<Private>True</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="BracketsConfigurator.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Content Include="CustomAction.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(WixCATargetsPath)" Condition=" '$(WixCATargetsPath)' != '' " /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets" Condition=" '$(WixCATargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets') " /> | ||
<Target Name="EnsureWixToolsetInstalled"> | ||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
|
||
<!-- | ||
Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that | ||
the custom action should run on. If no versions are specified, the chosen version of the runtime | ||
will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against. | ||
|
||
WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility | ||
problems with future versions of the .NET Framework runtime. It is highly recommended that you specify | ||
only the version(s) of the .NET Framework runtime that you have tested against. | ||
|
||
Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0. | ||
|
||
In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies | ||
by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true". | ||
|
||
For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx | ||
--> | ||
|
||
<supportedRuntime version="v4.0" /> | ||
<!-- <supportedRuntime version="v2.0.50727"/> --> | ||
|
||
</startup> | ||
|
||
<!-- | ||
Add additional configuration settings here. For more information on application config files, | ||
see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx | ||
--> | ||
|
||
</configuration> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gavankar, it would be safer to give the file "executable" permissions(chmod) programmatically before copying. Since we would simply be invoking the script later on, we don't want to end up in a situation where the script is present but is not executable due to any number of reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit de725a8