Skip to content

Commit

Permalink
Small Script Loading fixes
Browse files Browse the repository at this point in the history
Improved information and output on script execution results

prepped for a release build test
  • Loading branch information
Empyreal96 committed Jul 6, 2022
1 parent 925872b commit 867d8f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/Command Prompt.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UapAppxPackageBuildMode>SideloadOnly</UapAppxPackageBuildMode>
<AppxShowAllApps>False</AppxShowAllApps>
<AppxBuildConfigurationSelection>arm</AppxBuildConfigurationSelection>
<PackageOptionalProjectsInIdeBuilds>True</PackageOptionalProjectsInIdeBuilds>
<PackageOptionalProjectsInIdeBuilds>False</PackageOptionalProjectsInIdeBuilds>
<Source>C:\Users\Empyreal96\Pictures\icons\w11_cmd_Icon8.png</Source>
<SmallTileSource>C:\Users\Empyreal96\Pictures\icons\w11_cmd_Icon8.png</SmallTileSource>
<MediumTileSource>C:\Users\Empyreal96\Pictures\icons\w11_cmd_Icon8.png</MediumTileSource>
Expand All @@ -18,4 +18,8 @@
<SplashScreenSource>C:\Users\Empyreal96\Pictures\icons\w11_cmd_Icon8.png</SplashScreenSource>
<PackageLogoSource>C:\Users\Empyreal96\Pictures\icons\w11_cmd_Icon8.png</PackageLogoSource>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<DeviceId>30f105c9-681e-420b-a277-7c086ead8a4e</DeviceId>
<UseEmulator>true</UseEmulator>
</PropertyGroup>
</Project>
22 changes: 13 additions & 9 deletions src/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ private async void MenuFlyoutItem_Click_2(object sender, RoutedEventArgs e)
StorageFile storage = await file.PickSingleFileAsync();
if (storage == null)
{
ProgressBarControl(false);
return;
}
string scriptPath = storage.Path;
Expand All @@ -238,22 +239,24 @@ private async void MenuFlyoutItem_Click_2(object sender, RoutedEventArgs e)
await client.Send($"cd /d \"{scriptParent}\" > \"{LocalPath}\\cmdstring.txt\" 2>&1");


CMDtestText.Text += $"cd /d \"{scriptParent}\"\n";
CMDtestText.Text += $"\n\nChanging to Script Directory: \"{scriptParent}\" and executing Script\nPlease Wait\n\n";
await client.Send($"echo %CD%^> > \"{LocalPath}\\cmdstring.txt\" 2>&1");

string results = File.ReadAllText($"{LocalPath}\\cmdstring.txt");
CMDtestText.Text += $"{results}r\n";
CMDtestText.Text += $"{results}\n\n";



await client.Send($"\"{storage.Path}\" > \"{LocalPath}\\cmdstring.txt\" 2>&1");
string results2 = File.ReadAllText($"{LocalPath}\\cmdstring.txt");
//string[] results2 = File.ReadAllLines($"{LocalPath}\\cmdstring.txt");

CMDtestText.Text += $"{results2}\n";

//string results2 = File.ReadAllText($"{LocalPath}\\cmdstring.txt");
string[] results2 = File.ReadAllLines($"{LocalPath}\\cmdstring.txt");
foreach (string var in results2)
{
CMDtestText.Text += $"\n{var}";
}
await client.Send($"echo %CD%^> > \"{LocalPath}\\cmdstring.txt\" 2>&1");
string results3 = File.ReadAllText($"{LocalPath}\\cmdstring.txt");
CMDtestText.Text += $"{results3}";
CMDtestText.Text += $"\n\n{results3}\n\n";


var grid = (Grid)VisualTreeHelper.GetChild(CMDtestText, 0);
Expand Down Expand Up @@ -327,9 +330,10 @@ private void ProgressBarControl(bool enable)
private void MenuFlyoutItem_Click_4(object sender, RoutedEventArgs e)
{
Exceptions.CustomMessage(
"Command Prompt for Windows 10 Mobile:\n\n" +
"Command Prompt v0.1.0 for Windows 10 Mobile:\n\n" +
"- Thanks to Fadil Fadz for CMD Injector and some help with output formatting.\n" +
"- Thanks to BAstifan for the TelnetClient library\n\n" +
"Note: Only simple scripts are supported at this time, example is scripts with NO user input\n\n" +
"Any Issues? Submit an issue on \"https://github.com/empyreal96/mobile-cmd\""
) ;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity
Name="WPCommandPrompt"
Publisher="CN=Empyreal96"
Version="0.0.27.0" />
Version="0.1.0.0" />

<mp:PhoneIdentity PhoneProductId="7c02d3dd-afe8-4c25-a609-a888b4adf4f7" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down

0 comments on commit 867d8f8

Please sign in to comment.