Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Revan654 committed Feb 18, 2019
1 parent 570efd0 commit 3474015
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions General/GlobalClass.vb
Original file line number Diff line number Diff line change
Expand Up @@ -579,31 +579,24 @@ Public Class GlobalClass

Sub SetTempDir()

Dim OSName = Registry.LocalMachine.GetString("SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")
If p.SourceFile <> "" Then
p.TempDir = Macro.Expand(p.TempDir)
If p.TempDir = "" and OSName.Contains("Windows 10") Then
If p.TempDir = "" Then
Try
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
Else
Dim base = p.SourceFile.Base
p.TempDir = p.SourceFile.Dir + base + "_temp\"
End If
Catch ex As Exception
MsgInfo(ex.Message)
End Try
Else ''Will Only Trigger For Older OS's.
Try
Catch ex As PathTooLongException
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
Else
Dim base = p.SourceFile.Base
If base.Length > 30 Then base = base.Shorten(15) + "..."
p.TempDir = p.SourceFile.Dir + base + "_temp\"
End If
Catch ex As Exception
MsgInfo(ex.Message)
End Try
End If

Expand Down Expand Up @@ -1160,4 +1153,4 @@ Public Class GlobalClass
Dim ts = TimeSpan.FromSeconds(sec)
Return CInt(Math.Floor(ts.TotalMinutes)).ToString("00") + ":" + CInt(Math.Floor(ts.Seconds)).ToString("00")
End Function
End Class
End Class

0 comments on commit 3474015

Please sign in to comment.