Skip to content

Commit

Permalink
📝 new locations, file/folder functions, bugfix, design
Browse files Browse the repository at this point in the history
  • Loading branch information
berkaygediz committed Jun 20, 2024
1 parent a5b0207 commit b0a14b3
Show file tree
Hide file tree
Showing 12 changed files with 674 additions and 454 deletions.
3 changes: 3 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<setting name="DarkMode" serializeAs="String">
<value>False</value>
</setting>
<setting name="SysLogErrorRep" serializeAs="String">
<value>False</value>
</setting>
</PASPAS.Properties.Settings>
</userSettings>
</configuration>
2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Berkay Gediz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
891 changes: 465 additions & 426 deletions Main.Designer.cs

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ public partial class Main : Form
{ "WinTemp", "/Windows/TEMP" },
{ "WinTemp2", "/Users/" + Environment.UserName + "/AppData/Local/Temp" },
{ "DownloadedInstallations", "/Users/" + Environment.UserName + "/AppData/Roaming/Downloaded Installations" },
{ "CryptnetUrlCacheContent", "/Windows/System32/config/systemprofile/AppData/LocalLow/Microsoft/CryptnetUrlCache/Content"},
{ "CryptnetUrlCacheMetaData", "/Windows/System32/config/systemprofile/AppData/LocalLow/Microsoft/CryptnetUrlCache/MetaData"},
{ "NetworkServiceTemp", "/Windows/ServiceProfiles/NetworkService/AppData/Local/Temp"},
{ "TokenBrokerCache", "/Users/" + Environment.UserName + "/AppData/Local/Microsoft/TokenBroker/Cache"},
{ "waasmedicLog", "/Windows/Logs/waasmedic"},
{ "NetSetupLog", "/Windows/Logs/NetSetup"},
{ "ReportArchive", "/ProgramData/Microsoft/Windows/WER/ReportArchive"},
{ "ReportQueue", "/ProgramData/Microsoft/Windows/WER/ReportQueue"},
{ "WERTemp", "/ProgramData/Microsoft/Windows/WER/Temp"},
{ "RecentFiles", "/Users/" + Environment.UserName + "/AppData/Roaming/Microsoft/Windows/Recent" },
{ "RecentFiles2", "/Users/" + Environment.UserName + "/AppData/Roaming/Microsoft/Windows/Recent/AutomaticDestinations" },
{ "RecentFiles3", "/Users/" + Environment.UserName + "/AppData/Roaming/Microsoft/Windows/Recent/CustomDestinations" },
Expand Down Expand Up @@ -85,6 +94,7 @@ private void PASPAS_Main_Load(object sender, EventArgs e)
FontCache_select.Checked = Properties.Settings.Default.FontCache;
DownloadCache_select.Checked = Properties.Settings.Default.DownloadCache;
OldWindows_select.Checked = Properties.Settings.Default.OldWindows;
SysLogErrorRep_select.Checked = Properties.Settings.Default.SysLogErrorRep;
}
private void Exit_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -217,6 +227,11 @@ private void OldWindows_select_CheckedChanged(object sender, EventArgs e)
bool status = OldWindows_select.Checked;
CheckboxPropertySave((CheckBox)sender, status, "OldWindows");
}
private void SysLogErrorRep_select_CheckedChanged(object sender, EventArgs e)
{
bool status = SysLogErrorRep_select.Checked;
CheckboxPropertySave((CheckBox)sender, status, "SysLogErrorRep");
}
private void Basic_select_CheckedChanged(object sender, EventArgs e)
{
SelectedThread = 1;
Expand Down Expand Up @@ -304,6 +319,48 @@ private void DeleteFiles(string directory, string extension)
}
catch { }
}
private void DeleteAllFiles(string directory)
{
try
{
FileInfo fileinfo;
foreach (string file in Directory.GetFiles(SystemDirectory + directory))
{
fileinfo = new FileInfo(file);

fileinfo.Delete();
if (fileinfo.Exists == false)
{
FileCount++;
ProcessBox.Items.Add(FileCount + " | " + fileinfo.ToString());
}
else { RejectCount++; }

}
}
catch { }
}
private void DeleteAllDirectories(string directory)
{
try
{
DirectoryInfo dirinfo;
foreach (string dir in Directory.GetDirectories(SystemDirectory + directory))
{
dirinfo = new DirectoryInfo(dir);

dirinfo.Delete();
if (dirinfo.Exists == false)
{
FileCount++;
ProcessBox.Items.Add(FileCount + " | " + dirinfo.ToString());
}
else { RejectCount++; }

}
}
catch { }
}
private void AnalyzeFiles(string directory, string extension)
{
try
Expand All @@ -325,6 +382,45 @@ private void AnalyzeFiles(string directory, string extension)
}
catch { }
}
private void AnalyzeAllFiles(string directory)
{
try
{
FileInfo fileinfo;
foreach (string file in Directory.GetFiles(SystemDirectory + directory))
{
fileinfo = new FileInfo(file);

if (fileinfo.Exists)
{
FileCount++;
ProcessBox.Items.Add(FileCount + " | " + fileinfo.ToString());
}
else { RejectCount++; }

}
}
catch { }
}
private void AnalyzeAllDirectories(string directory)
{
try
{
DirectoryInfo dirinfo;
foreach (string dir in Directory.GetDirectories(SystemDirectory + directory))
{
dirinfo = new DirectoryInfo(dir);

if (dirinfo.Exists == false)
{
FileCount++;
ProcessBox.Items.Add(FileCount + " | " + dirinfo.ToString());
}
else { RejectCount++; }
}
}
catch { }
}
private void SingleDirectoryDeletion(string directory)
{
try
Expand Down Expand Up @@ -522,6 +618,7 @@ private void ThreadSpecial()
if (Properties.Settings.Default.SystemCache == true)
{
DeleteFiles(folders["SystemCache"], ".db");
DeleteAllFiles(folders["TokenBrokerCache"]);
Process_count.Text = FileCount.ToString() + " / " + RejectCount.ToString();
}
if (Properties.Settings.Default.MemoryDumps == true)
Expand Down Expand Up @@ -551,6 +648,21 @@ private void ThreadSpecial()
{
SingleDirectoryDeletion(folders["OldWindows"]);
}
if (Properties.Settings.Default.SysLogErrorRep == true)
{
DeleteAllFiles(folders["CryptnetUrlCacheContent"]);
DeleteAllFiles(folders["CryptnetUrlCacheMetaData"]);
DeleteAllFiles(folders["NetworkServiceTemp"]);
DeleteFiles(folders["waasmedicLog"], ".etl");
DeleteFiles(folders["NetSetupLog"], ".etl");
DeleteAllDirectories(folders["ReportArchive"]);
DeleteAllFiles(folders["ReportArchive"]);
DeleteAllDirectories(folders["ReportQueue"]);
DeleteAllFiles(folders["ReportQueue"]);
DeleteAllDirectories(folders["WERTemp"]);
DeleteAllFiles(folders["WERTemp"]);
}

Process_count.Text = FileCount.ToString() + " / " + RejectCount.ToString();
process_img.Visible = false;
Finish.Visible = true;
Expand Down Expand Up @@ -601,6 +713,8 @@ private void ThreadAnalysis()
if (Properties.Settings.Default.SystemCache == true || SelectedThread == 2)
{
AnalyzeFiles(folders["SystemCache"], ".db");
AnalyzeAllFiles(folders["TokenBrokerCache"]);

}
if (Properties.Settings.Default.MemoryDumps == true || SelectedThread == 2)
{
Expand Down Expand Up @@ -628,6 +742,20 @@ private void ThreadAnalysis()
{
SingleDirectoryAnalyze(folders["OldWindows"]);
}
if (Properties.Settings.Default.SysLogErrorRep == true)
{
AnalyzeAllFiles(folders["CryptnetUrlCacheContent"]);
AnalyzeAllFiles(folders["CryptnetUrlCacheMetaData"]);
AnalyzeAllFiles(folders["NetworkServiceTemp"]);
AnalyzeFiles(folders["waasmedicLog"], ".etl");
AnalyzeFiles(folders["NetSetupLog"], ".etl");
AnalyzeAllDirectories(folders["ReportArchive"]);
AnalyzeAllFiles(folders["ReportArchive"]);
AnalyzeAllDirectories(folders["ReportQueue"]);
AnalyzeAllFiles(folders["ReportQueue"]);
AnalyzeAllDirectories(folders["WERTemp"]);
AnalyzeAllFiles(folders["WERTemp"]);
}
}
Process_count.Text = FileCount.ToString() + " / " + RejectCount.ToString();
process_img.Visible = false;
Expand Down Expand Up @@ -736,5 +864,13 @@ private void Github_label_LinkClicked(object sender, LinkLabelLinkClickedEventAr
{
Process.Start("https://github.com/berkaygediz");
}
private void promo_richspan_button_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/berkaygediz/RichSpan");
}
private void promo_spanrc_button_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/berkaygediz/SpanRC");
}
}
}
5 changes: 3 additions & 2 deletions PASPAS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
<StartupObject>PASPAS.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>paspas.ico</ApplicationIcon>
Expand Down Expand Up @@ -134,6 +133,8 @@
</ItemGroup>
<ItemGroup>
<Content Include="paspas.ico" />
<None Include="Resources\spanrc.png" />
<None Include="Resources\richspan.png" />
<None Include="Resources\finish.png" />
<None Include="Resources\process.gif" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("berkaygediz")]
[assembly: AssemblyProduct("PASPAS")]
[assembly: AssemblyCopyright("Berkay Gediz © 2023")]
[assembly: AssemblyCopyright("Berkay Gediz © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,6 +32,6 @@
// Tüm değerleri belirtebilir veya varsayılan Derleme ve Düzeltme Numaralarını kullanmak için
// '*' kullanarak varsayılana ayarlayabilirsiniz:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: NeutralResourcesLanguage("en")]
50 changes: 35 additions & 15 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,16 @@
<data name="paspas" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\paspas.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="finish" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\finish.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="process" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\process.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="finish" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\finish.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="richspan" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\richspan.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="spanrc" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\spanrc.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Loading

0 comments on commit b0a14b3

Please sign in to comment.