Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IoD everything so far #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ publish/
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
# *.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand Down Expand Up @@ -337,4 +337,5 @@ ASALocalRun/
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb
healthchecksdb
IOD Tester/IOD Tester/Properties/launchSettings.json
71 changes: 71 additions & 0 deletions IOD Tester/IOD Tester.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IOD Tester", "IOD Tester\IOD Tester.csproj", "{FDBEB6F1-1765-40A8-8F08-EC74347C239E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Morphic.IoD", "Morphic.IoD\Morphic.IoD.csproj", "{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|ARM.Build.0 = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|ARM64.Build.0 = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|x64.ActiveCfg = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|x64.Build.0 = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|x86.ActiveCfg = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Debug|x86.Build.0 = Debug|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|Any CPU.Build.0 = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|ARM.ActiveCfg = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|ARM.Build.0 = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|ARM64.ActiveCfg = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|ARM64.Build.0 = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|x64.ActiveCfg = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|x64.Build.0 = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|x86.ActiveCfg = Release|Any CPU
{FDBEB6F1-1765-40A8-8F08-EC74347C239E}.Release|x86.Build.0 = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|ARM.Build.0 = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|ARM64.Build.0 = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|x64.ActiveCfg = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|x64.Build.0 = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|x86.ActiveCfg = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Debug|x86.Build.0 = Debug|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|Any CPU.Build.0 = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|ARM.ActiveCfg = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|ARM.Build.0 = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|ARM64.ActiveCfg = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|ARM64.Build.0 = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|x64.ActiveCfg = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|x64.Build.0 = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|x86.ActiveCfg = Release|Any CPU
{2D7C7F1E-F86A-4DF6-AB97-D93B330E86E8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FC47EDB5-FAA6-47D0-97A5-259A4C9DCA13}
EndGlobalSection
EndGlobal
43 changes: 43 additions & 0 deletions IOD Tester/IOD Tester/IOD Tester.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0-windows10.0.17763.0</TargetFramework>
<RootNamespace>IOD_Tester</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>C:\VS Builds\Debug\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>C:\VS Builds\Release\</OutputPath>
</PropertyGroup>

<ItemGroup>
<COMReference Include="WbemScripting.dll">
<Guid>565783c6-cb41-11d1-8b02-00600806d9b6</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>2</VersionMinor>
<WrapperTool>tlbimp</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
</COMReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Management" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Morphic.IoD\Morphic.IoD.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.Deployment.WindowsInstaller">
<HintPath>C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.WindowsInstaller.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
216 changes: 216 additions & 0 deletions IOD Tester/IOD Tester/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
using Morphic.IoD;
using System;
using System.IO;
using System.Threading.Tasks;

namespace IOD_Tester
{
class Program
{
static async Task Main(string[] args)
{
var basepath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var msipath = Path.Combine(basepath, "exe contents", "setup.msi");
var exepath = Path.Combine(basepath, "J2021.2011.16.400-any.exe");

/*
Console.WriteLine("Setting Restore Point:");

IoDSystemRestorePoint.EnableMultiPointRestore();

if (IoDSystemRestorePoint.SetStartPoint("Morphic Start Point"))
{
Console.WriteLine("Restore Point Set Successfully.");
}
else
{
Console.WriteLine("Restore Point Failed. Please Try Again.");

Console.WriteLine("Press Enter to Exit:");

Console.ReadKey();

return;
}
*/

Console.WriteLine("Installing Programs:");

/*

Console.WriteLine("MSI Install:");

//var msipath = Path.Combine(basepath, "Installers", "MSI", "CertDump.msi");
var msiInstall = new IoDMsiInstaller(msipath);
msiInstall.verbose = true; //comment out to get the progress monitor to shut up

status = await msiInstall.RunAsync();

if (status == IoDStatus.OK)
{
Console.WriteLine("Install Successful");
}
else
{
Console.WriteLine("Installer Failed, Error " + status.inEnglish());
}*/

string msixpath;
IoDMsiXInstaller msixInstall;

Console.WriteLine("MSIX Tests:");

string[,] names = new string[,]
{
{"AppInstallerFileBuilder", "AppInstallerFileBuilder.msix" },
{"EarTrumpet", "EarTrumpet.appxbundle" },
{"Files", "Files.msixbundle" },
{"ModernFlyouts", "ModernFlyouts.msixbundle" },
{"MSIX Commander", "MSIX Commander.msix" },
{"MSIX Hero", "MSIX Hero.msix" },
{"Notepads", "Notepads.msixbundle" },
{"Picard", "Picard.msix" },
{"PowerShell", "PowerShell.msix" },
{"PowerToys", "PowerToys.msix" },
{"Presence Light", "PresenceLight.appxbundle" },
{"Strix Music", "StrixMusic.appxbundle" },
{"Windows Terminal", "WindowsTerminal.msixbundle" },
{"XML Notepad", "XMLNotepad.msixbundle" },
{"Torrex", "Torrex.msix" }
};

msixInstall = new IoDMsiXInstaller();
ProgressBars bars = new ProgressBars();
int currBar = 0;

for (int i = 0; i < names.GetLength(0); ++i)
{
bars.Add(names[i, 0]);
}
bars.Write();

for (int i = 0; i < names.GetLength(0); ++i)
{
msixpath = Path.Combine(basepath, "Installers", "MSIX", names[i, 1]);
msixInstall.verbose = false;

EventHandler<IoDMsiXInstaller.ProgressEventArgs> handler = new EventHandler<IoDMsiXInstaller.ProgressEventArgs>((object? caller, IoDMsiXInstaller.ProgressEventArgs args) =>
{
bars.Update(i, args.progressVal, args.progressState == Windows.Management.Deployment.DeploymentProgressState.Processing);
});

var status = await msixInstall.InstallAsync(msixpath, handler);

if (status.IsSuccess)
{
Console.WriteLine("Install Successful");
}
else
{
Console.WriteLine("Installer Failed, Error " + status.Error.type.ToString() + " (windows code " + status.Error.errorCode.ToString() + ")");
Console.WriteLine(status.Error.verboseLog);
}

currBar++;
}

string[,] unames = new string[,]
{
{"AppInstallerFileBuilder", "AppInstallerFileBuilder_1.2020.221.0_x86__8wekyb3d8bbwe" },
{"EarTrumpet", "40459File-New-Project.EarTrumpet_2.1.8.0_x86__725pr5jq8wr8a" },
{"Files", "49306atecsolution.FilesUWP_0.21.1.0_x64__et10x9a9vyk8t" },
{"ModernFlyouts", "32669SamG.ModernFlyouts_0.6.0.0_neutral__pcy8vm99wrpcg" },
{"MSIX Commander", "PascalBerger.MSIXCommander_1.0.7.5_x64__ajjbhed1xnq88" },
{"MSIX Hero", "MSIXHero_0.7.1.0_neutral__zxq1da1qqbeze" },
{"Notepads", "19282JackieLiu.Notepads-Beta_1.3.8.0_x64__echhpq9pdbte8" },
{"Picard", "MetaBrainzFoundationInc.org.musicbrainz.Picard_2.4.40000.0_x64__6cfbg5p5jt8h8" },
{"PowerShell", "Microsoft.PowerShellPreview_7.0.2.0_x64__8wekyb3d8bbwe" },
{"PowerToys", "Microsoft.PowerToys_0.15.2.0_x64__8wekyb3d8bbwe" },
{"Presence Light", "37828IsaacLevin.197278F15330A_3.5.15.0_x64__jvewcxq8vj8qt" },
{"Strix Music", "59553ArloG.StrixMusicBeta_1.4.7.0_x64__gzh7hvbrgycb4" },
{"Windows Terminal", "Microsoft.WindowsTerminal_0.11.1333.0_x64__8wekyb3d8bbwe" },
{"XML Notepad", "5632ff08-aa93-439a-b09f-677eb3664250_2.8.0.25_neutral__b2j8apzf1bbh6" },
{"Torrex", "womp womp" }
};

msixInstall = new IoDMsiXInstaller();
ProgressBars ubars = new ProgressBars();
currBar = 0;

for (int i = 0; i < unames.GetLength(0); ++i)
{
ubars.Add(unames[i, 0]);
}
ubars.Write();

for (int i = 0; i < unames.GetLength(0); ++i)
{
msixInstall.verbose = false;

EventHandler<IoDMsiXInstaller.ProgressEventArgs> uhandler = new EventHandler<IoDMsiXInstaller.ProgressEventArgs>((object? caller, IoDMsiXInstaller.ProgressEventArgs args) =>
{
ubars.Update(i, args.progressVal, args.progressState == Windows.Management.Deployment.DeploymentProgressState.Processing);
});

var status = await msixInstall.UninstallAsync(unames[i, 1], uhandler);

if (status.IsSuccess)
{
Console.WriteLine("Uninstall Successful");
}
else
{
Console.WriteLine("Uninstaller Failed, Error " + status.Error.type.ToString() + " (windows code " + status.Error.errorCode.ToString() + ")");
Console.WriteLine(status.Error.verboseLog);
}

currBar++;
}

//IoDSystemRestorePoint.SetStartPoint("Morphic After MSIXs");

/*

Console.WriteLine("EXE Install:");

//var exepath = Path.Combine(basepath, "J2021.2011.16.400-any.exe");
var exeInstall = new IoDExeLauncher(exepath, "/Silent");

status = await exeInstall.RunAsync();

if (status == IoDStatus.OK)
{
Console.WriteLine("Install Successful");
}
else
{
Console.WriteLine("Installer Failed, Error: " + status.inEnglish());
}*/

//IoDSystemRestorePoint.SetEndPoint("lmao");

//Console.WriteLine("Uninstalling");

//msiInstall.Uninstall();

/*Console.WriteLine("Activating System Restore");

if (IoDSystemRestorePoint.Restore("Morphic Start Point"))
{
Console.WriteLine("Restore Activation Successful, Restart Computer to Activate System Restore");
}
else
{
Console.WriteLine("System Restore Activation Failed.");
}*/

Console.WriteLine("Complete!");

Console.WriteLine("Press Enter to Exit:");

Console.ReadKey();

return;
}
}
}
Loading