Projektdateien hinzufügen.

This commit is contained in:
573 changed files with 166751 additions and 0 deletions

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" 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>{D8EDB976-2F90-46C1-9642-63BE8C4F5F1F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<StartupObject>AVISOUPDATER.My.MyApplication</StartupObject>
<RootNamespace>AVISOUPDATER</RootNamespace>
<AssemblyName>AVISOUPDATER</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>AVISOUPDATER.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>AVISOUPDATER.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Update.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="UPDATERfrm.Designer.vb">
<DependentUpon>UPDATERfrm.vb</DependentUpon>
</Compile>
<Compile Include="UPDATERfrm.vb">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UPDATERfrm.resx">
<DependentUpon>UPDATERfrm.vb</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\app.manifest" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="AVISOUPDATER_Settings.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Include="AVISOUPDATER_Version.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1 @@
F:\Programme\AVISO\

View File

@@ -0,0 +1 @@
4.0

6
AVISOUPDATER/App.config Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>

View File

@@ -0,0 +1,38 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
'HINWEIS: Diese Datei wird automatisch generiert. Ändern Sie sie nicht direkt. Zum Ändern
' oder bei in dieser Datei auftretenden Buildfehlern wechseln Sie zum Projekt-Designer.
' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
'
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.AVISOUPDATER.UPDATERfrm
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>UPDATERfrm</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' Allgemeine Informationen über eine Assembly werden über die folgenden
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die mit einer Assembly verknüpft sind.
' Die Werte der Assemblyattribute überprüfen
<Assembly: AssemblyTitle("AVISOUPDATER")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("AVISOUPDATER")>
<Assembly: AssemblyCopyright("Copyright © 2015")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
<Assembly: Guid("b8817bdf-faf7-4962-a363-81c9f1c09c35")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
' Hauptversion
' Nebenversion
' Buildnummer
' Revision
'
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("AVISOUPDATER.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "Funktion zum automatischen Speichern von My.Settings"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.AVISOUPDATER.My.MySettings
Get
Return Global.AVISOUPDATER.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC-Manifestoptionen
Wenn Sie die Zugangsebene für das Windows-Benutzerkonto ändern möchten, ersetzen Sie den
requestedExecutionLevel-Knoten durch eines der folgenden Elemente.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Durch Angeben des requestedExecutionLevel-Knotens wird die Datei- und Registrierungsvirtualisierung deaktiviert.
Wenn Sie Datei- und Registrierungsvirtualisierung für Abwärts-
kompatibilität verwenden möchten, löschen Sie den requestedExecutionLevel-Knoten.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Eine Liste aller Windows-Versionen, mit denen die Anwendung kompatibel ist.
Windows wählt automatisch die am stärksten kompatible Umgebung aus.-->
<!-- Wenn die Anwendung mit Windows Vista kompatibel ist, heben Sie die Auskommentierung des folgenden supportedOS-Knotens auf-->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
<!-- Wenn die Anwendung mit Windows 7 kompatibel ist, heben Sie die Kommentierung des folgenden supportedOS-Knotens auf.-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
<!-- Wenn die Anwendung mit Windows 8 kompatibel ist, heben Sie die Auskommentierung des folgenden supportedOS-Knotens auf-->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
<!-- Wenn die Anwendung mit Windows 8.1 kompatibel ist, die Kommentierung des folgenden supportedOS-Knotens aufheben.-->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>-->
</application>
</compatibility>
<!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

142
AVISOUPDATER/UPDATERfrm.Designer.vb generated Normal file
View File

@@ -0,0 +1,142 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class UPDATERfrm
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.ProgressBar = New System.Windows.Forms.ProgressBar()
Me.RichTextBox = New System.Windows.Forms.RichTextBox()
Me.btnClose = New System.Windows.Forms.Button()
Me.m_Label = New System.Windows.Forms.Label()
Me.pnl = New System.Windows.Forms.Panel()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Label1 = New System.Windows.Forms.Label()
Me.pnl.SuspendLayout()
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'ProgressBar
'
Me.ProgressBar.BackColor = System.Drawing.Color.White
Me.ProgressBar.Location = New System.Drawing.Point(13, 204)
Me.ProgressBar.Name = "ProgressBar"
Me.ProgressBar.Size = New System.Drawing.Size(501, 23)
Me.ProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous
Me.ProgressBar.TabIndex = 0
Me.ProgressBar.UseWaitCursor = True
'
'RichTextBox
'
Me.RichTextBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.RichTextBox.Location = New System.Drawing.Point(13, 29)
Me.RichTextBox.Name = "RichTextBox"
Me.RichTextBox.ReadOnly = True
Me.RichTextBox.Size = New System.Drawing.Size(501, 169)
Me.RichTextBox.TabIndex = 1
Me.RichTextBox.Text = ""
'
'btnClose
'
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnClose.BackColor = System.Drawing.Color.Red
Me.btnClose.FlatAppearance.BorderColor = System.Drawing.Color.White
Me.btnClose.FlatAppearance.BorderSize = 0
Me.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnClose.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnClose.ForeColor = System.Drawing.Color.White
Me.btnClose.Location = New System.Drawing.Point(461, 0)
Me.btnClose.Name = "btnClose"
Me.btnClose.RightToLeft = System.Windows.Forms.RightToLeft.Yes
Me.btnClose.Size = New System.Drawing.Size(63, 23)
Me.btnClose.TabIndex = 86
Me.btnClose.Text = "X"
Me.btnClose.UseVisualStyleBackColor = False
'
'm_Label
'
Me.m_Label.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.m_Label.Location = New System.Drawing.Point(13, 229)
Me.m_Label.Name = "m_Label"
Me.m_Label.Size = New System.Drawing.Size(501, 19)
Me.m_Label.TabIndex = 87
Me.m_Label.Text = "-"
Me.m_Label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'pnl
'
Me.pnl.BackColor = System.Drawing.Color.White
Me.pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.pnl.Controls.Add(Me.RichTextBox)
Me.pnl.Controls.Add(Me.m_Label)
Me.pnl.Controls.Add(Me.ProgressBar)
Me.pnl.Controls.Add(Me.btnClose)
Me.pnl.Controls.Add(Me.Panel1)
Me.pnl.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnl.Location = New System.Drawing.Point(0, 0)
Me.pnl.Name = "pnl"
Me.pnl.Size = New System.Drawing.Size(526, 257)
Me.pnl.TabIndex = 88
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Panel1.Controls.Add(Me.Label1)
Me.Panel1.Location = New System.Drawing.Point(-1, -1)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(526, 24)
Me.Panel1.TabIndex = 88
'
'Label1
'
Me.Label1.BackColor = System.Drawing.Color.Transparent
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.White
Me.Label1.Location = New System.Drawing.Point(14, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(251, 24)
Me.Label1.TabIndex = 89
Me.Label1.Text = "AVISO Updater"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'UPDATERfrm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(526, 257)
Me.Controls.Add(Me.pnl)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "UPDATERfrm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "UPDATERfrm"
Me.pnl.ResumeLayout(False)
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents ProgressBar As System.Windows.Forms.ProgressBar
Friend WithEvents RichTextBox As System.Windows.Forms.RichTextBox
Friend WithEvents btnClose As System.Windows.Forms.Button
Friend WithEvents m_Label As System.Windows.Forms.Label
Friend WithEvents pnl As System.Windows.Forms.Panel
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

396
AVISOUPDATER/UPDATERfrm.vb Normal file
View File

@@ -0,0 +1,396 @@
Imports System.IO
Imports System.Security.Cryptography
Public Class UPDATERfrm
Dim CopyIdentical = False ' selbe Dateien nicht kopieren
Private Sub UPDATERfrm_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
Private Sub UPDATERfrm_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Dim trd As New Threading.Thread(AddressOf Main)
trd.IsBackground = True
trd.Start()
End Sub
Dim F As String = "F:\Programme\AVISO\" ' WDH TERM
Dim F_PROD As String = "\\192.168.0.91\f\Programme\AVISO\" ' VERAG
' Dim F As String = "\\192.168.0.90\f\Programme\AVISO\" 'DEVELOPER
Dim F_ATILLA As String = "\\172.16.0.99\Daten\Programme\AVISO\" ' ATILLA
Public Sub Main()
Dim FIRMA = "VERAG"
Dim pfadDatei As String = System.AppDomain.CurrentDomain.BaseDirectory & "\Standort.txt"
FIRMA = "VERAG"
If File.Exists(pfadDatei) Then
Dim fs As New FileStream(pfadDatei, FileMode.Open, FileAccess.Read)
Dim strmReader As New StreamReader(fs)
FIRMA = strmReader.ReadLine
fs.Dispose()
strmReader.Dispose()
End If
If FIRMA = "ATILLA" Then F = F_ATILLA 'Sichere Verbindung
'Falls Settings existiert, wird der Pfad daraus verwendet.
F = System.IO.File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory & "AVISOUPDATER_Settings.txt")
If Not System.IO.Directory.Exists(F) Then
If FIRMA = "ATILLA" Then
F = F_ATILLA 'Sichere Verbindung
Else
F = F_PROD
End If
writeLine(RichTextBox, "F-Pfad nicht gefunden, verbinde mit '" & F & "' ...")
If Not System.IO.Directory.Exists(F) Then
MsgBox("ERROR_UPDATE_05: Es konnte keine Verbindung mit dem F:\ Laufwerk hergestellt werden." & vbNewLine & "Wenn Sie eine Remote-Sitzung verwenden, melden Sie sich mit dieser erneut an.", MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End If
writeLine(RichTextBox, "Verbindung erfolgreich...")
End If
writeLine(RichTextBox, "3 Sekunden warten, um sicherzustellen, dass das Programm beendet wurde...")
Threading.Thread.Sleep(3000) 'Falls Programm gerade am Beenden
writeLine(RichTextBox, "Starte Update...")
' If Not My.Computer.FileSystem.DirectoryExists(F) Then
'MsgBox("ERROR_UPDATE_02: Update-Daten existieren nicht.", MsgBoxStyle.Critical, "ERROR")
' Else
Try
For i As Integer = 1 To 3 Step 1
If Not DoesProcessExists("AVISO") Then
If Not tryDelMain() Then
MsgBox("ERROR_UPDATE_06: AVISO.exe konnte nicht gelöscht werden. Das Programm wird evtl. noch ausgeführt.", MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End If
'---------------------------
delFiles()
FileCopier()
'---------------------------
'Alternative:
'---------------------------
'copyAndDelFilesAndDir()
'---------------------------
If Not System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe") Then
MsgBox("ERROR_UPDATE_03: AVISO.exe konnte nicht gestartet werden.", MsgBoxStyle.Critical, "ERROR")
End If
If Not System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "upd.tmp") Then
System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory & "upd.tmp")
End If
writeLine(RichTextBox, "Erfolgreich abgeschlossen...")
Process.Start("AVISO.exe")
Environment.Exit(0)
End If
Threading.Thread.Sleep(1000)
Next
MsgBox("ERROR_UPDATE_01: Update konnte nicht durchgeführt werden. AVISO.exe nicht beendet?", MsgBoxStyle.Critical, "ERROR")
Catch ex As Exception
MsgBox("ERROR_UPDATE_02: Update-Daten existieren nicht.", MsgBoxStyle.Critical, "ERROR")
End Try
'End If
Environment.Exit(0)
End Sub
Delegate Sub writeLineCallback(rtb As System.Windows.Forms.RichTextBox, text As String)
Private Sub writeLine(rtb As System.Windows.Forms.RichTextBox, text As String)
If Me.InvokeRequired Then
Dim d As New writeLineCallback(AddressOf writeLine)
Me.Invoke(d, New Object() {rtb, text})
Else
rtb.Text &= text & vbNewLine
End If
End Sub
'Sub writeLine(richtextbox,text)
' RichTextBox.Text &= text & vbNewLine
' End Sub
Private Sub FileCopier()
CopyDir(F, AppDomain.CurrentDomain.BaseDirectory)
Exit Sub
For Each file As String In IO.Directory.GetFiles(F) ' Ermittelt alle Dateien des Ordners
IO.File.Copy(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True) ' Kopiert die Dateien Next
Next
For Each file As String In IO.Directory.GetDirectories(F) ' Ermittelt alle Unterordner des Ordners
My.Computer.FileSystem.CopyDirectory(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True)
Next
End Sub
Private Function cut_file(ByVal file As String) As String ' Funktion zum Entfernen der Backslashs / Ordner While file.Contains("\") file = file.Remove(0, 1) End While Return file End Function
While file.Contains("\")
file = file.Remove(0, 1)
End While
Return file
End Function
Private Function tryDelMain() As Boolean
'Dim f As String = "no"
Try
If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe") Then My.Computer.FileSystem.DeleteFile(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe")
Return True
Catch ex As Exception
MsgBox("ERROR_UPDATE_04: Fehler beim Löschen: " & F & vbNewLine & ex.Message, MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
Return False
End Try
End Function
Private Sub copyAndDelFilesAndDir()
'Dim f As String = "no"
Try
With ProgressBar
.Maximum = CInt(GetFolderSize(F) \ 1024)
'eventuell Rückgabe direkt auf 0 abfragen
If .Maximum = 0 Then Exit Sub
.Minimum = 0
.Value = 0
End With
For Each file_source In IO.Directory.GetFiles(F) 'jedes File in F:\
Dim found = False
For Each file As String In IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory) ' Ermittelt alle Dateien des Ordners
If Not cut_file(file).Contains("AVISOUPDATER") And Not cut_file(file).Contains("NOT_DEL_") Then 'alles außer den Updater
If cut_file(file) = cut_file(file_source) Then 'Gleicher Name
If CompareFiles(file, file_source) Then
'selbe Datei --> Nichts
Else
My.Computer.FileSystem.DeleteFile(file)
Copy(New IO.FileInfo((file_source)), AppDomain.CurrentDomain.BaseDirectory) 'Kopieren
End If
found = True
End If
Else
' found = True 'damit nicht mehr kopiert
End If
Next
If Not found Then
Copy(New IO.FileInfo((file_source)), AppDomain.CurrentDomain.BaseDirectory) 'Kopieren
End If
Next
'Lösche wegefallende Dateien:
For Each file As String In IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory) ' Ermittelt alle Dateien des Ordners
Dim found = False
For Each file_source In IO.Directory.GetFiles(F) 'jedes File in F:\
If Not cut_file(file).Contains("AVISOUPDATER") And Not cut_file(file).Contains("NOT_DEL_") Then 'alles außer den Updater
If cut_file(file) = cut_file(file_source) Then 'Gleicher Name
found = True
End If
Else
found = True
End If
Next
If found = False Then
My.Computer.FileSystem.DeleteFile(file)
End If
Next
'Alle Ordner überschreiben:
For Each file As String In IO.Directory.GetDirectories(F) ' Ermittelt alle Unterordner des Ordners
'Copy(New IO.FileInfo(file), DestinationFolder)
My.Computer.FileSystem.CopyDirectory(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True)
Next
ProgressBar.Value = 0
m_Label.Text = "0%"
Catch ex As Exception
MsgBox("ERROR_UPDATE_04: Fehler beim Löschen/Kopieren: " & F & vbNewLine & ex.Message & ex.StackTrace , MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End Try
End Sub
Private Sub delFiles()
'Dim f As String = "no"
Try
For Each file As String In IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory) ' Ermittelt alle Dateien des Ordners
If Not cut_file(file).Contains("AVISOUPDATER") And Not cut_file(file).Contains("NOT_DEL_") Then
' f = file
My.Computer.FileSystem.DeleteFile(file) 'Löscht das AVISO-Programm, außer den Updater
' IO.File.Delete(file)
'IO.Directory.Delete(file)
End If
Next
Catch ex As Exception
MsgBox("ERROR_UPDATE_04: Fehler beim Löschen: " & F & vbNewLine & ex.Message, MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End Try
End Sub
Private Function DoesProcessExists(ByVal PName As String) As Boolean
For Each p As Process In System.Diagnostics.Process.GetProcessesByName(PName)
If p.StartInfo.UserName = Environment.UserName Then
Return True
End If
Next
Return False
End Function
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub CopyDir(ByVal SourceFolder As String, ByVal DestinationFolder As String)
With ProgressBar
.Maximum = CInt(GetFolderSize(SourceFolder) \ 1024)
'eventuell Rückgabe direkt auf 0 abfragen
If .Maximum = 0 Then Exit Sub
.Minimum = 0
.Value = 0
End With
For Each file As String In IO.Directory.GetFiles(SourceFolder)
Copy(New IO.FileInfo(file), DestinationFolder)
Next file
For Each file As String In IO.Directory.GetDirectories(F) ' Ermittelt alle Unterordner des Ordners
'Copy(New IO.FileInfo(file), DestinationFolder)
My.Computer.FileSystem.CopyDirectory(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True)
Next
ProgressBar.Value = 0
m_Label.Text = "0%"
End Sub
Private Function GetFolderSize(ByVal Folder As String) As Long
Dim l As Long
For Each file As String In IO.Directory.GetFiles(Folder)
l += New IO.FileInfo(file).Length
Next file
Return l
End Function
Private Sub Copy(ByVal SourceFile As IO.FileInfo, ByVal TargetDir As String)
Try
' Quelle
Dim fsmsource As IO.FileStream
' Zieldatei
Dim fsmtarget As IO.FileStream
' Größe des bei jedem Durchlauf einzulesenden Datenpaketes
Dim buffersize As Int32 = 1024 * 30 ' (30 KByte)
Dim buffer(buffersize) As Byte
Dim readbyte As Int32
' Quelldatei
' Using nutzen
fsmsource = New IO.FileStream(SourceFile.FullName, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
' Zieldatei
fsmtarget = New IO.FileStream(IO.Path.Combine(TargetDir, SourceFile.Name), IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
' Daten nach und nach einlesen und im Zielstream wieder
' zurückschreiben
While fsmsource.Position < fsmsource.Length
' Quelle einlesen
readbyte = fsmsource.Read(buffer, 0, buffersize)
' In das Ziel schreiben
fsmtarget.Write(buffer, 0, readbyte)
With ProgressBar
Dim vl As Integer = .Value
vl = Math.Min(.Maximum, readbyte \ 1024 + vl)
.Value = vl
m_Label.Text = CStr(CInt(100 * .Value / .Maximum)) + "%"
.Refresh()
m_Label.Refresh()
End With
End While
' Streams schließen
fsmsource.Close()
fsmtarget.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try
End Sub
Public Function CompareFiles(ByVal FileFullPath1 As String, ByVal FileFullPath2 As String) As Boolean
'returns true if two files passed to is are identical, false
'otherwise
'does byte comparison; works for both text and binary files
'Throws exception on errors; you can change to just return
'false if you prefer
Dim objMD5 As New MD5CryptoServiceProvider()
Dim objEncoding As New System.Text.ASCIIEncoding()
Dim aFile1() As Byte, aFile2() As Byte
Dim strContents1, strContents2 As String
Dim objReader As StreamReader
Dim objFS As FileStream
Dim bAns As Boolean
If Not File.Exists(FileFullPath1) Then Return False ' Throw New Exception(FileFullPath1 & " doesn't exist")
If Not File.Exists(FileFullPath2) Then Return False ' Throw New Exception(FileFullPath2 & " doesn't exist")
Try
objFS = New FileStream(FileFullPath1, FileMode.Open)
objReader = New StreamReader(objFS)
aFile1 = objEncoding.GetBytes(objReader.ReadToEnd)
strContents1 = _
objEncoding.GetString(objMD5.ComputeHash(aFile1))
objReader.Close()
objFS.Close()
objFS = New FileStream(FileFullPath2, FileMode.Open)
objReader = New StreamReader(objFS)
aFile2 = objEncoding.GetBytes(objReader.ReadToEnd)
strContents2 = _
objEncoding.GetString(objMD5.ComputeHash(aFile2))
bAns = strContents1 = strContents2
objReader.Close()
objFS.Close()
aFile1 = Nothing
aFile2 = Nothing
Catch ex As Exception
' Throw ex
Return False
End Try
Return bAns
End Function
End Class

102
AVISOUPDATER/Update.vb Normal file
View File

@@ -0,0 +1,102 @@
Module Update2
Dim F As String = "F:\Programme\AVISO\" ' WDH TERM
' Dim F As String = "\\192.168.0.91\f\Programme\AVISO\" ' VERAG
' Dim F As String = "\\192.168.0.90\f\Programme\AVISO\" 'DEVELOPER
' Dim F As String = "\\172.16.0.99\Daten\Programme\AVISO\" ' ATILLA
Sub Main()
'Falls Settings existiert, wird der Pfad daraus verwendet.
F = System.IO.File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory & "AVISOUPDATER_Settings.txt")
If Not System.IO.Directory.Exists(F) Then
MsgBox("ERROR_UPDATE_05: Es konnte keine Verbindung mit dem F:\ Laufwerk hergestellt werden." & vbNewLine & "Wenn Sie eine Remote-Sitzung verwenden, melden Sie sich mit dieser erneut an.", MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End If
System.Console.WriteLine("3 Sekunden warten, um sicherzustellen, dass das Programm beendet wurde...")
Threading.Thread.Sleep(3000) 'Falls Programm gerade am Beenden
System.Console.WriteLine("Starte Update...")
' If Not My.Computer.FileSystem.DirectoryExists(F) Then
'MsgBox("ERROR_UPDATE_02: Update-Daten existieren nicht.", MsgBoxStyle.Critical, "ERROR")
' Else
Try
For i As Integer = 1 To 3 Step 1
If Not DoesProcessExists("AVISO") Then
If Not tryDelMain() Then
MsgBox("ERROR_UPDATE_06: AVISO.exe konnte nicht gelöscht werden. Das Programm wird evtl. noch ausgeführt.", MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End If
delFiles()
FileCopier()
If Not System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe") Then
MsgBox("ERROR_UPDATE_03: AVISO.exe konnte nicht gestartet werden.", MsgBoxStyle.Critical, "ERROR")
End If
If Not System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "upd.tmp") Then
System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory & "upd.tmp")
End If
System.Console.WriteLine("Erfolgreich abgeschlossen...")
Process.Start("AVISO.exe")
Environment.Exit(0)
End If
Threading.Thread.Sleep(1000)
Next
MsgBox("ERROR_UPDATE_01: Update konnte nicht durchgeführt werden. AVISO.exe nicht beendet?", MsgBoxStyle.Critical, "ERROR")
Catch ex As Exception
MsgBox("ERROR_UPDATE_02: Update-Daten existieren nicht.", MsgBoxStyle.Critical, "ERROR")
End Try
'End If
Environment.Exit(0)
End Sub
Private Sub FileCopier()
For Each file As String In IO.Directory.GetFiles(F) ' Ermittelt alle Dateien des Ordners
IO.File.Copy(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True) ' Kopiert die Dateien Next
Next
For Each file As String In IO.Directory.GetDirectories(F) ' Ermittelt alle Unterordner des Ordners
My.Computer.FileSystem.CopyDirectory(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True)
Next
End Sub
Private Function cut_file(ByVal file As String) As String ' Funktion zum Entfernen der Backslashs / Ordner While file.Contains("\") file = file.Remove(0, 1) End While Return file End Function
While file.Contains("\")
file = file.Remove(0, 1)
End While
Return file
End Function
Private Function tryDelMain() As Boolean
'Dim f As String = "no"
Try
If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe") Then My.Computer.FileSystem.DeleteFile(AppDomain.CurrentDomain.BaseDirectory & "AVISO.exe")
Return True
Catch ex As Exception
MsgBox("ERROR_UPDATE_04: Fehler beim Löschen: " & F & vbNewLine & ex.Message, MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
Return False
End Try
End Function
Private Sub delFiles()
'Dim f As String = "no"
Try
For Each file As String In IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory) ' Ermittelt alle Dateien des Ordners
If Not cut_file(file).Contains("AVISOUPDATER") And Not cut_file(file).Contains("NOT_DEL_") Then
' f = file
My.Computer.FileSystem.DeleteFile(file) 'Löscht das AVISO-Programm, außer den Updater
' IO.File.Delete(file)
'IO.Directory.Delete(file)
End If
Next
Catch ex As Exception
MsgBox("ERROR_UPDATE_04: Fehler beim Löschen: " & f & vbNewLine & ex.Message, MsgBoxStyle.Critical, "ERROR")
Environment.Exit(0)
End Try
End Sub
Private Function DoesProcessExists(ByVal PName As String) As Boolean
For Each p As Process In System.Diagnostics.Process.GetProcessesByName(PName)
If p.StartInfo.UserName = Environment.UserName Then
Return True
End If
Next
Return False
End Function
End Module