Fix issue with getting paths

This commit is contained in:
Zack Rauen 2019-12-11 00:58:17 -05:00
parent 6eac7aae77
commit bcd4c38f68
3 changed files with 6 additions and 5 deletions

View File

@ -114,7 +114,7 @@ namespace BandagedBD.Properties {
}
/// <summary>
/// Looks up a localized string similar to 1.0.2.
/// Looks up a localized string similar to 1.0.3.
/// </summary>
internal static string Version {
get {

View File

@ -204,7 +204,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</value>
</data>
<data name="Version" xml:space="preserve">
<value>1.0.2</value>
<value>1.0.3</value>
</data>
<data name="BBDVS" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -15,18 +15,19 @@ namespace BandagedBD {
public static readonly Regex _matcher = new Regex(@"[0-9]+\.[0-9]+\.[0-9]+");
public static string LADPath(string append) => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\{append}";
public static string PDPath(string append) => $"{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}\\{Environment.UserName}\\{append}";
public static string EXEPath(string exe) => exe == string.Empty ? exe : Path.GetFullPath(Path.Combine(exe, "..\\.."));
public static string StablePath => LADPath("Discord");
public static string StablePathPD => PDPath("Discord");
public static string StablePathEXE => GetProcess("Discord");
public static string StablePathEXE => EXEPath(GetProcess("Discord"));
public static string CanaryPath => LADPath("DiscordCanary");
public static string CanaryPathPD => PDPath("DiscordCanary");
public static string CanaryPathEXE => GetProcess("DiscordCanary");
public static string CanaryPathEXE => EXEPath(GetProcess("DiscordCanary"));
public static string PtbPath => LADPath("DiscordPTB");
public static string PtbPathPD => PDPath("DiscordPTB");
public static string PtbPathEXE => GetProcess("DiscordPTB");
public static string PtbPathEXE => EXEPath(GetProcess("DiscordPTB"));
public static string CurrentStablePath = Directory.Exists(StablePathEXE) ? StablePathEXE : Directory.Exists(StablePathPD) ? StablePathPD : Directory.Exists(StablePath) ? StablePath : null;
public static string CurrentCanaryPath = Directory.Exists(CanaryPathEXE) ? CanaryPathEXE : Directory.Exists(CanaryPathPD) ? CanaryPathPD : Directory.Exists(CanaryPath) ? CanaryPath : null;