commit 6e05dc7dcc07cb8a4739939795195bb255adada8 Author: muhammad.faique Date: Fri Feb 14 11:40:52 2025 +0500 Initial Commit diff --git a/.vs/AVSUpdater/FileContentIndex/36a5ff39-f236-480f-b40b-476e342c1cb0.vsidx b/.vs/AVSUpdater/FileContentIndex/36a5ff39-f236-480f-b40b-476e342c1cb0.vsidx new file mode 100644 index 0000000..79e769a Binary files /dev/null and b/.vs/AVSUpdater/FileContentIndex/36a5ff39-f236-480f-b40b-476e342c1cb0.vsidx differ diff --git a/.vs/AVSUpdater/v16/.suo b/.vs/AVSUpdater/v16/.suo new file mode 100644 index 0000000..5d1556e Binary files /dev/null and b/.vs/AVSUpdater/v16/.suo differ diff --git a/.vs/AVSUpdater/v17/.suo b/.vs/AVSUpdater/v17/.suo new file mode 100644 index 0000000..565d5a6 Binary files /dev/null and b/.vs/AVSUpdater/v17/.suo differ diff --git a/AVSUpdater.csproj b/AVSUpdater.csproj new file mode 100644 index 0000000..4fadec6 --- /dev/null +++ b/AVSUpdater.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {F0039594-0D75-47FF-8958-EF3F38494F44} + Exe + AVSUpdater + AVSUpdater + v4.5 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AVSUpdater.sln b/AVSUpdater.sln new file mode 100644 index 0000000..3573c07 --- /dev/null +++ b/AVSUpdater.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.34931.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AVSUpdater", "AVSUpdater.csproj", "{F0039594-0D75-47FF-8958-EF3F38494F44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F0039594-0D75-47FF-8958-EF3F38494F44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0039594-0D75-47FF-8958-EF3F38494F44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0039594-0D75-47FF-8958-EF3F38494F44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0039594-0D75-47FF-8958-EF3F38494F44}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0CF20D76-24CB-4D47-A1AF-DD05544EEF78} + EndGlobalSection +EndGlobal diff --git a/App.config b/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..5c0507d --- /dev/null +++ b/Program.cs @@ -0,0 +1,87 @@ +using System; +using System.IO; +using System.Diagnostics; +using System.Threading; +using System.Windows.Forms; + +namespace AVSUpdater +{ + class Program + { + static void Main(string[] args) + { + //if (args.Length < 2) + //{ + // Console.WriteLine("Invalid arguments. Usage: AVSUpdater.exe "); + // return; + //} + + //string sourcePath = args[0]; + //string destinationPath = args[1]; + + + string sourcePath = @"\\FileServer\\eData\\AVS"; + string destinationPath = "C:\\Users\\Public\\Documents\\AVS"; + + + string applicationName = "AVS.exe"; + + try + { + // Ensure the destination directory exists + if (!Directory.Exists(destinationPath)) + { + Directory.CreateDirectory(destinationPath); + } + MessageBox.Show("Start Copying Files"); + // Copy all files from the source to the destination + foreach (var file in Directory.GetFiles(sourcePath, "*", SearchOption.AllDirectories)) + { + + + // Manually calculate the relative path + string relativePath = file.Substring(sourcePath.Length + 1); // Remove the sourcePath part + + // Construct the destination file path + string destFilePath = Path.Combine(destinationPath, relativePath); + + // Ensure the destination directory exists + string destDirectory = Path.GetDirectoryName(destFilePath); + if (!Directory.Exists(destDirectory)) + { + Directory.CreateDirectory(destDirectory); + } + + // Skip specific files (e.g., alert-alarm.WAV) + if (relativePath.Equals("alert-alarm.WAV", StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + // Copy the file + File.Copy(file, destFilePath, overwrite: true); + } + + // Restart the main application + string applicationPath = Path.Combine(destinationPath, applicationName); + Console.WriteLine(applicationPath); + + + if (File.Exists(applicationPath)) + { + MessageBox.Show("Starting application again"); + Process.Start(applicationPath); + } + else + { + Console.WriteLine("Application executable not found in the destination folder."); + } + } + catch (Exception ex) + { + Console.WriteLine($"An error occurred during the update: {ex.Message}"); + } + //Console.ReadKey(); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..02f30dd --- /dev/null +++ b/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("AVSUpdater")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AVSUpdater")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[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("f0039594-0d75-47ff-8958-ef3f38494f44")] + +// 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/bin/Debug/AVSUpdater.exe b/bin/Debug/AVSUpdater.exe new file mode 100644 index 0000000..e13550c Binary files /dev/null and b/bin/Debug/AVSUpdater.exe differ diff --git a/bin/Debug/AVSUpdater.exe.config b/bin/Debug/AVSUpdater.exe.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/bin/Debug/AVSUpdater.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/bin/Debug/AVSUpdater.pdb b/bin/Debug/AVSUpdater.pdb new file mode 100644 index 0000000..24af097 Binary files /dev/null and b/bin/Debug/AVSUpdater.pdb differ diff --git a/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttributes.cs b/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttributes.cs new file mode 100644 index 0000000..e5dc9b8 --- /dev/null +++ b/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")] diff --git a/obj/Debug/AVSUpdater.csproj.AssemblyReference.cache b/obj/Debug/AVSUpdater.csproj.AssemblyReference.cache new file mode 100644 index 0000000..68de2bd Binary files /dev/null and b/obj/Debug/AVSUpdater.csproj.AssemblyReference.cache differ diff --git a/obj/Debug/AVSUpdater.csproj.CoreCompileInputs.cache b/obj/Debug/AVSUpdater.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..fba1bb4 --- /dev/null +++ b/obj/Debug/AVSUpdater.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +3929e57a78b45ebc7f038a2982c9c05178085f55 diff --git a/obj/Debug/AVSUpdater.csproj.FileListAbsolute.txt b/obj/Debug/AVSUpdater.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3a1cff7 --- /dev/null +++ b/obj/Debug/AVSUpdater.csproj.FileListAbsolute.txt @@ -0,0 +1,7 @@ +D:\Projects\AVSUpdater\bin\Debug\AVSUpdater.exe.config +D:\Projects\AVSUpdater\bin\Debug\AVSUpdater.exe +D:\Projects\AVSUpdater\bin\Debug\AVSUpdater.pdb +D:\Projects\AVSUpdater\obj\Debug\AVSUpdater.csproj.AssemblyReference.cache +D:\Projects\AVSUpdater\obj\Debug\AVSUpdater.csproj.CoreCompileInputs.cache +D:\Projects\AVSUpdater\obj\Debug\AVSUpdater.exe +D:\Projects\AVSUpdater\obj\Debug\AVSUpdater.pdb diff --git a/obj/Debug/AVSUpdater.exe b/obj/Debug/AVSUpdater.exe new file mode 100644 index 0000000..e13550c Binary files /dev/null and b/obj/Debug/AVSUpdater.exe differ diff --git a/obj/Debug/AVSUpdater.pdb b/obj/Debug/AVSUpdater.pdb new file mode 100644 index 0000000..24af097 Binary files /dev/null and b/obj/Debug/AVSUpdater.pdb differ diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..f45cca5 Binary files /dev/null and b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ