Skip to content

Commit a59a49c

Browse files
creates grapple folder during installation
removes resources from grapple (not needed)
1 parent 831c360 commit a59a49c

6 files changed

Lines changed: 27 additions & 224 deletions

File tree

Src/BridgeVs.Locations/CommonFolderPaths.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public static class CommonFolderPaths
5050
public static readonly string VisualStudio2013Path = Path.Combine(ProgramFilesFolderPath, @"Microsoft Visual Studio 12.0");
5151
public static readonly string VisualStudio2012Path = Path.Combine(ProgramFilesFolderPath, @"Microsoft Visual Studio 11.0");
5252

53+
public static readonly string GrappleFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Grapple");
54+
5355
public static string InstallFolder => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
5456

5557
public static readonly string Documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

Src/Grapple/BridgeVs.Grapple.csproj

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,19 @@
6262
<Compile Include="Extensions\DictionaryExtensions.cs" />
6363
<Compile Include="Properties\AssemblyInfo.cs" />
6464
<Compile Include="Grapple\BinaryGrapple.cs" />
65-
<Compile Include="Resource.Designer.cs">
66-
<AutoGen>True</AutoGen>
67-
<DesignTime>True</DesignTime>
68-
<DependentUpon>Resource.resx</DependentUpon>
69-
</Compile>
7065
<Compile Include="Serialization\SerializationHandler.cs" />
7166
<Compile Include="Truck.cs" />
7267
</ItemGroup>
7368
<ItemGroup>
69+
<ProjectReference Include="..\BridgeVs.Locations\BridgeVs.Locations.csproj">
70+
<Project>{BC10F93A-5DA2-44F8-AE5E-5603CB46B548}</Project>
71+
<Name>BridgeVs.Locations</Name>
72+
</ProjectReference>
7473
<ProjectReference Include="..\Logging\BridgeVs.Logging.csproj">
7574
<Project>{0b546762-c8c0-45c6-bc42-c5d91d510351}</Project>
7675
<Name>BridgeVs.Logging</Name>
7776
</ProjectReference>
7877
</ItemGroup>
79-
<ItemGroup>
80-
<EmbeddedResource Include="Resource.resx">
81-
<Generator>ResXFileCodeGenerator</Generator>
82-
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
83-
<SubType>Designer</SubType>
84-
</EmbeddedResource>
85-
</ItemGroup>
8678
<ItemGroup>
8779
<None Include="packages.config" />
8880
</ItemGroup>

Src/Grapple/Resource.Designer.cs

Lines changed: 0 additions & 72 deletions
This file was deleted.

Src/Grapple/Resource.resx

Lines changed: 0 additions & 123 deletions
This file was deleted.

Src/Grapple/Truck.cs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
using BridgeVs.Grapple.Contracts;
3636
using BridgeVs.Grapple.Extensions;
3737
using BridgeVs.Grapple.Grapple;
38+
using BridgeVs.Locations;
3839
using BridgeVs.Logging;
3940

4041
namespace BridgeVs.Grapple
@@ -48,11 +49,7 @@ public class Truck : ITruck
4849
private readonly IGrapple _grapple;
4950
private Dictionary<Type, List<byte[]>> _container = new Dictionary<Type, List<byte[]>>();
5051

51-
private static readonly string DefaultBaseFolder =
52-
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
53-
Resource.ProductName);
54-
55-
private string TruckPosition => Path.Combine(DefaultBaseFolder, _truckName);
52+
private string TruckPosition => Path.Combine(CommonFolderPaths.GrappleFolder, _truckName);
5653

5754
/// <summary>
5855
///
@@ -69,7 +66,11 @@ internal Truck(string truckName, IGrapple grapple)
6966

7067
_truckName = truckName;
7168
_grapple = grapple;
72-
CreateDeliveryFolder(TruckPosition);
69+
70+
if (Directory.Exists(TruckPosition)) return;
71+
72+
//no need for security access
73+
Directory.CreateDirectory(TruckPosition);
7374
}
7475

7576
/// <summary>
@@ -237,16 +238,5 @@ private byte[] InternalCollect(string address)
237238
}
238239
}
239240
}
240-
241-
private static void CreateDeliveryFolder(string address)
242-
{
243-
Log.Write("Creating folder for Delivery {0}", Path.GetFullPath(address));
244-
245-
if (Directory.Exists(address)) return;
246-
247-
Directory.CreateDirectory(address);
248-
249-
Log.Write("Folder Successfully Created");
250-
}
251241
}
252242
}

Src/VsExtension.Helper/Configuration/PackageConfigurator.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ public static bool Install(string vsVersion, string vsEdition)
251251

252252
CreateVisualizerFolder(vsVersion);
253253

254+
CreateGrappleFolder();
255+
254256
//Always check if installation folder has changed
255257
SetInstallationFolder(vsVersion);
256258

@@ -372,6 +374,18 @@ private static void CreateVisualizerFolder(string vsVersion)
372374
Log.Write($"Directory Created: {debuggerVisualizerTargetFolder}");
373375

374376
}
377+
378+
private static void CreateGrappleFolder()
379+
{
380+
Log.Write("Creating folder for Delivery {0}", Path.GetFullPath(CommonFolderPaths.GrappleFolder));
381+
382+
if (Directory.Exists(CommonFolderPaths.GrappleFolder)) return;
383+
384+
//no need for security access
385+
Directory.CreateDirectory(CommonFolderPaths.GrappleFolder);
386+
387+
Log.Write("Folder Successfully Created");
388+
}
375389

376390
#endregion
377391
}

0 commit comments

Comments
 (0)