Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

Commit abfc8d5

Browse files
committed
SAI2 local paths fix
1 parent fcac32e commit abfc8d5

3 files changed

Lines changed: 27 additions & 10 deletions

File tree

SAI-Autosaver/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.3.6")]
37-
[assembly: AssemblyFileVersion("1.3.6")]
36+
[assembly: AssemblyVersion("1.3.7")]
37+
[assembly: AssemblyFileVersion("1.3.7")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

SAI-Autosaver/Utilities.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,31 @@ public static string GetProjectAbsolutePath()
3434
if (path.Contains('/'))
3535
{
3636
var pathSplit = path.Split('/').Select(x => x.Trim()).ToArray();
37-
var principalSearcher = new PrincipalSearcher(new UserPrincipal(new PrincipalContext(ContextType.Machine)));
3837

39-
foreach (var principal in principalSearcher.FindAll())
38+
if (pathSplit.Length == 2 && pathSplit[0].ToLower() == "desktop")
4039
{
41-
if (pathSplit[0] == principal.DisplayName || pathSplit[0] == principal.Name)
40+
path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), pathSplit[1]);
41+
}
42+
else
43+
{
44+
var principalSearcher = new PrincipalSearcher(new UserPrincipal(new PrincipalContext(ContextType.Machine)));
45+
var found = false;
46+
47+
foreach (var principal in principalSearcher.FindAll())
48+
{
49+
if (pathSplit[0] == principal.DisplayName || pathSplit[0] == principal.Name)
50+
{
51+
var userProfile = Path.Combine(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)).ToString(), principal.Name);
52+
path = Path.Combine(new string[] { userProfile }.Concat(pathSplit.Skip(1)).ToArray());
53+
54+
found = true;
55+
break;
56+
}
57+
}
58+
59+
if (!found)
4260
{
43-
var userProfile = Path.Combine(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)).ToString(), principal.Name);
44-
path = Path.Combine(new string[] { userProfile }.Concat(pathSplit.Skip(1)).ToArray());
61+
path = Path.Combine(new string[] { Environment.GetFolderPath(Environment.SpecialFolder.Desktop) }.Concat(pathSplit).ToArray());
4562
}
4663
}
4764
}

Setup/Setup.vdproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,15 @@
380380
{
381381
"Name" = "8:Microsoft Visual Studio"
382382
"ProductName" = "8:SAI Autosaver"
383-
"ProductCode" = "8:{B317BED4-B8FD-4638-9516-7F02A69E9C99}"
384-
"PackageCode" = "8:{6743CC95-0312-4937-AF68-31B8F9C02791}"
383+
"ProductCode" = "8:{189B6663-5EE8-464A-9F59-A65C541DA379}"
384+
"PackageCode" = "8:{FE077F34-1563-45A0-88C2-6848415B8898}"
385385
"UpgradeCode" = "8:{92B56287-C711-4BD0-90AD-48904A3FD4E1}"
386386
"AspNetVersion" = "8:2.0.50727.0"
387387
"RestartWWWService" = "11:FALSE"
388388
"RemovePreviousVersions" = "11:FALSE"
389389
"DetectNewerInstalledVersion" = "11:TRUE"
390390
"InstallAllUsers" = "11:TRUE"
391-
"ProductVersion" = "8:1.3.6"
391+
"ProductVersion" = "8:1.3.7"
392392
"Manufacturer" = "8:SAI Autosaver"
393393
"ARPHELPTELEPHONE" = "8:"
394394
"ARPHELPLINK" = "8:https://vk.com/rukifox"

0 commit comments

Comments
 (0)