diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava.sln b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava.sln new file mode 100644 index 0000000..67b0ba4 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava.sln @@ -0,0 +1,81 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppDependsOnJava", "AppDependsOnJava\AppDependsOnJava.csproj", "{E6E0F5C3-3630-462B-B1AD-ECEE32425492}" +EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "PackagingProject", "PackagingProject\PackagingProject.wapproj", "{76186349-91EF-4584-9F83-D220D04B72E3}" +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 + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|ARM.ActiveCfg = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|ARM.Build.0 = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|ARM64.Build.0 = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|x64.ActiveCfg = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|x64.Build.0 = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|x86.ActiveCfg = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Debug|x86.Build.0 = Debug|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|Any CPU.Build.0 = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|ARM.ActiveCfg = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|ARM.Build.0 = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|ARM64.ActiveCfg = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|ARM64.Build.0 = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|x64.ActiveCfg = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|x64.Build.0 = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|x86.ActiveCfg = Release|Any CPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492}.Release|x86.Build.0 = Release|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM.ActiveCfg = Debug|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM.Build.0 = Debug|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM.Deploy.0 = Debug|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM64.Build.0 = Debug|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x64.ActiveCfg = Debug|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x64.Build.0 = Debug|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x64.Deploy.0 = Debug|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x86.ActiveCfg = Debug|x86 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x86.Build.0 = Debug|x86 + {76186349-91EF-4584-9F83-D220D04B72E3}.Debug|x86.Deploy.0 = Debug|x86 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|Any CPU.Build.0 = Release|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|Any CPU.Deploy.0 = Release|Any CPU + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM.ActiveCfg = Release|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM.Build.0 = Release|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM.Deploy.0 = Release|ARM + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM64.ActiveCfg = Release|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM64.Build.0 = Release|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|ARM64.Deploy.0 = Release|ARM64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x64.ActiveCfg = Release|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x64.Build.0 = Release|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x64.Deploy.0 = Release|x64 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x86.ActiveCfg = Release|x86 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x86.Build.0 = Release|x86 + {76186349-91EF-4584-9F83-D220D04B72E3}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D90ECD1D-C27B-4502-9783-F22CE95E9F95} + EndGlobalSection +EndGlobal diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/App.config b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/App.config new file mode 100644 index 0000000..5754728 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/AppDependsOnJava.csproj b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/AppDependsOnJava.csproj new file mode 100644 index 0000000..31da507 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/AppDependsOnJava.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {E6E0F5C3-3630-462B-B1AD-ECEE32425492} + WinExe + AppDependsOnJava + AppDependsOnJava + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.Designer.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.Designer.cs new file mode 100644 index 0000000..e6c3ea9 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace AppDependsOnJava +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(49, 44); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(51, 20); + this.label1.TabIndex = 0; + this.label1.Text = "Waiting..."; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.label1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} + diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.cs new file mode 100644 index 0000000..7bf0c08 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.cs @@ -0,0 +1,49 @@ +using System; +using System.Diagnostics; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AppDependsOnJava +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + Task.Run(this.CheckJava); + } + + + private async Task CheckJava() + { + StringBuilder pout = new StringBuilder(); + + try + { + Process p = new Process(); + p.StartInfo.FileName = @"java.exe"; + p.StartInfo.Arguments = "-version"; + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + p.StartInfo.UseShellExecute = false; + p.OutputDataReceived += (sender, args) => pout.AppendLine(args.Data); + p.ErrorDataReceived += (sender, args) => pout.AppendLine(args.Data); + + p.Start(); + p.BeginOutputReadLine(); + p.BeginErrorReadLine(); + p.WaitForExit(); + } + catch (Exception ex) + { + pout.AppendLine("Java not found"); + } + + Invoke(new Action(() => + { + this.label1.Text = pout.ToString(); + })); + } + } +} diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.resx b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Program.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Program.cs new file mode 100644 index 0000000..7e9d9be --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AppDependsOnJava +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/AssemblyInfo.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9788a6a --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AppDependsOnJava")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft IT")] +[assembly: AssemblyProduct("AppDependsOnJava")] +[assembly: AssemblyCopyright("Copyright © Microsoft IT 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e6e0f5c3-3630-462b-b1ad-ecee32425492")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.Designer.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.Designer.cs new file mode 100644 index 0000000..9ee7897 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AppDependsOnJava.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppDependsOnJava.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.resx b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.Designer.cs b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.Designer.cs new file mode 100644 index 0000000..fb53664 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AppDependsOnJava.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.settings b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/AppDependsOnJava/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/LockScreenLogo.scale-200.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..735f57a Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/LockScreenLogo.scale-200.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/SplashScreen.scale-200.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/SplashScreen.scale-200.png new file mode 100644 index 0000000..023e7f1 Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/SplashScreen.scale-200.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square150x150Logo.scale-200.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..af49fec Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square150x150Logo.scale-200.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.scale-200.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..ce342a2 Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.scale-200.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..f6c02ce Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/StoreLogo.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/StoreLogo.png new file mode 100644 index 0000000..7385b56 Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/StoreLogo.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Wide310x150Logo.scale-200.png b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..288995b Binary files /dev/null and b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Images/Wide310x150Logo.scale-200.png differ diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/Package.appxmanifest b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Package.appxmanifest new file mode 100644 index 0000000..3f425f8 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/PackagingProject/Package.appxmanifest @@ -0,0 +1,49 @@ + + + + + + + + AppDependsOnJava + TestPublisher + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/JREContainer/AppDependsOnJava/PackagingProject/PackagingProject.wapproj b/Samples/JREContainer/AppDependsOnJava/PackagingProject/PackagingProject.wapproj new file mode 100644 index 0000000..9733014 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/PackagingProject/PackagingProject.wapproj @@ -0,0 +1,121 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM + + + Release + ARM + + + Debug + ARM64 + + + Release + ARM64 + + + Debug + AnyCPU + + + Release + AnyCPU + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + + + + 76186349-91ef-4584-9f83-d220d04b72e3 + 10.0.22000.0 + 10.0.17763.0 + en-US + True + $(NoWarn);NU1702 + ..\AppDependsOnJava\AppDependsOnJava.csproj + True + PackagingProject_TemporaryKey.pfx + SHA256 + True + False + True + e:\test_msix + 0 + + + Never + + + Never + + + Never + + + Never + + + Never + + + Never + + + Never + + + Never + + + Never + + + Never + + + + Designer + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/JREContainer/AppDependsOnJava/README.md b/Samples/JREContainer/AppDependsOnJava/README.md new file mode 100644 index 0000000..1ee3f21 --- /dev/null +++ b/Samples/JREContainer/AppDependsOnJava/README.md @@ -0,0 +1,12 @@ +## Instructions +Build this project to generate a msix package containing a jar file. + + +### Requirements +1. .NETFramework 4.7 +2. Visual Studio 2022 + +### Building project +1. Open [AppDependsOnJava](AppDependsOnJava.sln) solution on Visual Studio 2022 +2. Publish the *PackagingProject* to generate msix. See [doc](https://learn.microsoft.com/en-us/windows/msix/package/packaging-uwp-apps) on how to publish the project + diff --git a/Samples/JREContainer/JarApplication/AppxManifest.xml b/Samples/JREContainer/JarApplication/AppxManifest.xml new file mode 100644 index 0000000..d72c948 --- /dev/null +++ b/Samples/JREContainer/JarApplication/AppxManifest.xml @@ -0,0 +1,36 @@ + + + + + + + JavaVersion + JavaVersion + None + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/JREContainer/JarApplication/README.md b/Samples/JREContainer/JarApplication/README.md new file mode 100644 index 0000000..f757d47 --- /dev/null +++ b/Samples/JREContainer/JarApplication/README.md @@ -0,0 +1,21 @@ +## Instructions +Build this project to generate a msix package containing a jar file. + + +### Requirements +1. [java](https://jdk.java.net/20/) +2. [maven](https://maven.apache.org/download.cgi) + +### Building msix +1. Compile the project using maven +2. Generate jar file using maven +3. Bundle the jar into a msix + +```powershell +mvn clean compile +mvn package +New-Item -Path .\target\temp -ItemType "directory" +Copy-Item -Path .\target\version-0.1.0.jar .\target\temp\version.jar +Copy-Item -Path .\AppxManifest.xml .\target\temp +makeappx.exe pack /nv /nfv /d .\target\temp /p .\target\java_version.msix /o +``` diff --git a/Samples/JREContainer/JarApplication/pom.xml b/Samples/JREContainer/JarApplication/pom.xml new file mode 100644 index 0000000..8ff1b70 --- /dev/null +++ b/Samples/JREContainer/JarApplication/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.app + version + jar + 0.1.0 + + + 1.8 + 1.8 + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.4 + + + package + + shade + + + + + org.app.Version + + + + + + + + + \ No newline at end of file diff --git a/Samples/JREContainer/JarApplication/src/main/java/org/app/Version.java b/Samples/JREContainer/JarApplication/src/main/java/org/app/Version.java new file mode 100644 index 0000000..2a6baf9 --- /dev/null +++ b/Samples/JREContainer/JarApplication/src/main/java/org/app/Version.java @@ -0,0 +1,27 @@ +package org.app; + +import javax.swing.*; + +class Version { + + private static void createAndShowGUI() { + //Make sure we have nice window decorations. + JFrame.setDefaultLookAndFeelDecorated(true); + + //Create and set up the window. + JFrame frame = new JFrame("Test"); + frame.setSize(200, 100); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + //Show Java version that is running the app + JLabel label = new JLabel("Version: " + System.getProperty("java.version"), SwingConstants.CENTER); + frame.getContentPane().add(label); + + //Display the window. + frame.setVisible(true); + } + + public static void main(String[] args) { + SwingUtilities.invokeLater(Version::createAndShowGUI); + } +} \ No newline at end of file diff --git a/Samples/JREContainer/README.md b/Samples/JREContainer/README.md new file mode 100644 index 0000000..70da6f3 --- /dev/null +++ b/Samples/JREContainer/README.md @@ -0,0 +1,31 @@ +This repo contains 2 applications, both of which requires Java to run. One on them is a **jar** file and another executes java.exe to get its version. This will demonstrate how to package java and use it in the 2 scenarios. + +## Instructions +You can learn more about [hosted apps](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/hosted-apps). + +### Minimum OS Requirements: +1. Windows 10 20H1 (10.0.19041.0) + +### Steps to package Java +1. Get Java on your machine. You can download it from [openJDK site](https://jdk.java.net/20/) and then extract the contents. +2. Copy the [sample java manifest](java_sample_manifest.xml) to inside the extracted folder as AppxManifest.xml. +3. Run makeappx to create the package + +```powershell +Invoke-WebRequest -Uri https://download.java.net/java/GA/jdk20.0.1/b4887098932d415489976708ad6d1a4b/9/GPL/openjdk-20.0.1_windows-x64_bin.zip -OutFile $env:TEMP\jdk_20.zip +Expand-Archive -Path $env:TEMP\jdk_20.zip -DestinationPath $env:TEMP\jdk_20 +Copy-Item -Path .\java_sample_manifest.xml $env:TEMP\jdk_20\jdk-20.0.1\AppxManifest.xml +makeappx.exe pack /nv /nfv /d $env:TEMP\jdk_20\jdk-20.0.1 /p openjdk_20.msix /o +``` + +### Steps to run jar application +1. Build the [JarApplication](JarApplication) project. See [Readme](JarApplication/README.md) on how to create an MSIX +2. Install *packaged java* on the system and then the *packaged application* (java_version.msix) +3. Now you should be able to launch app (Java Version) and it should display the version of java it is using. + + +### Steps to run Application requiring java +1. Build the [AppDependsOnJava](AppDependsOnJava) project. See [Readme](AppDependsOnJava/README.md) on how to create the MSIX +2. Install *packaged java* on the system and then the *packaged application* +3. Now you should be able to launch the app (AppDependsOnJava) and it should display the version of java it is using. + diff --git a/Samples/JREContainer/java_sample_manifest.xml b/Samples/JREContainer/java_sample_manifest.xml new file mode 100644 index 0000000..8316bf8 --- /dev/null +++ b/Samples/JREContainer/java_sample_manifest.xml @@ -0,0 +1,48 @@ + + + + + + + Java + OpenJDK + Contoso + StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file