Initial Commit
commit
6e05dc7dcc
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{F0039594-0D75-47FF-8958-EF3F38494F44}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>AVSUpdater</RootNamespace>
|
||||||
|
<AssemblyName>AVSUpdater</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
|
@ -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
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
|
@ -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 <sourcePath> <destinationPath>");
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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")]
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
Binary file not shown.
|
@ -0,0 +1,4 @@
|
||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
|
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
3929e57a78b45ebc7f038a2982c9c05178085f55
|
|
@ -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
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue