Skip to content

Commit

Permalink
Fix for new Fiddler install location
Browse files Browse the repository at this point in the history
- Also fix issue with directory being removed after a profile was
created
- Fixes #7
  • Loading branch information
gotdibbs committed Aug 30, 2017
1 parent 298ccc8 commit f908a00
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Imposter.Fiddler.Installer/Imposter.Fiddler.Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
<AssemblyOriginatorKeyFile>Imposter.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net40\MahApps.Metro.dll</HintPath>
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net40\MahApps.Metro.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net40\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml" />
Expand Down Expand Up @@ -114,8 +114,8 @@
<SubType>Designer</SubType>
</None>
<None Include="Imposter.snk" />
<None Include="packages.config" />
<AppDesigner Include="Properties\" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="Imposter.ico" />
Expand Down
4 changes: 2 additions & 2 deletions Imposter.Fiddler.Installer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ private string GetFiddlerLocation()
{
try
{
using (var key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Fiddler2"))
using (var key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Fiddler2\\InstallerSettings"))
{
if (key != null)
{
Object o = key.GetValue("LMScriptPath");
Object o = key.GetValue("ScriptPath");
if (o != null)
{
var path = o as string;
Expand Down
4 changes: 1 addition & 3 deletions Imposter.Fiddler.Installer/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net40" />
</packages>
<packages />
5 changes: 2 additions & 3 deletions Imposter.Fiddler/Imposter.Fiddler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Fiddler">
<HintPath>C:\Program Files (x86)\Fiddler2\Fiddler.exe</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\AppData\Local\Programs\Fiddler\Fiddler.exe</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net40\MahApps.Metro.dll</HintPath>
Expand Down Expand Up @@ -117,7 +116,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetDir)" "%25programfiles(x86)%25\Fiddler2\Scripts\"</PostBuildEvent>
<PostBuildEvent>copy "$(TargetDir)" "%25localappdata%25\Programs\Fiddler\Scripts\"</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
6 changes: 6 additions & 0 deletions Imposter.Fiddler/Models/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public override string ToString()

public void Start(bool enableAutoReload)
{
if (!Directory.Exists(LocalDirectory))
{
MessageBox.Show($"Profile '{this.Name}' has an invalid directory selected. Please correct this issue.");
return;
}

IsRunning = true;

_watcher = new FileWatcher(LocalDirectory, enableAutoReload);
Expand Down

0 comments on commit f908a00

Please sign in to comment.