mirror of
https://github.com/kimmknight/remoteapptool.git
synced 2024-11-21 13:07:48 +00:00
Initial commit
This commit is contained in:
commit
f1f7664b91
344
.gitignore
vendored
Normal file
344
.gitignore
vendored
Normal file
@ -0,0 +1,344 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- Backup*.rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
2
RDP2MSI/.gitignore
vendored
Normal file
2
RDP2MSI/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
6
RDP2MSI/App.config
Normal file
6
RDP2MSI/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||
</startup>
|
||||
</configuration>
|
13
RDP2MSI/My Project/Application.Designer.vb
generated
Normal file
13
RDP2MSI/My Project/Application.Designer.vb
generated
Normal file
@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
10
RDP2MSI/My Project/Application.myapp
Normal file
10
RDP2MSI/My Project/Application.myapp
Normal 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>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>2</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
35
RDP2MSI/My Project/AssemblyInfo.vb
Normal file
35
RDP2MSI/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("RDP2MSI")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("RDP2MSI")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("7fb6fac3-8581-47b9-89db-767a6d87b576")>
|
||||
|
||||
' 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")>
|
63
RDP2MSI/My Project/Resources.Designer.vb
generated
Normal file
63
RDP2MSI/My Project/Resources.Designer.vb
generated
Normal file
@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'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.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</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>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</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("RDP2MSI.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</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
|
117
RDP2MSI/My Project/Resources.resx
Normal file
117
RDP2MSI/My Project/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
RDP2MSI/My Project/Settings.Designer.vb
generated
Normal file
73
RDP2MSI/My Project/Settings.Designer.vb
generated
Normal file
@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </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", "11.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 "My.Settings Auto-Save Functionality"
|
||||
#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.RDP2MSI.My.MySettings
|
||||
Get
|
||||
Return Global.RDP2MSI.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
7
RDP2MSI/My Project/Settings.settings
Normal file
7
RDP2MSI/My Project/Settings.settings
Normal 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>
|
55
RDP2MSI/My Project/app.manifest
Normal file
55
RDP2MSI/My Project/app.manifest
Normal file
@ -0,0 +1,55 @@
|
||||
<?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 Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with.
|
||||
Windows will automatically select the most compatible environment.-->
|
||||
|
||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
||||
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
|
||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
||||
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
|
||||
</asmv1:assembly>
|
132
RDP2MSI/RDP2MSI.vb
Normal file
132
RDP2MSI/RDP2MSI.vb
Normal file
@ -0,0 +1,132 @@
|
||||
Module RDP2MSI
|
||||
|
||||
Sub Main()
|
||||
Dim cmdRdpPath = ""
|
||||
Dim cmdSwitches = ""
|
||||
|
||||
LogText("RDP2MSI" & vbCrLf)
|
||||
If My.Application.CommandLineArgs.Count = 0 Then
|
||||
ShowUsage()
|
||||
End
|
||||
ElseIf My.Application.CommandLineArgs.Count = 1 Then
|
||||
cmdRdpPath = My.Application.CommandLineArgs(0)
|
||||
ElseIf My.Application.CommandLineArgs.Count = 2 Then
|
||||
If My.Application.CommandLineArgs(0).StartsWith("/") Then
|
||||
cmdSwitches = My.Application.CommandLineArgs(0)
|
||||
cmdRdpPath = My.Application.CommandLineArgs(1)
|
||||
Else
|
||||
cmdSwitches = My.Application.CommandLineArgs(1)
|
||||
cmdRdpPath = My.Application.CommandLineArgs(0)
|
||||
End If
|
||||
ElseIf My.Application.CommandLineArgs.Count > 2 Then
|
||||
LogText("Error: Too many parameters provided.", True)
|
||||
End If
|
||||
|
||||
Dim relCmdRdpPath = System.IO.Directory.GetCurrentDirectory & "\" & cmdRdpPath
|
||||
If Not cmdRdpPath.Contains(":") Then cmdRdpPath = relCmdRdpPath
|
||||
|
||||
If Not My.Computer.FileSystem.FileExists(cmdRdpPath) Then LogText("Error: Unable to find RDP file: " & cmdRdpPath, True)
|
||||
|
||||
If Not cmdSwitches.ToUpper.Contains("D") Then
|
||||
If Not cmdSwitches.ToUpper.Contains("S") Then
|
||||
cmdSwitches += "DS"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
PrepareRDP2MSI(cmdRdpPath, cmdSwitches.ToUpper)
|
||||
End Sub
|
||||
|
||||
Sub ShowUsage()
|
||||
LogText("Usage: rdp2msi.exe [/DSNATU] rdpfile.rdp")
|
||||
LogText("")
|
||||
LogText("Switches:")
|
||||
LogText("")
|
||||
LogText(" /D MSI will deploy desktop shortcut.")
|
||||
LogText(" /S MSI will deploy shortcut in Start Menu > Programs > (AppName)")
|
||||
LogText(" /N Requires /S. MSI will not create subfolder in Start Menu > Programs.")
|
||||
LogText(" /A Generate upgrade code based on app name. By default, it is random.")
|
||||
LogText(" /T Do not include the (remote) tag on deployed shortcuts.")
|
||||
LogText(" /U MSI installs per-user. By default, MSI will install per-machine.")
|
||||
LogText("")
|
||||
LogText("If no switches are specified, /DS is implied.")
|
||||
LogText("")
|
||||
LogText("If an ICO file with the same name as the RDP file exists, it will be used.")
|
||||
LogText("")
|
||||
End Sub
|
||||
|
||||
Private Sub PrepareRDP2MSI(rdpFilePath As String, Optional cmdSwitches As String = "DS")
|
||||
If Not My.Computer.FileSystem.FileExists(rdpFilePath) Then LogText("Error: Unable to find RDP file: " & rdpFilePath, True)
|
||||
If Not rdpFilePath.ToLower.EndsWith(".rdp") Then LogText("Error: Input file must be an RDP file.", True)
|
||||
|
||||
Dim RDP As New RDP2MSIlib.RDP
|
||||
RDP.rdpPath = rdpFilePath
|
||||
|
||||
If Not RDP.WixInstalled Then LogText("Error: WiX Toolset not found. If you have just installed it, please reboot and try again.", True)
|
||||
|
||||
LogText("RDP file: " & rdpFilePath)
|
||||
Dim RemoteAppFullName = RDP.ReadRDPProperty("remoteapplicationname")
|
||||
Dim RDPFullAddress = RDP.ReadRDPProperty("full address")
|
||||
If RDPFullAddress = "" Then LogText("Error: RDP file does not contain a Remote Desktop Server address.", True)
|
||||
If RemoteAppFullName = "" Then
|
||||
'Full desktop connection
|
||||
LogText("RDP file type: Full desktop session")
|
||||
Else
|
||||
'RemoteApp connection
|
||||
LogText("RDP file type: RemoteApp")
|
||||
LogText("App full name: " & RemoteAppFullName)
|
||||
End If
|
||||
LogText("Command line switches: " & cmdSwitches.ToUpper)
|
||||
|
||||
|
||||
RDP.ShortcutInStart = cmdSwitches.Contains("S")
|
||||
RDP.ShortcutOnDesktop = cmdSwitches.Contains("D")
|
||||
RDP.ShortcutSubfolderInStart = Not cmdSwitches.Contains("N")
|
||||
Dim ShortcutLocations As New List(Of String)
|
||||
If RDP.ShortcutInStart Then
|
||||
If RDP.ShortcutSubfolderInStart Then
|
||||
ShortcutLocations.Add("Start menu (subfolder)")
|
||||
Else
|
||||
ShortcutLocations.Add("Start menu (top level)")
|
||||
End If
|
||||
End If
|
||||
If RDP.ShortcutOnDesktop Then ShortcutLocations.Add("Desktop")
|
||||
|
||||
LogText("Shortcut locations: " & String.Join(", ", ShortcutLocations))
|
||||
|
||||
RDP.ProductUpgradeRandom = Not cmdSwitches.Contains("A")
|
||||
LogText("MSI upgrade code: {" & RDP.ProductUpgradeCode & "}")
|
||||
If cmdSwitches.Contains("T") Then RDP.ProductRemoteTag = ""
|
||||
|
||||
RDP.PerUser = cmdSwitches.Contains("U")
|
||||
If RDP.PerUser Then
|
||||
LogText("MSI install context: User")
|
||||
Else
|
||||
LogText("MSI install context: Machine")
|
||||
End If
|
||||
|
||||
Dim ShortcutTag = "NONE"
|
||||
If Not RDP.ProductRemoteTag = "" Then ShortcutTag = "(" & RDP.ProductRemoteTag & ")"
|
||||
LogText("Shortcut tag: " & ShortcutTag)
|
||||
|
||||
LogText("")
|
||||
LogText("Generating MSI...")
|
||||
|
||||
RDP.CreateMSI()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub LogText(TheText As String, Optional DoExit As Boolean = False)
|
||||
Console.WriteLine(TheText)
|
||||
If DoExit = True Then
|
||||
'CleanupTempFiles()
|
||||
End
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
|
125
RDP2MSI/RDP2MSI.vbproj
Normal file
125
RDP2MSI/RDP2MSI.vbproj
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{1001A958-40DB-4444-9CD7-09D1188072D1}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<StartupObject>Sub Main</StartupObject>
|
||||
<RootNamespace>RDP2MSI</RootNamespace>
|
||||
<AssemblyName>RDP2MSI</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Console</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<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>RDP2MSI.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</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>RDP2MSI.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</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.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="RDP2MSI.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</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>
|
||||
<ProjectReference Include="..\RDP2MSILib\RDP2MSILib.vbproj">
|
||||
<Project>{e1cb5f9c-230f-4967-8f19-335f8e4a4906}</Project>
|
||||
<Name>RDP2MSILib</Name>
|
||||
</ProjectReference>
|
||||
</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>
|
2
RDP2MSILib/.gitignore
vendored
Normal file
2
RDP2MSILib/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
13
RDP2MSILib/My Project/Application.Designer.vb
generated
Normal file
13
RDP2MSILib/My Project/Application.Designer.vb
generated
Normal file
@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
10
RDP2MSILib/My Project/Application.myapp
Normal file
10
RDP2MSILib/My Project/Application.myapp
Normal 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>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
35
RDP2MSILib/My Project/AssemblyInfo.vb
Normal file
35
RDP2MSILib/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("RDP2MSIlib")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("RDP2MSIlib")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("af9953ef-de9f-4f06-a876-91395e89bfd1")>
|
||||
|
||||
' 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")>
|
63
RDP2MSILib/My Project/Resources.Designer.vb
generated
Normal file
63
RDP2MSILib/My Project/Resources.Designer.vb
generated
Normal file
@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'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.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</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>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</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("RDP2MSIlib.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</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
|
117
RDP2MSILib/My Project/Resources.resx
Normal file
117
RDP2MSILib/My Project/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
RDP2MSILib/My Project/Settings.Designer.vb
generated
Normal file
73
RDP2MSILib/My Project/Settings.Designer.vb
generated
Normal file
@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </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", "11.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 "My.Settings Auto-Save Functionality"
|
||||
#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.RDP2MSIlib.My.MySettings
|
||||
Get
|
||||
Return Global.RDP2MSIlib.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
7
RDP2MSILib/My Project/Settings.settings
Normal file
7
RDP2MSILib/My Project/Settings.settings
Normal 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>
|
364
RDP2MSILib/RDP2MSILib.vb
Normal file
364
RDP2MSILib/RDP2MSILib.vb
Normal file
@ -0,0 +1,364 @@
|
||||
Imports System.Reflection.Assembly
|
||||
|
||||
Public Class RDP
|
||||
|
||||
Private rdpFilePath As String
|
||||
Public Property rdpPath As String
|
||||
Get
|
||||
Return rdpFilePath
|
||||
End Get
|
||||
Set(value As String)
|
||||
rdpFilePath = value
|
||||
ReadRDPfile()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private ProductName As String ' Full remoteapp name as read from RDP file
|
||||
Public FlatFileTypes As String = ""
|
||||
Public PerUser As Boolean = False
|
||||
Private ProductBaseFileName As String ' RDP filename minus the file extension
|
||||
Public ProductPublisher As String
|
||||
Public ProductVersion As String = "1.0.0.0"
|
||||
Public ProductUpgradeRandom As Boolean = False
|
||||
Public ProductRemoteTag As String = "remote"
|
||||
Public ShortcutInStart As Boolean = True
|
||||
Public ShortcutSubfolderInStart As Boolean = True
|
||||
Public ShortcutOnDesktop As Boolean = True
|
||||
|
||||
|
||||
Private rdpFileContents As String
|
||||
Private hasIcon As Boolean
|
||||
Private rdpInTemp As Boolean
|
||||
|
||||
Public Sub CreateMSI(Optional DestinationPath As String = "")
|
||||
|
||||
'Check for wix, exit if not available
|
||||
If Not WixInstalled() Then Exit Sub
|
||||
|
||||
'Get RDP file parent folder path
|
||||
Dim rdpParentFolder = My.Computer.FileSystem.GetParentPath(rdpFilePath)
|
||||
|
||||
'Get the RDP filename and filename minus extension
|
||||
Dim rdpFileName = My.Computer.FileSystem.GetFileInfo(rdpFilePath).Name
|
||||
ProductBaseFileName = System.IO.Path.GetFileNameWithoutExtension(rdpFileName)
|
||||
|
||||
'If DestinationPath not defined then set the path to the same as the rdp file
|
||||
If DestinationPath = "" Then DestinationPath = rdpParentFolder & "\" & ProductBaseFileName & ".msi"
|
||||
|
||||
'Set iconpath (whether it exists or not)
|
||||
Dim IconFilePath = rdpParentFolder & "\" & ProductBaseFileName & ".ico"
|
||||
|
||||
'Check for icon, set "HasIcon" to true if found
|
||||
hasIcon = My.Computer.FileSystem.FileExists(IconFilePath)
|
||||
|
||||
'Get RemoteApp names (short and full) from RDP file contents
|
||||
Dim RemoteAppFullName = ReadRDPProperty("remoteapplicationname")
|
||||
Dim RemoteAppShortName = ReadRDPProperty("remoteapplicationprogram")
|
||||
|
||||
'Define wix temp file paths
|
||||
Dim TempPath = Environment.GetEnvironmentVariable("TEMP")
|
||||
Dim wxsPath = TempPath & "\" & ProductBaseFileName & ".wxs"
|
||||
Dim wixobjPath = TempPath & "\" & ProductBaseFileName & ".wixobj"
|
||||
Dim wixpdbPath = TempPath & "\" & ProductBaseFileName & ".wixpdb"
|
||||
Dim msiPath = TempPath & "\" & ProductBaseFileName & ".msi"
|
||||
|
||||
Dim rdpTempPath = TempPath & "\" & ProductBaseFileName & ".rdp"
|
||||
Dim icoTempPath = TempPath & "\" & ProductBaseFileName & ".ico"
|
||||
|
||||
'Define temp files to delete
|
||||
Dim FilesToDelete As List(Of String) = New List(Of String)(New String() {wxsPath, wixobjPath, wixpdbPath})
|
||||
|
||||
'Check if rdp file is already in TEMP folder
|
||||
If rdpParentFolder = TempPath Then rdpInTemp = True
|
||||
|
||||
'if RDP file not in temp, copy to temp
|
||||
If Not rdpInTemp Then
|
||||
My.Computer.FileSystem.CopyFile(rdpFilePath, rdpTempPath, True)
|
||||
FilesToDelete.Add(rdpTempPath)
|
||||
If hasIcon Then
|
||||
My.Computer.FileSystem.CopyFile(IconFilePath, icoTempPath, True)
|
||||
FilesToDelete.Add(icoTempPath)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'Save WXS file containing generated WXS string
|
||||
My.Computer.FileSystem.WriteAllText(wxsPath, GenerateWXSString(), False)
|
||||
|
||||
Dim CandlePath = WixPath() & "\candle.exe "
|
||||
Dim LightPath = WixPath() & "\light.exe "
|
||||
|
||||
'Run Candle.exe and Light.exe to process wxs file
|
||||
Dim CandleExitCode = RunWait(CandlePath, "-out """ & wixobjPath & """ """ & wxsPath & """")
|
||||
'If Not CandleExitCode = 0 Then Exit Sub
|
||||
Dim LightExitCode = RunWait(LightPath, "-out """ & msiPath & """ """ & wixobjPath & """")
|
||||
'If Not LightExitCode = 0 Then Exit Sub
|
||||
|
||||
'Move MSI file to destination and delete temp files
|
||||
My.Computer.FileSystem.MoveFile(msiPath, DestinationPath, True)
|
||||
DeleteFiles(FilesToDelete)
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function WixInstalled() As Boolean
|
||||
If WixPath() = "" Then
|
||||
WixInstalled = False
|
||||
Else
|
||||
WixInstalled = True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function WixPath()
|
||||
Dim searchExe = "\candle.exe"
|
||||
WixPath = ""
|
||||
If Not Environment.GetEnvironmentVariable("WIX") = "" Then
|
||||
WixPath = Environment.GetEnvironmentVariable("WIX") & "bin"
|
||||
ElseIf My.Computer.FileSystem.DirectoryExists(My.Application.Info.DirectoryPath & "\wix\" & searchExe) Then
|
||||
WixPath = My.Application.Info.DirectoryPath & "\wix"
|
||||
ElseIf My.Computer.FileSystem.DirectoryExists(My.Application.Info.DirectoryPath & "\wix\bin\" & searchExe) Then
|
||||
WixPath = My.Application.Info.DirectoryPath & "\wix\bin"
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub DeleteFiles(FilesArray As List(Of String))
|
||||
For Each dFile In FilesArray
|
||||
If My.Computer.FileSystem.FileExists(dFile) Then My.Computer.FileSystem.DeleteFile(dFile)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub ReadRDPfile()
|
||||
'Check if RDP file exists
|
||||
If Not My.Computer.FileSystem.FileExists(rdpFilePath) Then Exit Sub
|
||||
|
||||
'Check that RDP file is an RDP file
|
||||
If Not rdpFilePath.ToLower.EndsWith(".rdp") Then Exit Sub
|
||||
|
||||
'Read RDP file into variable
|
||||
rdpFileContents = My.Computer.FileSystem.ReadAllText(rdpFilePath)
|
||||
|
||||
'Check RDP file contains a remoteapplicationname value
|
||||
'If ReadRDPProperty("remoteapplicationname") = "" Then Exit Sub
|
||||
|
||||
'Check if RDP file contains a server address
|
||||
If ReadRDPProperty("full address") = "" Then Exit Sub
|
||||
|
||||
'Read variables
|
||||
ProductName = ReadRDPProperty("remoteapplicationname")
|
||||
|
||||
If ProductName = "" Then
|
||||
ProductName = System.IO.Path.GetFileNameWithoutExtension(rdpFilePath)
|
||||
End If
|
||||
|
||||
If ProductPublisher Is Nothing Then ProductPublisher = ProductName
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ProductUpgradeCode()
|
||||
' random or generated - maybe allow caller to define?
|
||||
Dim UpgradeCode As String
|
||||
|
||||
'Check if ProductUpgradeRandom is true, create a random productcode if so, otherwise generate it from the productname
|
||||
If Not ProductUpgradeRandom Then
|
||||
UpgradeCode = GenerateGUIDfromString(ProductName)
|
||||
Else
|
||||
Dim Rnd = New Random()
|
||||
UpgradeCode = GenerateGUIDfromString(Rnd.Next)
|
||||
End If
|
||||
Return UpgradeCode
|
||||
End Function
|
||||
|
||||
Public Function MakeProgID(AppName) As String
|
||||
Dim rx As New System.Text.RegularExpressions.Regex("[^a-zA-Z0-9_]")
|
||||
MakeProgID = rx.Replace(AppName, "_")
|
||||
End Function
|
||||
|
||||
|
||||
Private Function GenerateWXSString()
|
||||
Dim Rnd = New Random()
|
||||
|
||||
If ProductPublisher = "" Then ProductPublisher = ProductName
|
||||
|
||||
Dim RegRoot = "HKLM"
|
||||
If PerUser = True Then RegRoot = "HKCU"
|
||||
|
||||
|
||||
Dim AppFilesGuid = GenerateGUIDfromString("AppFiles" & ProductUpgradeCode())
|
||||
Dim AppStartShortcutsGuid = GenerateGUIDfromString("AppStartShortcuts" & ProductUpgradeCode())
|
||||
Dim AppDeskShortcutsGuid = GenerateGUIDfromString("AppDeskShortcuts" & ProductUpgradeCode())
|
||||
|
||||
Dim ProgID As String = MakeProgID(ProductBaseFileName)
|
||||
|
||||
Dim wxsString = "<?xml version=""1.0""?>" & vbCrLf
|
||||
wxsString += "<?define ProductVersion = """ & ProductVersion & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductUpgradeCode = """ & ProductUpgradeCode() & """?>" & vbCrLf
|
||||
wxsString += "<?define AppFilesGuid = """ & AppFilesGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define AppStartShortcutsGuid = """ & AppStartShortcutsGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define AppDeskShortcutsGuid = """ & AppDeskShortcutsGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductName = """ & ProductName & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductPublisher = """ & ProductPublisher & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductBaseFileName = """ & ProductBaseFileName & """?>" & vbCrLf
|
||||
wxsString += "<?define RegRoot = """ & RegRoot & """?>" & vbCrLf
|
||||
If Not FlatFileTypes = "" Then wxsString += "<?define ProductProgID = """ & ProgID & """?>" & vbCrLf
|
||||
If Not ProductRemoteTag = "" Then ProductRemoteTag = " (" & ProductRemoteTag & ")"
|
||||
wxsString += "<?define ProductRemoteTag = """ & ProductRemoteTag & """?>" & vbCrLf
|
||||
wxsString += "<Wix xmlns=""http://schemas.microsoft.com/wix/2006/wi"">" & vbCrLf
|
||||
|
||||
wxsString += " <Product Id=""*"" UpgradeCode=""$(var.ProductUpgradeCode)"" " & vbCrLf
|
||||
wxsString += " Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Version=""$(var.ProductVersion)"" Manufacturer=""$(var.ProductPublisher)"" Language=""1033"">" & vbCrLf
|
||||
wxsString += " <Package InstallerVersion=""200"" Compressed=""yes"" Comments=""Windows Installer Package"""
|
||||
If Not PerUser Then
|
||||
wxsString += " InstallScope=""perMachine"""
|
||||
Else
|
||||
wxsString += " InstallPrivileges=""limited"""
|
||||
End If
|
||||
|
||||
wxsString += "/>" & vbCrLf
|
||||
wxsString += " <Media Id=""1"" Cabinet=""rdp2msi.cab"" EmbedCab=""yes""/>" & vbCrLf
|
||||
If Not PerUser Then wxsString += " <Property Id=""AllUSERS"" Value=""1""/>" & vbCrLf
|
||||
wxsString += " <Upgrade Id=""$(var.ProductUpgradeCode)"">" & vbCrLf
|
||||
wxsString += " <UpgradeVersion Minimum=""$(var.ProductVersion)"" OnlyDetect=""yes"" Property=""NEWERVERSIONDETECTED""/>" & vbCrLf
|
||||
wxsString += " <UpgradeVersion Minimum=""0.0.0"" Maximum=""$(var.ProductVersion)"" IncludeMinimum=""yes"" IncludeMaximum=""no"" " & vbCrLf
|
||||
wxsString += " Property=""OLDERVERSIONBEINGUPGRADED""/> " & vbCrLf
|
||||
wxsString += " </Upgrade>" & vbCrLf
|
||||
wxsString += " <Condition Message=""A newer version of this software is already installed."">NOT NEWERVERSIONDETECTED</Condition>" & vbCrLf
|
||||
wxsString += " <Property Id=""MstscProperty"" Value=""mstsc.exe""/>" & vbCrLf
|
||||
wxsString += " <Directory Id=""TARGETDIR"" Name=""SourceDir"">" & vbCrLf
|
||||
If Not PerUser Then
|
||||
wxsString += " <Directory Id=""ProgramFilesFolder"">" & vbCrLf
|
||||
Else
|
||||
wxsString += " <Directory Id=""LocalAppDataFolder"">" & vbCrLf
|
||||
End If
|
||||
wxsString += " <Directory Id=""INSTALLDIR"" Name=""RemotePackages"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationFiles"" Guid=""$(var.AppFilesGuid)"">" & vbCrLf
|
||||
wxsString += " <File Id=""rdpFile1"" Source=""$(var.ProductBaseFileName).rdp""/>" & vbCrLf
|
||||
If hasIcon Then wxsString += " <File Id=""rdpIcon1"" Source=""$(var.ProductBaseFileName).ico""/>" & vbCrLf
|
||||
'# Begin filetype association code
|
||||
If Not FlatFileTypes = "" Then
|
||||
For Each FileType In FlatFileTypes.Replace(".", "").Split(",")
|
||||
wxsString += " <File Id=""$(var.ProductProgID)." & FileType & ".ico"" Source=""$(var.ProductBaseFileName)." & FileType & ".ico"" />" & vbCrLf
|
||||
wxsString += " <ProgId Id=""remote.$(var.ProductProgID)." & FileType & "file"" Description=""$(var.ProductName) " & FileType & " file"" Icon=""$(var.ProductProgID)." & FileType & ".ico"">" & vbCrLf
|
||||
wxsString += " <Extension Id=""" & FileType & """ ContentType=""application/" & FileType & """>" & vbCrLf
|
||||
wxsString += " <Verb Id=""open"" Command=""Open"" TargetProperty='MstscProperty' Argument='/REMOTEFILE:""%1"" ""[INSTALLDIR]$(var.ProductBaseFileName).rdp""' />" & vbCrLf
|
||||
wxsString += " </Extension>" & vbCrLf
|
||||
wxsString += " </ProgId>" & vbCrLf
|
||||
'wxsString += " <RegistryValue Root=""$(var.RegRoot)"" Key=""SOFTWARE\Classes\remote.$(var.ProductProgID)." & FileType & "file"" Name=""FriendlyTypeName"" Value=""$(var.ProductName) " & FileType & " file"" Type=""string"" />"
|
||||
Next
|
||||
End If
|
||||
'# End FTA code
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
|
||||
If ShortcutInStart Then
|
||||
wxsString += " <Directory Id=""ProgramMenuFolder"">" & vbCrLf
|
||||
If ShortcutSubfolderInStart Then wxsString += " <Directory Id=""ProgramMenuSubfolder"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationStartShortcuts"" Guid=""$(var.AppStartShortcutsGuid)"">" & vbCrLf
|
||||
wxsString += " <Shortcut Id=""rdpStartShortcut1"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Description=""$(var.ProductName)$(var.ProductRemoteTag)"" " & vbCrLf
|
||||
wxsString += " Target=""[INSTALLDIR]$(var.ProductBaseFileName).rdp"" WorkingDirectory=""INSTALLDIR"""
|
||||
|
||||
If hasIcon Then
|
||||
wxsString += " Icon=""rdpStartIcon.rdp"" IconIndex=""0"">" & vbCrLf
|
||||
wxsString += " <Icon Id=""rdpStartIcon.rdp"" SourceFile=""$(var.ProductBaseFileName).ico"" />" & vbCrLf
|
||||
wxsString += " </Shortcut>" & vbCrLf
|
||||
Else
|
||||
wxsString += "/>" & vbCrLf
|
||||
End If
|
||||
|
||||
wxsString += " <RegistryValue Root=""$(var.RegRoot)"" Key=""Software\RDP2MSI\$(var.ProductName)"" " & vbCrLf
|
||||
wxsString += " Name=""installed"" Type=""integer"" Value=""1"" KeyPath=""yes""/>" & vbCrLf
|
||||
wxsString += " <RemoveFolder Id=""ProgramMenuSubfolder"" On=""uninstall""/>" & vbCrLf
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
If ShortcutSubfolderInStart Then wxsString += " </Directory>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
End If
|
||||
|
||||
If ShortcutOnDesktop Then
|
||||
wxsString += " <Directory Id=""DesktopFolder"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationDesktopShortcuts"" Guid=""$(var.AppDeskShortcutsGuid)"">" & vbCrLf
|
||||
wxsString += " <Shortcut Id=""rdpDesktopShortcut1"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Description=""$(var.ProductName)$(var.ProductRemoteTag)"" " & vbCrLf
|
||||
wxsString += " Target=""[INSTALLDIR]$(var.ProductBaseFileName).rdp"" WorkingDirectory=""INSTALLDIR"""
|
||||
|
||||
If hasIcon Then
|
||||
wxsString += " Icon=""rdpDeskIcon.rdp"" IconIndex=""0"">" & vbCrLf
|
||||
wxsString += " <Icon Id=""rdpDeskIcon.rdp"" SourceFile=""$(var.ProductBaseFileName).ico"" />" & vbCrLf
|
||||
wxsString += " </Shortcut>" & vbCrLf
|
||||
Else
|
||||
wxsString += "/>" & vbCrLf
|
||||
End If
|
||||
|
||||
|
||||
wxsString += " <RegistryValue Root=""$(var.RegRoot)"" Key=""Software\RDP2MSI\$(var.ProductName)"" " & vbCrLf
|
||||
wxsString += " Name=""installed"" Type=""integer"" Value=""1"" KeyPath=""yes""/>" & vbCrLf
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
End If
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
|
||||
wxsString += " <InstallExecuteSequence>" & vbCrLf
|
||||
wxsString += " <RemoveExistingProducts After=""InstallValidate""/>" & vbCrLf
|
||||
wxsString += " </InstallExecuteSequence>" & vbCrLf
|
||||
wxsString += " "
|
||||
wxsString += " <Feature Id=""DefaultFeature"" Level=""1"">" & vbCrLf
|
||||
wxsString += " <ComponentRef Id=""ApplicationFiles""/>" & vbCrLf
|
||||
If ShortcutInStart Then wxsString += " <ComponentRef Id=""ApplicationStartShortcuts""/>" & vbCrLf
|
||||
If ShortcutOnDesktop Then wxsString += " <ComponentRef Id=""ApplicationDesktopShortcuts""/>" & vbCrLf
|
||||
wxsString += " </Feature>" & vbCrLf
|
||||
If hasIcon Then
|
||||
wxsString += "<Icon Id=""rdpARPIcon.rdp"" SourceFile=""$(var.ProductBaseFileName).ico"" />" & vbCrLf
|
||||
wxsString += "<Property Id=""ARPPRODUCTICON"" Value=""rdpARPIcon.rdp"" />" & vbCrLf
|
||||
End If
|
||||
wxsString += " </Product>" & vbCrLf
|
||||
wxsString += "</Wix>" & vbCrLf
|
||||
|
||||
Return wxsString
|
||||
|
||||
End Function
|
||||
|
||||
Public Function ReadRDPProperty(rdpProperty As String) As String
|
||||
Dim rdpFileLines = Split(rdpFileContents, vbLf)
|
||||
Dim rdpValue = ""
|
||||
For Each rdpLine In rdpFileLines
|
||||
rdpLine = Replace(rdpLine, vbCr, "")
|
||||
rdpLine = Replace(rdpLine, "|", "")
|
||||
Dim rdpLineSplit = Split(rdpLine, ":", 3)
|
||||
If rdpLineSplit(0) = rdpProperty Then
|
||||
rdpValue = rdpLineSplit(2)
|
||||
End If
|
||||
Next
|
||||
Return rdpValue
|
||||
End Function
|
||||
|
||||
Private Function GenerateGUIDfromString(TheString As String)
|
||||
Dim TheHash = getMD5Hash(TheString)
|
||||
Dim MyGuid As Guid = New Guid(TheHash)
|
||||
Return MyGuid.ToString
|
||||
End Function
|
||||
|
||||
Private Function getMD5Hash(ByVal strToHash As String) As String
|
||||
Dim md5Obj As New System.Security.Cryptography.MD5CryptoServiceProvider()
|
||||
Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
|
||||
|
||||
bytesToHash = md5Obj.ComputeHash(bytesToHash)
|
||||
|
||||
Dim strResult As String = ""
|
||||
Dim b As Byte
|
||||
|
||||
For Each b In bytesToHash
|
||||
strResult += b.ToString("x2")
|
||||
Next
|
||||
|
||||
Return strResult
|
||||
End Function
|
||||
|
||||
Private Function RunWait(App As String, Parameters As String) As Integer
|
||||
Dim proc As New Process
|
||||
proc.StartInfo.CreateNoWindow = True
|
||||
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
|
||||
proc.StartInfo.FileName = App
|
||||
proc.StartInfo.Arguments = Parameters
|
||||
proc.Start()
|
||||
proc.WaitForExit()
|
||||
Return proc.ExitCode
|
||||
End Function
|
||||
|
||||
End Class
|
110
RDP2MSILib/RDP2MSILib.vbproj
Normal file
110
RDP2MSILib/RDP2MSILib.vbproj
Normal file
@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{E1CB5F9C-230F-4967-8F19-335F8E4A4906}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>RDP2MSIlib</RootNamespace>
|
||||
<AssemblyName>RDP2MSIlib</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>RDP2MSIlib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>RDP2MSIlib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<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="RDP2MSILib.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<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>
|
||||
</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>
|
2
RDPFileLib/.gitignore
vendored
Normal file
2
RDPFileLib/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
13
RDPFileLib/My Project/Application.Designer.vb
generated
Normal file
13
RDPFileLib/My Project/Application.Designer.vb
generated
Normal file
@ -0,0 +1,13 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
10
RDPFileLib/My Project/Application.myapp
Normal file
10
RDPFileLib/My Project/Application.myapp
Normal 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>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
35
RDPFileLib/My Project/AssemblyInfo.vb
Normal file
35
RDPFileLib/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("RDPFileLib")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("RDPFileLib")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("7331d9d3-2740-46b3-b668-759fe76774f3")>
|
||||
|
||||
' 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")>
|
63
RDPFileLib/My Project/Resources.Designer.vb
generated
Normal file
63
RDPFileLib/My Project/Resources.Designer.vb
generated
Normal file
@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'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.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</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>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</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("RDPFileLib.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</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
|
117
RDPFileLib/My Project/Resources.resx
Normal file
117
RDPFileLib/My Project/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
RDPFileLib/My Project/Settings.Designer.vb
generated
Normal file
73
RDPFileLib/My Project/Settings.Designer.vb
generated
Normal file
@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </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", "11.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 "My.Settings Auto-Save Functionality"
|
||||
#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.RDPFileLib.My.MySettings
|
||||
Get
|
||||
Return Global.RDPFileLib.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
5
RDPFileLib/My Project/Settings.settings
Normal file
5
RDPFileLib/My Project/Settings.settings
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings />
|
||||
</SettingsFile>
|
111
RDPFileLib/RDPFileLib.bak.vbproj
Normal file
111
RDPFileLib/RDPFileLib.bak.vbproj
Normal file
@ -0,0 +1,111 @@
|
||||
<?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>{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>RDPFileLib</RootNamespace>
|
||||
<AssemblyName>RDPFileLib</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>RDPFileLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>RDPFileLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<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="RDPFileLib.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<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>
|
||||
</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>
|
255
RDPFileLib/RDPFileLib.vb
Normal file
255
RDPFileLib/RDPFileLib.vb
Normal file
@ -0,0 +1,255 @@
|
||||
Public Class RDPFile
|
||||
Public administrative_session As Integer = 0
|
||||
Public allow_desktop_composition As Integer = 0
|
||||
Public allow_font_smoothing As Integer = 0
|
||||
Public alternate_full_address As String = ""
|
||||
Public alternate_shell As String = ""
|
||||
Public audiocapturemode As Integer = 0
|
||||
Public audiomode As Integer = 0
|
||||
Public audioqualitymode As Integer = 0
|
||||
Public authentication_level As Integer = 2
|
||||
Public autoreconnect_max_retries As Integer = 20
|
||||
Public autoreconnection_enabled As Integer = 1
|
||||
Public bandwidthautodetect As Integer = 1
|
||||
Public bitmapcachepersistenable As Integer = 1
|
||||
Public bitmapcachesize As Integer = 1500
|
||||
Public compression As Integer = 1
|
||||
Public connect_to_console As Integer = 0
|
||||
Public connection_type As Integer = 2
|
||||
Public desktop_size_id As Integer = 0
|
||||
Public desktopheight As Integer = 600
|
||||
Public desktopwidth As Integer = 800
|
||||
Public devicestoredirect As String = ""
|
||||
Public disable_ctrl_alt_del As Integer = 1
|
||||
Public disable_full_window_drag As Integer = 1
|
||||
Public disable_menu_anims As Integer = 1
|
||||
Public disable_themes As Integer = 0
|
||||
Public disable_wallpaper As Integer = 1
|
||||
Public disableconnectionsharing As Integer = 0
|
||||
Public disableremoteappcapscheck As Integer = 0
|
||||
Public displayconnectionbar As Integer = 1
|
||||
Public domain As String = ""
|
||||
Public drivestoredirect As String = ""
|
||||
Public enablecredsspsupport As Integer = 1
|
||||
Public enablesuperpan As Integer = 0
|
||||
Public full_address As String = ""
|
||||
Public gatewaycredentialssource As Integer = 4
|
||||
Public gatewayhostname As String = ""
|
||||
Public gatewayprofileusagemethod As Integer = 0
|
||||
Public gatewayusagemethod As Integer = 4
|
||||
Public keyboardhook As Integer = 2
|
||||
Public negotiate_security_layer As Integer = 1
|
||||
Public networkautodetect As Integer = 1
|
||||
'Public password_51 As Binary
|
||||
Public pinconnectionbar As Integer = 1
|
||||
Public prompt_for_credentials As Integer = 0
|
||||
Public prompt_for_credentials_on_client As Integer = 0
|
||||
Public promptcredentialonce As Integer = 1
|
||||
Public public_mode As Integer = 0
|
||||
Public redirectclipboard As Integer = 1
|
||||
Public redirectcomports As Integer = 0
|
||||
Public redirectdirectx As Integer = 1
|
||||
Public redirectdrives As Integer = 0
|
||||
Public redirectposdevices As Integer = 0
|
||||
Public redirectprinters As Integer = 1
|
||||
Public redirectsmartcards As Integer = 1
|
||||
Public remoteapplicationcmdline As String = ""
|
||||
Public remoteapplicationexpandcmdline As Integer = 1
|
||||
Public remoteapplicationexpandworkingdir As Integer = 0
|
||||
Public remoteapplicationfile As String = ""
|
||||
Public remoteapplicationfileextensions As String = ""
|
||||
Public remoteapplicationicon As String = ""
|
||||
Public remoteapplicationmode As Integer = 0
|
||||
Public remoteapplicationname As String = ""
|
||||
Public remoteapplicationprogram As String = ""
|
||||
Public screen_mode_id As Integer = 2
|
||||
Public server_port As Integer = 3389
|
||||
Public session_bpp As Integer = 32
|
||||
Public shell_working_directory As String = ""
|
||||
Public smart_sizing As Integer = 0
|
||||
Public span_monitors As Integer = 0
|
||||
Public superpanaccelerationfactor As Integer = 1
|
||||
Public usbdevicestoredirect As String = ""
|
||||
Public use_multimon As Integer = 0
|
||||
Public username As String = ""
|
||||
Public videoplaybackmode As Integer = 1
|
||||
Public winposstr As String = "0,3,0,0,800,600"
|
||||
|
||||
Public Sub SaveRDPfile(FilePath As String, Optional SaveDefaultSettings As Boolean = False)
|
||||
My.Computer.FileSystem.WriteAllText(FilePath, GetRDPstring(SaveDefaultSettings), False)
|
||||
End Sub
|
||||
|
||||
Public Function GetRDPstring(Optional SaveDefaultSettings As Boolean = False)
|
||||
Dim RDPstring As String = ""
|
||||
|
||||
Dim DefaultRDP As New RDPFile
|
||||
|
||||
If SaveDefaultSettings Or Not DefaultRDP.administrative_session = administrative_session Then RDPstring += "administrative session" & ":" & administrative_session.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & administrative_session.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.allow_desktop_composition = allow_desktop_composition Then RDPstring += "allow desktop composition" & ":" & allow_desktop_composition.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & allow_desktop_composition.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.allow_font_smoothing = allow_font_smoothing Then RDPstring += "allow font smoothing" & ":" & allow_font_smoothing.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & allow_font_smoothing.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.alternate_full_address = alternate_full_address Then RDPstring += "alternate full address" & ":" & alternate_full_address.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & alternate_full_address.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.alternate_shell = alternate_shell Then RDPstring += "alternate shell" & ":" & alternate_shell.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & alternate_shell.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.audiocapturemode = audiocapturemode Then RDPstring += "audiocapturemode" & ":" & audiocapturemode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & audiocapturemode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.audiomode = audiomode Then RDPstring += "audiomode" & ":" & audiomode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & audiomode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.audioqualitymode = audioqualitymode Then RDPstring += "audioqualitymode" & ":" & audioqualitymode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & audioqualitymode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.authentication_level = authentication_level Then RDPstring += "authentication level" & ":" & authentication_level.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & authentication_level.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.autoreconnect_max_retries = autoreconnect_max_retries Then RDPstring += "autoreconnect max retries" & ":" & autoreconnect_max_retries.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & autoreconnect_max_retries.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.autoreconnection_enabled = autoreconnection_enabled Then RDPstring += "autoreconnection enabled" & ":" & autoreconnection_enabled.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & autoreconnection_enabled.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.bandwidthautodetect = bandwidthautodetect Then RDPstring += "bandwidthautodetect" & ":" & bandwidthautodetect.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & bandwidthautodetect.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.bitmapcachepersistenable = bitmapcachepersistenable Then RDPstring += "bitmapcachepersistenable" & ":" & bitmapcachepersistenable.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & bitmapcachepersistenable.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.bitmapcachesize = bitmapcachesize Then RDPstring += "bitmapcachesize" & ":" & bitmapcachesize.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & bitmapcachesize.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.compression = compression Then RDPstring += "compression" & ":" & compression.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & compression.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.connect_to_console = connect_to_console Then RDPstring += "connect to console" & ":" & connect_to_console.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & connect_to_console.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.connection_type = connection_type Then RDPstring += "connection type" & ":" & connection_type.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & connection_type.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.desktop_size_id = desktop_size_id Then RDPstring += "desktop size id" & ":" & desktop_size_id.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & desktop_size_id.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.desktopheight = desktopheight Then RDPstring += "desktopheight" & ":" & desktopheight.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & desktopheight.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.desktopwidth = desktopwidth Then RDPstring += "desktopwidth" & ":" & desktopwidth.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & desktopwidth.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.devicestoredirect = devicestoredirect Then RDPstring += "devicestoredirect" & ":" & devicestoredirect.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & devicestoredirect.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disable_ctrl_alt_del = disable_ctrl_alt_del Then RDPstring += "disable ctrl+alt+del" & ":" & disable_ctrl_alt_del.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disable_ctrl_alt_del.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disable_full_window_drag = disable_full_window_drag Then RDPstring += "disable full window drag" & ":" & disable_full_window_drag.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disable_full_window_drag.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disable_menu_anims = disable_menu_anims Then RDPstring += "disable menu anims" & ":" & disable_menu_anims.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disable_menu_anims.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disable_themes = disable_themes Then RDPstring += "disable themes" & ":" & disable_themes.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disable_themes.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disable_wallpaper = disable_wallpaper Then RDPstring += "disable wallpaper" & ":" & disable_wallpaper.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disable_wallpaper.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disableconnectionsharing = disableconnectionsharing Then RDPstring += "disableconnectionsharing" & ":" & disableconnectionsharing.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disableconnectionsharing.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.disableremoteappcapscheck = disableremoteappcapscheck Then RDPstring += "disableremoteappcapscheck" & ":" & disableremoteappcapscheck.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & disableremoteappcapscheck.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.displayconnectionbar = displayconnectionbar Then RDPstring += "displayconnectionbar" & ":" & displayconnectionbar.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & displayconnectionbar.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.domain = domain Then RDPstring += "domain" & ":" & domain.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & domain.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.drivestoredirect = drivestoredirect Then RDPstring += "drivestoredirect" & ":" & drivestoredirect.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & drivestoredirect.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.enablecredsspsupport = enablecredsspsupport Then RDPstring += "enablecredsspsupport" & ":" & enablecredsspsupport.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & enablecredsspsupport.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.enablesuperpan = enablesuperpan Then RDPstring += "enablesuperpan" & ":" & enablesuperpan.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & enablesuperpan.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.full_address = full_address Then RDPstring += "full address" & ":" & full_address.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & full_address.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.gatewaycredentialssource = gatewaycredentialssource Then RDPstring += "gatewaycredentialssource" & ":" & gatewaycredentialssource.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & gatewaycredentialssource.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.gatewayhostname = gatewayhostname Then RDPstring += "gatewayhostname" & ":" & gatewayhostname.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & gatewayhostname.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.gatewayprofileusagemethod = gatewayprofileusagemethod Then RDPstring += "gatewayprofileusagemethod" & ":" & gatewayprofileusagemethod.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & gatewayprofileusagemethod.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.gatewayusagemethod = gatewayusagemethod Then RDPstring += "gatewayusagemethod" & ":" & gatewayusagemethod.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & gatewayusagemethod.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.keyboardhook = keyboardhook Then RDPstring += "keyboardhook" & ":" & keyboardhook.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & keyboardhook.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.negotiate_security_layer = negotiate_security_layer Then RDPstring += "negotiate security layer" & ":" & negotiate_security_layer.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & negotiate_security_layer.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.networkautodetect = networkautodetect Then RDPstring += "networkautodetect" & ":" & networkautodetect.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & networkautodetect.ToString & vbCrLf
|
||||
'If SaveDefaultSettings Or Not DefaultRDP.password_51 = password_51 Then RDPstring += "password 51" & ":" & password_51.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & password_51.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.pinconnectionbar = pinconnectionbar Then RDPstring += "pinconnectionbar" & ":" & pinconnectionbar.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & pinconnectionbar.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.prompt_for_credentials = prompt_for_credentials Then RDPstring += "prompt for credentials" & ":" & prompt_for_credentials.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & prompt_for_credentials.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.prompt_for_credentials_on_client = prompt_for_credentials_on_client Then RDPstring += "prompt for credentials on client" & ":" & prompt_for_credentials_on_client.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & prompt_for_credentials_on_client.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.promptcredentialonce = promptcredentialonce Then RDPstring += "promptcredentialonce" & ":" & promptcredentialonce.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & promptcredentialonce.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.public_mode = public_mode Then RDPstring += "public mode" & ":" & public_mode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & public_mode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectclipboard = redirectclipboard Then RDPstring += "redirectclipboard" & ":" & redirectclipboard.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectclipboard.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectcomports = redirectcomports Then RDPstring += "redirectcomports" & ":" & redirectcomports.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectcomports.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectdirectx = redirectdirectx Then RDPstring += "redirectdirectx" & ":" & redirectdirectx.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectdirectx.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectdrives = redirectdrives Then RDPstring += "redirectdrives" & ":" & redirectdrives.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectdrives.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectposdevices = redirectposdevices Then RDPstring += "redirectposdevices" & ":" & redirectposdevices.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectposdevices.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectprinters = redirectprinters Then RDPstring += "redirectprinters" & ":" & redirectprinters.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectprinters.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.redirectsmartcards = redirectsmartcards Then RDPstring += "redirectsmartcards" & ":" & redirectsmartcards.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & redirectsmartcards.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationcmdline = remoteapplicationcmdline Then RDPstring += "remoteapplicationcmdline" & ":" & remoteapplicationcmdline.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationcmdline.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationexpandcmdline = remoteapplicationexpandcmdline Then RDPstring += "remoteapplicationexpandcmdline" & ":" & remoteapplicationexpandcmdline.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationexpandcmdline.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationexpandworkingdir = remoteapplicationexpandworkingdir Then RDPstring += "remoteapplicationexpandworkingdir" & ":" & remoteapplicationexpandworkingdir.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationexpandworkingdir.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationfile = remoteapplicationfile Then RDPstring += "remoteapplicationfile" & ":" & remoteapplicationfile.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationfile.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationfileextensions = remoteapplicationfileextensions Then RDPstring += "remoteapplicationfileextensions" & ":" & remoteapplicationfileextensions.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationfileextensions.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationicon = remoteapplicationicon Then RDPstring += "remoteapplicationicon" & ":" & remoteapplicationicon.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationicon.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationmode = remoteapplicationmode Then RDPstring += "remoteapplicationmode" & ":" & remoteapplicationmode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationmode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationname = remoteapplicationname Then RDPstring += "remoteapplicationname" & ":" & remoteapplicationname.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationname.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.remoteapplicationprogram = remoteapplicationprogram Then RDPstring += "remoteapplicationprogram" & ":" & remoteapplicationprogram.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & remoteapplicationprogram.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.screen_mode_id = screen_mode_id Then RDPstring += "screen mode id" & ":" & screen_mode_id.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & screen_mode_id.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.server_port = server_port Then RDPstring += "server port" & ":" & server_port.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & server_port.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.session_bpp = session_bpp Then RDPstring += "session bpp" & ":" & session_bpp.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & session_bpp.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.shell_working_directory = shell_working_directory Then RDPstring += "shell working directory" & ":" & shell_working_directory.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & shell_working_directory.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.smart_sizing = smart_sizing Then RDPstring += "smart sizing" & ":" & smart_sizing.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & smart_sizing.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.span_monitors = span_monitors Then RDPstring += "span monitors" & ":" & span_monitors.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & span_monitors.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.superpanaccelerationfactor = superpanaccelerationfactor Then RDPstring += "superpanaccelerationfactor" & ":" & superpanaccelerationfactor.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & superpanaccelerationfactor.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.usbdevicestoredirect = usbdevicestoredirect Then RDPstring += "usbdevicestoredirect" & ":" & usbdevicestoredirect.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & usbdevicestoredirect.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.use_multimon = use_multimon Then RDPstring += "use multimon" & ":" & use_multimon.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & use_multimon.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.username = username Then RDPstring += "username" & ":" & username.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & username.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.videoplaybackmode = videoplaybackmode Then RDPstring += "videoplaybackmode" & ":" & videoplaybackmode.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & videoplaybackmode.ToString & vbCrLf
|
||||
If SaveDefaultSettings Or Not DefaultRDP.winposstr = winposstr Then RDPstring += "winposstr" & ":" & winposstr.GetType().ToString.Replace("System.", "").ToLower.Substring(0, 1) & ":" & winposstr.ToString & vbCrLf
|
||||
|
||||
Return RDPstring
|
||||
End Function
|
||||
|
||||
Public Sub LoadRDPfile(FilePath As String)
|
||||
Dim sr As New System.IO.StreamReader(FilePath)
|
||||
|
||||
While (sr.Peek <> -1)
|
||||
Dim line As String = sr.ReadLine
|
||||
Dim SplitLine As Array = line.Split(":")
|
||||
|
||||
If Not SplitLine(2) = "" Then
|
||||
If SplitLine(0) = "administrative session" Then administrative_session = SplitLine(2)
|
||||
If SplitLine(0) = "allow desktop composition" Then allow_desktop_composition = SplitLine(2)
|
||||
If SplitLine(0) = "allow font smoothing" Then allow_font_smoothing = SplitLine(2)
|
||||
If SplitLine(0) = "alternate full address" Then alternate_full_address = SplitLine(2)
|
||||
If SplitLine(0) = "alternate shell" Then alternate_shell = SplitLine(2)
|
||||
If SplitLine(0) = "audiocapturemode" Then audiocapturemode = SplitLine(2)
|
||||
If SplitLine(0) = "audiomode" Then audiomode = SplitLine(2)
|
||||
If SplitLine(0) = "audioqualitymode" Then audioqualitymode = SplitLine(2)
|
||||
If SplitLine(0) = "authentication level" Then authentication_level = SplitLine(2)
|
||||
If SplitLine(0) = "autoreconnect max retries" Then autoreconnect_max_retries = SplitLine(2)
|
||||
If SplitLine(0) = "autoreconnection enabled" Then autoreconnection_enabled = SplitLine(2)
|
||||
If SplitLine(0) = "bandwidthautodetect" Then bandwidthautodetect = SplitLine(2)
|
||||
If SplitLine(0) = "bitmapcachepersistenable" Then bitmapcachepersistenable = SplitLine(2)
|
||||
If SplitLine(0) = "bitmapcachesize" Then bitmapcachesize = SplitLine(2)
|
||||
If SplitLine(0) = "compression" Then compression = SplitLine(2)
|
||||
If SplitLine(0) = "connect to console" Then connect_to_console = SplitLine(2)
|
||||
If SplitLine(0) = "connection type" Then connection_type = SplitLine(2)
|
||||
If SplitLine(0) = "desktop size id" Then desktop_size_id = SplitLine(2)
|
||||
If SplitLine(0) = "desktopheight" Then desktopheight = SplitLine(2)
|
||||
If SplitLine(0) = "desktopwidth" Then desktopwidth = SplitLine(2)
|
||||
If SplitLine(0) = "devicestoredirect" Then devicestoredirect = SplitLine(2)
|
||||
If SplitLine(0) = "disable ctrl+alt+del" Then disable_ctrl_alt_del = SplitLine(2)
|
||||
If SplitLine(0) = "disable full window drag" Then disable_full_window_drag = SplitLine(2)
|
||||
If SplitLine(0) = "disable menu anims" Then disable_menu_anims = SplitLine(2)
|
||||
If SplitLine(0) = "disable themes" Then disable_themes = SplitLine(2)
|
||||
If SplitLine(0) = "disable wallpaper" Then disable_wallpaper = SplitLine(2)
|
||||
If SplitLine(0) = "disableconnectionsharing" Then disableconnectionsharing = SplitLine(2)
|
||||
If SplitLine(0) = "disableremoteappcapscheck" Then disableremoteappcapscheck = SplitLine(2)
|
||||
If SplitLine(0) = "displayconnectionbar" Then displayconnectionbar = SplitLine(2)
|
||||
If SplitLine(0) = "domain" Then domain = SplitLine(2)
|
||||
If SplitLine(0) = "drivestoredirect" Then drivestoredirect = SplitLine(2)
|
||||
If SplitLine(0) = "enablecredsspsupport" Then enablecredsspsupport = SplitLine(2)
|
||||
If SplitLine(0) = "enablesuperpan" Then enablesuperpan = SplitLine(2)
|
||||
If SplitLine(0) = "full address" Then full_address = SplitLine(2)
|
||||
If SplitLine(0) = "gatewaycredentialssource" Then gatewaycredentialssource = SplitLine(2)
|
||||
If SplitLine(0) = "gatewayhostname" Then gatewayhostname = SplitLine(2)
|
||||
If SplitLine(0) = "gatewayprofileusagemethod" Then gatewayprofileusagemethod = SplitLine(2)
|
||||
If SplitLine(0) = "gatewayusagemethod" Then gatewayusagemethod = SplitLine(2)
|
||||
If SplitLine(0) = "keyboardhook" Then keyboardhook = SplitLine(2)
|
||||
If SplitLine(0) = "negotiate security layer" Then negotiate_security_layer = SplitLine(2)
|
||||
If SplitLine(0) = "networkautodetect" Then networkautodetect = SplitLine(2)
|
||||
'If SplitLine(0) = "password 51" Then password_51 = SplitLine(2)
|
||||
If SplitLine(0) = "pinconnectionbar" Then pinconnectionbar = SplitLine(2)
|
||||
If SplitLine(0) = "prompt for credentials" Then prompt_for_credentials = SplitLine(2)
|
||||
If SplitLine(0) = "prompt for credentials on client" Then prompt_for_credentials_on_client = SplitLine(2)
|
||||
If SplitLine(0) = "promptcredentialonce" Then promptcredentialonce = SplitLine(2)
|
||||
If SplitLine(0) = "public mode" Then public_mode = SplitLine(2)
|
||||
If SplitLine(0) = "redirectclipboard" Then redirectclipboard = SplitLine(2)
|
||||
If SplitLine(0) = "redirectcomports" Then redirectcomports = SplitLine(2)
|
||||
If SplitLine(0) = "redirectdirectx" Then redirectdirectx = SplitLine(2)
|
||||
If SplitLine(0) = "redirectdrives" Then redirectdrives = SplitLine(2)
|
||||
If SplitLine(0) = "redirectposdevices" Then redirectposdevices = SplitLine(2)
|
||||
If SplitLine(0) = "redirectprinters" Then redirectprinters = SplitLine(2)
|
||||
If SplitLine(0) = "redirectsmartcards" Then redirectsmartcards = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationcmdline" Then remoteapplicationcmdline = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationexpandcmdline" Then remoteapplicationexpandcmdline = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationexpandworkingdir" Then remoteapplicationexpandworkingdir = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationfile" Then remoteapplicationfile = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationfileextensions" Then remoteapplicationfileextensions = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationicon" Then remoteapplicationicon = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationmode" Then remoteapplicationmode = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationname" Then remoteapplicationname = SplitLine(2)
|
||||
If SplitLine(0) = "remoteapplicationprogram" Then remoteapplicationprogram = SplitLine(2)
|
||||
If SplitLine(0) = "screen mode id" Then screen_mode_id = SplitLine(2)
|
||||
If SplitLine(0) = "server port" Then server_port = SplitLine(2)
|
||||
If SplitLine(0) = "session bpp" Then session_bpp = SplitLine(2)
|
||||
If SplitLine(0) = "shell working directory" Then shell_working_directory = SplitLine(2)
|
||||
If SplitLine(0) = "smart sizing" Then smart_sizing = SplitLine(2)
|
||||
If SplitLine(0) = "span monitors" Then span_monitors = SplitLine(2)
|
||||
If SplitLine(0) = "superpanaccelerationfactor" Then superpanaccelerationfactor = SplitLine(2)
|
||||
If SplitLine(0) = "usbdevicestoredirect" Then usbdevicestoredirect = SplitLine(2)
|
||||
If SplitLine(0) = "use multimon" Then use_multimon = SplitLine(2)
|
||||
If SplitLine(0) = "username" Then username = SplitLine(2)
|
||||
If SplitLine(0) = "videoplaybackmode" Then videoplaybackmode = SplitLine(2)
|
||||
If SplitLine(0) = "winposstr" Then winposstr = SplitLine(2)
|
||||
|
||||
End If
|
||||
|
||||
End While
|
||||
End Sub
|
||||
|
||||
End Class
|
111
RDPFileLib/RDPFileLib.vbproj
Normal file
111
RDPFileLib/RDPFileLib.vbproj
Normal file
@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>RDPFileLib</RootNamespace>
|
||||
<AssemblyName>RDPFileLib</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>RDPFileLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>RDPFileLib.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<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="RDPFileLib.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<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>
|
||||
</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>
|
27
RDPFileLib/app.config
Normal file
27
RDPFileLib/app.config
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
</configSections>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<!-- This section defines the logging configuration for My.Application.Log -->
|
||||
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||
<listeners>
|
||||
<add name="FileLog"/>
|
||||
<!-- Uncomment the below section to write to the Application Event Log -->
|
||||
<!--<add name="EventLog"/>-->
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<switches>
|
||||
<add name="DefaultSwitch" value="Information" />
|
||||
</switches>
|
||||
<sharedListeners>
|
||||
<add name="FileLog"
|
||||
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
|
||||
initializeData="FileLogWriter"/>
|
||||
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
|
||||
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||
</sharedListeners>
|
||||
</system.diagnostics>
|
||||
</configuration>
|
2
remoteapp-tool/.gitignore
vendored
Normal file
2
remoteapp-tool/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
72
remoteapp-tool/App.config
Normal file
72
remoteapp-tool/App.config
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="RemoteApp_Tool.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||
</startup>
|
||||
<userSettings>
|
||||
<RemoteApp_Tool.My.MySettings>
|
||||
<setting name="MainWindowWidth" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="MainWindowHeight" serializeAs="String">
|
||||
<value>0</value>
|
||||
</setting>
|
||||
<setting name="SavedConnectionModeMSI" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedOpenWithNotepad" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedServerAddress" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="SavedServerPort" serializeAs="String">
|
||||
<value>3389</value>
|
||||
</setting>
|
||||
<setting name="SavedAltServerAddress" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="SavedUseRDGateway" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedRDGatewayAddress" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="SavedAttemptDirectRDGateway" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedMSIShortcutDesktop" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="SavedMSIShortcutStart" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="SavedMSIShortcutStartTopLevel" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedUseShortcutTag" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="SavedShortcutTag" serializeAs="String">
|
||||
<value>remote</value>
|
||||
</setting>
|
||||
<setting name="SavedClientConnectionOptions" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedCreateRAWebIcon" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedMSIPerUser" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="SavedDisableFTA" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</RemoteApp_Tool.My.MySettings>
|
||||
</userSettings>
|
||||
</configuration>
|
1
remoteapp-tool/ApplicationEvents.vb
Normal file
1
remoteapp-tool/ApplicationEvents.vb
Normal file
@ -0,0 +1 @@
|
||||
|
102
remoteapp-tool/HelpSystem.vb
Normal file
102
remoteapp-tool/HelpSystem.vb
Normal file
@ -0,0 +1,102 @@
|
||||
Module HelpSystem
|
||||
Public Sub SetupTips(TheForm As Windows.Forms.Form)
|
||||
|
||||
Dim toolTip1 As New ToolTip()
|
||||
|
||||
toolTip1.AutoPopDelay = 10000
|
||||
toolTip1.InitialDelay = 500
|
||||
toolTip1.ReshowDelay = 500
|
||||
|
||||
Dim HelpString As String = ""
|
||||
|
||||
For Each Control As Control In TheForm.Controls
|
||||
For Each SubControl As Control In Control.Controls
|
||||
For Each SubSubControl In SubControl.Controls
|
||||
For Each SubSubSubControl In SubSubControl.Controls
|
||||
HelpString = GetTipString(Control.Parent.Name, SubSubSubControl.Name)
|
||||
If Not HelpString = "" Then toolTip1.SetToolTip(SubSubSubControl, HelpString)
|
||||
Next
|
||||
HelpString = GetTipString(Control.Parent.Name, SubSubControl.Name)
|
||||
If Not HelpString = "" Then toolTip1.SetToolTip(SubSubControl, HelpString)
|
||||
Next
|
||||
HelpString = GetTipString(Control.Parent.Name, SubControl.Name)
|
||||
If Not HelpString = "" Then toolTip1.SetToolTip(SubControl, HelpString)
|
||||
Next
|
||||
HelpString = GetTipString(Control.Parent.Name, Control.Name)
|
||||
If Not HelpString = "" Then toolTip1.SetToolTip(Control, HelpString)
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function GetTipString(FormName As String, ControlName As String) As String
|
||||
Dim TipString As String = ""
|
||||
|
||||
Dim TipText As String = GetTipFile()
|
||||
Dim TipArray = TipText.Split(ControlChars.CrLf.ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
|
||||
|
||||
For Each TipLine As String In TipArray
|
||||
Dim TipLineArray = TipLine.Split("|")
|
||||
If TipLineArray(0) = FormName And TipLineArray(1) = ControlName Then TipString = TipLineArray(2)
|
||||
Next
|
||||
|
||||
TipString = TipString.Replace("\r", vbCr)
|
||||
TipString = TipString.Replace("\n", vbLf)
|
||||
|
||||
Return TipString
|
||||
End Function
|
||||
|
||||
Private Function GetTipFile() As String
|
||||
Dim TipFile As String = ""
|
||||
|
||||
If My.Computer.FileSystem.FileExists("tips.txt") Then
|
||||
TipFile = My.Computer.FileSystem.ReadAllText("tips.txt")
|
||||
Else
|
||||
TipFile = GetBuiltInTips()
|
||||
End If
|
||||
|
||||
Return TipFile
|
||||
End Function
|
||||
|
||||
|
||||
Private Function GetBuiltInTips() As String
|
||||
Dim Tips As String = ""
|
||||
|
||||
Tips += "RemoteAppMainWindow|CreateButton|Add a new RemoteApp." & vbCrLf
|
||||
Tips += "RemoteAppMainWindow|DeleteButton|Remove selected RemoteApp." & vbCrLf
|
||||
Tips += "RemoteAppMainWindow|EditButton|Edit properties of selected RemoteApp." & vbCrLf
|
||||
Tips += "RemoteAppMainWindow|CreateClientConnection|Creates a RDP file or MSI installer for the selected RemoteApp." & vbCrLf
|
||||
|
||||
Tips += "RemoteAppEditWindow|SaveButton|Save changes and close." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|FTAButton|Set file type associations for this RemoteApp." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|CancelEditButton|Discard changes and close." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|BrowseIconPath|Select an icon for the RemoteApp." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|VPathCopyButton|Copy the value from the ""Path"" field into the ""VPath"" field." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|IconPathCopyButton|Copy the value from the ""Path"" field into the ""Icon path"" field. " & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|BrowsePath|Browse for application." & vbCrLf
|
||||
Tips += "RemoteAppEditWindow|BrowseVPath|Browse for application." & vbCrLf
|
||||
|
||||
Tips += "RemoteAppCreateClientConnection|RDPRadioButton|Create an RDP file." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|MSIRadioButton|Create an MSI file." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|EditAfterSave|Edit the RDP connection file." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|CreateRAWebIcon|Generate an icon for the application and any file type associations.\r\nUse this with RAWeb." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|FTAButton|Set file type associations for this RemoteApp.\r\nChanges here will only affect this client connection. They will not be saved." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|DisabledFTACheckBox|Do not include file type associations in this client connection." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|SaveButton|Save window settings for next time." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|ResetButton|Reset window settings to defaults." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|CancelEditButton|Close and return to the main window." & vbCrLf
|
||||
Tips += "RemoteAppCreateClientConnection|CreateButton|Create the client connection and choose where to save it." & vbCrLf
|
||||
|
||||
Tips += "RemoteAppFileTypeAssociation|CreateButton|Create a new File Type Association." & vbCrLf
|
||||
Tips += "RemoteAppFileTypeAssociation|DeleteButton|Delete selected File Type Association." & vbCrLf
|
||||
Tips += "RemoteAppFileTypeAssociation|EditButton|Change icon of selected File Type Association." & vbCrLf
|
||||
Tips += "RemoteAppFileTypeAssociation|SetAssociationButton|Create or remove the selected File Type Association on the current system." & vbCrLf
|
||||
Tips += "RemoteAppFileTypeAssociation|CloseButton|Save changes and close." & vbCrLf
|
||||
|
||||
Tips += "RemoteAppIconPicker|BrowseButton|Browse for a file that contains icons." & vbCrLf
|
||||
Tips += "RemoteAppIconPicker|CancelEditButton|Discard changes and close." & vbCrLf
|
||||
Tips += "RemoteAppIconPicker|OKButton|Choose the selected icon." & vbCrLf
|
||||
|
||||
Return Tips
|
||||
End Function
|
||||
|
||||
End Module
|
155
remoteapp-tool/IconModule.vb
Normal file
155
remoteapp-tool/IconModule.vb
Normal file
@ -0,0 +1,155 @@
|
||||
Imports System.IO
|
||||
Imports System.Drawing
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Public Class IconExtractor
|
||||
Private Declare Function ExtractIconEx _
|
||||
Lib "shell32.dll" Alias "ExtractIconExA" _
|
||||
(ByVal lpszFile As String, ByVal nIconIndex As Int32, _
|
||||
ByRef phiconLarge As Int32, ByRef phiconSmall As Int32, _
|
||||
ByVal nIcons As Int32) As Int32
|
||||
|
||||
Private Declare Function ExtractIcon _
|
||||
Lib "shell32.dll" Alias "ExtractIconA" _
|
||||
(ByVal hInst As IntPtr, ByVal lpszExeFileName As String, _
|
||||
ByVal nIconIndex As Int32) As Int32
|
||||
|
||||
Private Declare Function DrawIconEx _
|
||||
Lib "user32" _
|
||||
(ByVal hdc As Int32, ByVal xLeft As Int32, ByVal yTop As Int32, _
|
||||
ByVal hIcon As IntPtr, ByVal cxWidth As Int32, ByVal cyWidth As Int32, _
|
||||
ByVal istepIfAniCur As Int32, ByVal hbrFlickerFreeDraw As Int32, _
|
||||
ByVal diFlags As Int32) As Int32
|
||||
|
||||
Private Declare Function DestroyIcon _
|
||||
Lib "user32" _
|
||||
(ByVal hIcon As Int32) As Int32
|
||||
|
||||
Private m_hIcons() As Int32
|
||||
|
||||
|
||||
Protected Overrides Sub Finalize()
|
||||
|
||||
MyBase.Finalize()
|
||||
|
||||
Dim countIcons As Integer = m_hIcons.Length
|
||||
|
||||
If countIcons > 0 Then
|
||||
|
||||
For iconIndex As Integer = 0 To countIcons - 1
|
||||
|
||||
DestroyIcon(m_hIcons(iconIndex))
|
||||
|
||||
Next iconIndex
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ExtractIcons(ByVal filePath As String, ByVal hInst As IntPtr) As List(Of Icon)
|
||||
|
||||
Dim listIcons As New List(Of Icon)
|
||||
|
||||
Try
|
||||
|
||||
Dim numIcons As Integer = ExtractIconEx(filePath, -1, 0&, 0&, 0&)
|
||||
|
||||
If numIcons = 0 Then
|
||||
Throw New Exception("No icons found in " & filePath)
|
||||
End If
|
||||
|
||||
numIcons -= 1
|
||||
|
||||
For currentIcon As Integer = 0 To numIcons
|
||||
|
||||
m_hIcons(currentIcon) = ExtractIcon(hInst, filePath, currentIcon)
|
||||
|
||||
Dim handleIcon As New IntPtr(m_hIcons(currentIcon))
|
||||
|
||||
If Not handleIcon.Equals(IntPtr.Zero) Then
|
||||
|
||||
listIcons.Add(Icon.FromHandle(handleIcon))
|
||||
|
||||
End If
|
||||
|
||||
Next currentIcon
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
MessageBox.Show(ex.ToString())
|
||||
|
||||
End Try
|
||||
|
||||
Return listIcons
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Module IconModule
|
||||
|
||||
Public Sub TestIconLib()
|
||||
Dim testIcon As New IconLib.MultiIcon
|
||||
End Sub
|
||||
|
||||
Public Function IconFromFilePath(filePath As String) As Icon
|
||||
Dim result As Icon = Nothing
|
||||
Try
|
||||
result = Icon.ExtractAssociatedIcon(filePath)
|
||||
Catch
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Function ExtractToIco(IconSourcePath As String, IconSourceIndex As Integer, IcoDestPath As String) As Boolean
|
||||
Dim success = False
|
||||
Dim IconLoadError As Boolean = False
|
||||
If My.Computer.FileSystem.FileExists(IconSourcePath) = True Then
|
||||
Dim mIcon As New IconLib.MultiIcon
|
||||
Try
|
||||
mIcon.Load(IconSourcePath)
|
||||
Catch Ex As Exception
|
||||
IconLoadError = True
|
||||
End Try
|
||||
|
||||
If Not IconLoadError Then
|
||||
Dim sIcon As IconLib.SingleIcon
|
||||
If IconSourceIndex = 0 Then
|
||||
sIcon = mIcon.FirstOrDefault
|
||||
Else
|
||||
sIcon = mIcon.Item(IconSourceIndex)
|
||||
End If
|
||||
|
||||
Try
|
||||
sIcon.Save(IcoDestPath)
|
||||
success = True
|
||||
Catch Ex As Exception
|
||||
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
Return success
|
||||
End Function
|
||||
|
||||
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Integer, ByRef phiconLarge As Integer, ByRef phiconSmall As Integer, ByVal nIcons As Integer) As Integer
|
||||
|
||||
Public Function ReturnIcon(ByVal Path As String, ByVal Index As Integer, Optional ByVal small As Boolean = False) As Icon
|
||||
Dim bigIcon As Integer
|
||||
Dim smallIcon As Integer
|
||||
ExtractIcon(Path, Index, bigIcon, smallIcon, 1)
|
||||
If bigIcon = 0 Then
|
||||
ExtractIcon(Path, 0, bigIcon, smallIcon, 1)
|
||||
End If
|
||||
If bigIcon <> 0 Then
|
||||
If small = False Then
|
||||
Return Icon.FromHandle(bigIcon)
|
||||
Else
|
||||
Return Icon.FromHandle(smallIcon)
|
||||
End If
|
||||
Else
|
||||
Return ReturnIcon(GetSysDir() & "\mstsc.exe", 0)
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Module
|
131
remoteapp-tool/LocalFtaModule.vb
Normal file
131
remoteapp-tool/LocalFtaModule.vb
Normal file
@ -0,0 +1,131 @@
|
||||
Imports RemoteAppLib
|
||||
|
||||
Module LocalFtaModule
|
||||
|
||||
Public Sub RemoveUnusedFTAs()
|
||||
Dim KeyNames = My.Computer.Registry.ClassesRoot().GetSubKeyNames
|
||||
Dim RemoveCount As Integer = 0
|
||||
|
||||
For Each KeyName In KeyNames
|
||||
Dim FTAkey As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot.OpenSubKey(KeyName)
|
||||
Dim RAvalue As String = FTAkey.GetValue("RemoteApp", "")
|
||||
If Not RAvalue = "" Then
|
||||
For Each KeyName2 In KeyNames
|
||||
Try
|
||||
Dim FTkey As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot.OpenSubKey(KeyName2)
|
||||
Dim FTvalue As String = FTkey.GetValue("", "")
|
||||
If FTvalue = KeyName Then
|
||||
Dim sra As New RemoteAppLib.SystemRemoteApps
|
||||
Dim AppExists As Boolean = False
|
||||
For Each app As RemoteAppLib.RemoteApp In sra.GetAll
|
||||
If app.Name = GetAppForFTA(KeyName2) Then AppExists = True
|
||||
Next
|
||||
If Not AppExists Then
|
||||
LocalFtaModule.DeleteFTA(KeyName2)
|
||||
RemoveCount += 1
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
MessageBox.Show("Unused file type associations removed: " & RemoveCount, "File Type Association", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
End Sub
|
||||
|
||||
Public Function CreateFTACollection(ftaCol As FileTypeAssociationCollection, exeFile As String, RemoteAppName As String, Optional overwrite As Boolean = False) As String
|
||||
CreateFTACollection = ""
|
||||
For Each fta As FileTypeAssociation In ftaCol
|
||||
If DoesFTAExist(fta.Extension) And CreateFTA(fta, exeFile, RemoteAppName, overwrite) = False Then
|
||||
CreateFTACollection += "|" & fta.Extension
|
||||
End If
|
||||
Next
|
||||
CreateFTACollection = CreateFTACollection.Trim("|")
|
||||
End Function
|
||||
|
||||
Public Function CreateFTA(fta As FileTypeAssociation, exeFile As String, RemoteAppName As String, Optional overwrite As Boolean = False) As Boolean
|
||||
If DoesFTAExist(fta.Extension) = False Or overwrite = True Then
|
||||
DeleteFTA(fta.Extension)
|
||||
|
||||
Dim FileTypeReg = My.Computer.Registry.ClassesRoot.CreateSubKey("." & fta.Extension)
|
||||
FileTypeReg.SetValue("", fta.Extension & "_file")
|
||||
|
||||
Dim FileTypeKey = My.Computer.Registry.ClassesRoot.CreateSubKey(fta.Extension & "_file")
|
||||
FileTypeKey.SetValue("RemoteApp", RemoteAppName)
|
||||
|
||||
Dim FileTypeKeyShell = FileTypeKey.CreateSubKey("shell")
|
||||
Dim FileTypeKeyShellOpen = FileTypeKeyShell.CreateSubKey("open")
|
||||
Dim FileTypeKeyShellOpenCommand = FileTypeKeyShellOpen.CreateSubKey("command")
|
||||
|
||||
FileTypeKeyShellOpenCommand.SetValue("", """" & exeFile & """ ""%1""")
|
||||
|
||||
Dim FileTypeKeyDefIcon = FileTypeKey.CreateSubKey("DefaultIcon")
|
||||
FileTypeKeyDefIcon.SetValue("", """" & fta.IconPath & """," & fta.IconIndex)
|
||||
CreateFTA = True
|
||||
Else
|
||||
CreateFTA = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function GetAppForFTA(fileExtension As String) As String
|
||||
fileExtension = fileExtension.TrimStart(".")
|
||||
GetAppForFTA = ""
|
||||
|
||||
If DoesFTAExist(fileExtension) And IsFTAMine(fileExtension) Then
|
||||
Try
|
||||
Dim HKCRext As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot().OpenSubKey("." & fileExtension)
|
||||
Dim HKCRfta = HKCRext.GetValue("", "")
|
||||
If Not HKCRfta = "" Then
|
||||
Dim HKCRftaKey As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot().OpenSubKey(HKCRfta)
|
||||
GetAppForFTA = HKCRftaKey.GetValue("RemoteApp", "")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Sub DeleteFTA(fileExtension As String)
|
||||
fileExtension = fileExtension.TrimStart(".")
|
||||
If Not My.Computer.Registry.ClassesRoot.OpenSubKey("." & fileExtension) Is Nothing Then _
|
||||
My.Computer.Registry.ClassesRoot.DeleteSubKeyTree("." & fileExtension)
|
||||
|
||||
If Not My.Computer.Registry.ClassesRoot.OpenSubKey(fileExtension & "_file") Is Nothing Then _
|
||||
My.Computer.Registry.ClassesRoot.DeleteSubKeyTree(fileExtension & "_file")
|
||||
End Sub
|
||||
|
||||
Public Function DoesFTAExist(fileExtension As String) As Boolean
|
||||
fileExtension = fileExtension.TrimStart(".")
|
||||
Dim FTAexists As Boolean = False
|
||||
Dim HKCRext As String = ""
|
||||
Try
|
||||
HKCRext = My.Computer.Registry.ClassesRoot().OpenSubKey("." & fileExtension).ToString
|
||||
FTAexists = True
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Return FTAexists
|
||||
End Function
|
||||
|
||||
Public Function IsFTAMine(fileExtension As String) As Boolean
|
||||
fileExtension = fileExtension.TrimStart(".")
|
||||
IsFTAMine = False
|
||||
Try
|
||||
Dim HKCRext As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot().OpenSubKey("." & fileExtension)
|
||||
Dim HKCRfta = HKCRext.GetValue("", "")
|
||||
If Not HKCRfta = "" Then
|
||||
Dim HKCRftaKey As Microsoft.Win32.RegistryKey = My.Computer.Registry.ClassesRoot().OpenSubKey(HKCRfta)
|
||||
If Not HKCRftaKey.GetValue("RemoteApp", "") = "" Then IsFTAMine = True
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
End Module
|
38
remoteapp-tool/My Project/Application.Designer.vb
generated
Normal file
38
remoteapp-tool/My Project/Application.Designer.vb
generated
Normal file
@ -0,0 +1,38 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
|
||||
' or if you encounter build errors in this file, go to the Project Designer
|
||||
' (go to Project Properties or double-click the My Project node in
|
||||
' Solution Explorer), and make changes on the Application tab.
|
||||
'
|
||||
Partial Friend Class MyApplication
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Public Sub New()
|
||||
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
Me.IsSingleInstance = true
|
||||
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.RemoteApp_Tool.RemoteAppMainWindow
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
10
remoteapp-tool/My Project/Application.myapp
Normal file
10
remoteapp-tool/My Project/Application.myapp
Normal 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>RemoteAppMainWindow</MainForm>
|
||||
<SingleInstance>true</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
35
remoteapp-tool/My Project/AssemblyInfo.vb
Normal file
35
remoteapp-tool/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("RemoteApp Tool")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Kim Knight")>
|
||||
<Assembly: AssemblyProduct("RemoteApp Tool")>
|
||||
<Assembly: AssemblyCopyright("Created by Kim Knight")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("fbd55db5-06ea-4e43-92a4-6e96893013cc")>
|
||||
|
||||
' 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("5.4.0.0")>
|
||||
<Assembly: AssemblyFileVersion("5.4.0.0")>
|
63
remoteapp-tool/My Project/Resources.Designer.vb
generated
Normal file
63
remoteapp-tool/My Project/Resources.Designer.vb
generated
Normal file
@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'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.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</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>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</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("RemoteApp_Tool.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</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
|
121
remoteapp-tool/My Project/Resources.resx
Normal file
121
remoteapp-tool/My Project/Resources.resx
Normal file
@ -0,0 +1,121 @@
|
||||
<?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>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
</root>
|
301
remoteapp-tool/My Project/Settings.Designer.vb
generated
Normal file
301
remoteapp-tool/My Project/Settings.Designer.vb
generated
Normal file
@ -0,0 +1,301 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 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.
|
||||
' </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", "11.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 "My.Settings Auto-Save Functionality"
|
||||
#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
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("0")> _
|
||||
Public Property MainWindowWidth() As Long
|
||||
Get
|
||||
Return CType(Me("MainWindowWidth"),Long)
|
||||
End Get
|
||||
Set
|
||||
Me("MainWindowWidth") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("0")> _
|
||||
Public Property MainWindowHeight() As Long
|
||||
Get
|
||||
Return CType(Me("MainWindowHeight"),Long)
|
||||
End Get
|
||||
Set
|
||||
Me("MainWindowHeight") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedConnectionModeMSI() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedConnectionModeMSI"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedConnectionModeMSI") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedOpenWithNotepad() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedOpenWithNotepad"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedOpenWithNotepad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property SavedServerAddress() As String
|
||||
Get
|
||||
Return CType(Me("SavedServerAddress"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedServerAddress") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("3389")> _
|
||||
Public Property SavedServerPort() As Integer
|
||||
Get
|
||||
Return CType(Me("SavedServerPort"),Integer)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedServerPort") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property SavedAltServerAddress() As String
|
||||
Get
|
||||
Return CType(Me("SavedAltServerAddress"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedAltServerAddress") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedUseRDGateway() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedUseRDGateway"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedUseRDGateway") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property SavedRDGatewayAddress() As String
|
||||
Get
|
||||
Return CType(Me("SavedRDGatewayAddress"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedRDGatewayAddress") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedAttemptDirectRDGateway() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedAttemptDirectRDGateway"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedAttemptDirectRDGateway") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
|
||||
Public Property SavedMSIShortcutDesktop() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedMSIShortcutDesktop"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedMSIShortcutDesktop") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
|
||||
Public Property SavedMSIShortcutStart() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedMSIShortcutStart"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedMSIShortcutStart") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedMSIShortcutStartTopLevel() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedMSIShortcutStartTopLevel"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedMSIShortcutStartTopLevel") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
|
||||
Public Property SavedUseShortcutTag() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedUseShortcutTag"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedUseShortcutTag") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("remote")> _
|
||||
Public Property SavedShortcutTag() As String
|
||||
Get
|
||||
Return CType(Me("SavedShortcutTag"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedShortcutTag") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedClientConnectionOptions() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedClientConnectionOptions"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedClientConnectionOptions") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedCreateRAWebIcon() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedCreateRAWebIcon"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedCreateRAWebIcon") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedMSIPerUser() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedMSIPerUser"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedMSIPerUser") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Public Property SavedDisableFTA() As Boolean
|
||||
Get
|
||||
Return CType(Me("SavedDisableFTA"),Boolean)
|
||||
End Get
|
||||
Set
|
||||
Me("SavedDisableFTA") = value
|
||||
End Set
|
||||
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.RemoteApp_Tool.My.MySettings
|
||||
Get
|
||||
Return Global.RemoteApp_Tool.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
63
remoteapp-tool/My Project/Settings.settings
Normal file
63
remoteapp-tool/My Project/Settings.settings
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="MainWindowWidth" Type="System.Int64" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="MainWindowHeight" Type="System.Int64" Scope="User">
|
||||
<Value Profile="(Default)">0</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedConnectionModeMSI" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedOpenWithNotepad" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedServerAddress" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SavedServerPort" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">3389</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedAltServerAddress" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SavedUseRDGateway" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedRDGatewayAddress" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="SavedAttemptDirectRDGateway" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedMSIShortcutDesktop" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedMSIShortcutStart" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedMSIShortcutStartTopLevel" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedUseShortcutTag" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedShortcutTag" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">remote</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedClientConnectionOptions" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedCreateRAWebIcon" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedMSIPerUser" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="SavedDisableFTA" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
52
remoteapp-tool/My Project/app.manifest
Normal file
52
remoteapp-tool/My Project/app.manifest
Normal file
@ -0,0 +1,52 @@
|
||||
<?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 Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
<applicationRequestMinimum>
|
||||
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
</applicationRequestMinimum>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with.
|
||||
Windows will automatically select the most compatible environment.-->
|
||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
||||
</application>
|
||||
</compatibility>
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
</asmv1:assembly>
|
398
remoteapp-tool/RDP2MSImodule.vb
Normal file
398
remoteapp-tool/RDP2MSImodule.vb
Normal file
@ -0,0 +1,398 @@
|
||||
Module RDP2MSImodule
|
||||
|
||||
Public wxsPath
|
||||
Public wixobjPath
|
||||
Public wixpdbPath
|
||||
Public rdpFilePathD
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
Dim cmdRdpPath = ""
|
||||
Dim cmdSwitches = "DS"
|
||||
|
||||
LogText("RDP2MSI" & vbCrLf)
|
||||
If My.Application.CommandLineArgs.Count = 0 Then
|
||||
ShowUsage()
|
||||
End
|
||||
ElseIf My.Application.CommandLineArgs.Count = 1 Then
|
||||
cmdRdpPath = My.Application.CommandLineArgs(0)
|
||||
ElseIf My.Application.CommandLineArgs.Count = 2 Then
|
||||
If My.Application.CommandLineArgs(0).StartsWith("/") Then
|
||||
cmdSwitches = My.Application.CommandLineArgs(0)
|
||||
cmdRdpPath = My.Application.CommandLineArgs(1)
|
||||
Else
|
||||
cmdSwitches = My.Application.CommandLineArgs(1)
|
||||
cmdRdpPath = My.Application.CommandLineArgs(0)
|
||||
End If
|
||||
ElseIf My.Application.CommandLineArgs.Count > 2 Then
|
||||
LogText("Error: Too many parameters provided.", True)
|
||||
End If
|
||||
|
||||
Dim relCmdRdpPath = System.IO.Directory.GetCurrentDirectory & "\" & cmdRdpPath
|
||||
If Not cmdRdpPath.Contains(":") Then cmdRdpPath = relCmdRdpPath
|
||||
|
||||
If Not My.Computer.FileSystem.FileExists(cmdRdpPath) Then LogText("Error: Unable to find RDP file: " & cmdRdpPath, True)
|
||||
|
||||
If Not cmdSwitches.ToUpper.Contains("D") Then
|
||||
If Not cmdSwitches.ToUpper.Contains("S") Then
|
||||
cmdSwitches += "DS"
|
||||
End If
|
||||
End If
|
||||
|
||||
If cmdSwitches.ToUpper.Contains("~") Then LogText("Command line options: " & cmdSwitches.ToUpper)
|
||||
|
||||
RDP2MSI(cmdRdpPath, cmdSwitches.ToUpper)
|
||||
|
||||
'Console.Write("Press any key to continue...")
|
||||
'Console.ReadKey()
|
||||
End Sub
|
||||
|
||||
Private Sub LogText(TheText As String, Optional DoExit As Boolean = False)
|
||||
Console.WriteLine(TheText)
|
||||
If DoExit = True Then
|
||||
CleanupTempFiles()
|
||||
'End
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub RDP2MSI(rdpFilePath As String, Optional CmdParameters As String = "", Optional ShortcutTag As String = "", Optional AppPublisher As String = "", Optional FlatFileTypes As String = "", Optional PerUser As Boolean = False)
|
||||
|
||||
If Not My.Computer.FileSystem.FileExists(rdpFilePath) Then LogText("Error: Unable to find RDP file: " & rdpFilePath, True)
|
||||
If Not rdpFilePath.ToLower.EndsWith(".rdp") Then LogText("Error: Input file must be an RDP file.", True)
|
||||
If ReadRDPProperty(rdpFilePath, "remoteapplicationname") = "" Then LogText("Error: RDP file does not contain valid data.", True)
|
||||
|
||||
Dim rdpParentFolder = My.Computer.FileSystem.GetParentPath(rdpFilePath)
|
||||
LogText("Working folder: " & rdpParentFolder)
|
||||
|
||||
LogText("RDP file: " & rdpFilePath)
|
||||
Dim RemoteAppFullName = ReadRDPProperty(rdpFilePath, "remoteapplicationname")
|
||||
LogText("App full name: " & RemoteAppFullName)
|
||||
Dim RemoteAppShortName = ReadRDPProperty(rdpFilePath, "remoteapplicationprogram")
|
||||
LogText("App short name: " & RemoteAppShortName)
|
||||
|
||||
Dim UpgradeCode
|
||||
If CmdParameters.ToUpper.Contains("A") Then
|
||||
UpgradeCode = GenerateGUIDfromString(RemoteAppShortName)
|
||||
Else
|
||||
Dim Rnd = New Random()
|
||||
UpgradeCode = GenerateGUIDfromString(Rnd.Next)
|
||||
End If
|
||||
LogText("Upgrade code: " & UpgradeCode)
|
||||
|
||||
Dim IconFilePath = Left(rdpFilePath, rdpFilePath.Length - 4) & ".ico"
|
||||
|
||||
Dim HasIcon = False
|
||||
If My.Computer.FileSystem.FileExists(IconFilePath) Then
|
||||
HasIcon = True
|
||||
LogText("Icon found: " & IconFilePath)
|
||||
Else
|
||||
LogText("Icon not found.")
|
||||
End If
|
||||
|
||||
'Dim shortcutTag = ReadIni(My.Application.Info.DirectoryPath & "\rdp2msi.ini", "Settings", "ShortcutTag", "remote")
|
||||
If CmdParameters.ToUpper.Contains("T") Then ShortcutTag = ""
|
||||
|
||||
'Dim appPublisher = ReadIni(My.Application.Info.DirectoryPath & "\rdp2msi.ini", "Settings", "AppPublisher", "")
|
||||
Dim rdpFileName = My.Computer.FileSystem.GetFileInfo(rdpFilePath).Name
|
||||
Dim ProductFileName = Left(rdpFileName, rdpFileName.Length - 4)
|
||||
|
||||
Dim wxsString = GenerateWXSString(ProductFileName, RemoteAppFullName, AppPublisher, HasIcon, , UpgradeCode, ShortcutTag, CmdParameters, FlatFileTypes, PerUser)
|
||||
wxsPath = rdpParentFolder & "\" & ProductFileName & ".wxs"
|
||||
wixobjPath = rdpParentFolder & "\" & ProductFileName & ".wixobj"
|
||||
wixpdbPath = rdpParentFolder & "\" & ProductFileName & ".wixpdb"
|
||||
Dim msiPath = rdpParentFolder & "\" & ProductFileName & ".msi"
|
||||
|
||||
Dim FilesToDelete As New ArrayList
|
||||
FilesToDelete.Add(rdpFilePath)
|
||||
FilesToDelete.Add(wxsPath)
|
||||
FilesToDelete.Add(wixobjPath)
|
||||
FilesToDelete.Add(wixpdbPath)
|
||||
|
||||
My.Computer.FileSystem.WriteAllText(wxsPath, wxsString, False)
|
||||
|
||||
Dim wixPath = FindWixPath()
|
||||
If wixPath = "" Then
|
||||
LogText("Error: Unable to locate the WiX Toolset. Exiting.", True)
|
||||
Else
|
||||
LogText("Found WiX Toolset in: " & wixPath)
|
||||
End If
|
||||
|
||||
Dim CandlePath = wixPath & "\candle.exe "
|
||||
Dim LightPath = wixPath & "\light.exe "
|
||||
|
||||
LogText("Invoking candle.exe from WiX Toolset")
|
||||
Dim CandleExitCode = RunWait(CandlePath, "-out """ & wixobjPath & """ """ & wxsPath & """")
|
||||
If CandleExitCode = 0 Then
|
||||
LogText("candle.exe executed successfully.")
|
||||
Else
|
||||
LogText("Error: candle.exe returned an error.", True)
|
||||
End If
|
||||
|
||||
LogText("Invoking light.exe from WiX Toolset")
|
||||
Dim LightExitCode = RunWait(LightPath, " -out """ & msiPath & """ """ & wixobjPath & """")
|
||||
If LightExitCode = 0 Then
|
||||
LogText("light.exe executed successfully.")
|
||||
Else
|
||||
LogText("Error: light.exe returned an error.", True)
|
||||
End If
|
||||
|
||||
If Not CmdParameters.Contains("~") Then
|
||||
DeleteFiles(FilesToDelete)
|
||||
End If
|
||||
|
||||
If My.Computer.FileSystem.FileExists(msiPath) Then
|
||||
LogText(My.Computer.FileSystem.GetFileInfo(msiPath).Name & " created successfully.")
|
||||
Else
|
||||
LogText("Error: MSI creation failed.", True)
|
||||
MsgBox("MSI creation failed.", MsgBoxStyle.Critical, "Error")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub CleanupTempFiles()
|
||||
If My.Computer.FileSystem.FileExists(rdpFilePathD) Then My.Computer.FileSystem.DeleteFile(rdpFilePathD)
|
||||
If My.Computer.FileSystem.FileExists(wxsPath) Then My.Computer.FileSystem.DeleteFile(wxsPath)
|
||||
If My.Computer.FileSystem.FileExists(wixobjPath) Then My.Computer.FileSystem.DeleteFile(wixobjPath)
|
||||
If My.Computer.FileSystem.FileExists(wixpdbPath) Then My.Computer.FileSystem.DeleteFile(wixpdbPath)
|
||||
End Sub
|
||||
|
||||
Function FindWixPath()
|
||||
LogText("Locating WiX Toolset")
|
||||
Dim searchExe = "\candle.exe"
|
||||
Dim wixPath = ""
|
||||
Dim wixIniPath = ReadIni(My.Application.Info.DirectoryPath & "\rdp2msi.ini", "WIX", "binpath", My.Application.Info.DirectoryPath & "\wix").TrimEnd(Chr(92))
|
||||
If My.Computer.FileSystem.FileExists(wixIniPath & searchExe) Then
|
||||
wixPath = wixIniPath
|
||||
ElseIf Environment.GetEnvironmentVariable("WIX") <> "" Then
|
||||
wixPath = Environment.GetEnvironmentVariable("WIX") & "bin"
|
||||
ElseIf My.Computer.FileSystem.DirectoryExists(My.Application.Info.DirectoryPath & "\wix\" & searchExe) Then
|
||||
wixPath = My.Application.Info.DirectoryPath & "\wix"
|
||||
ElseIf My.Computer.FileSystem.DirectoryExists(My.Application.Info.DirectoryPath & "\bin\" & searchExe) Then
|
||||
wixPath = My.Application.Info.DirectoryPath & "\bin"
|
||||
End If
|
||||
Return wixPath
|
||||
End Function
|
||||
|
||||
Sub ShowUsage()
|
||||
LogText("Usage: rdp2msi.exe [/DSNAT] rdpfile.rdp")
|
||||
LogText("")
|
||||
LogText("Switches:")
|
||||
LogText("")
|
||||
LogText(" /D MSI will deploy desktop shortcut")
|
||||
LogText(" /S MSI will deploy shortcut in Start Menu > Programs > (AppName)")
|
||||
LogText(" /N Requires /S. MSI will not create subfolder in Start Menu > Programs")
|
||||
LogText(" /A Generate upgrade code based on app name, otherwise it is random")
|
||||
LogText(" /T Do not include the (remote) tag on deployed shortcuts")
|
||||
LogText("")
|
||||
LogText("If no switches are specified, /DS is implied.")
|
||||
LogText("")
|
||||
End Sub
|
||||
|
||||
Function GenerateWXSString(ProductFileName As String, ProductName As String, Optional ProductPublisher As String = "", Optional HasIcon As Boolean = False, Optional ProductVersion As String = "1.0.0.0", Optional ProductUpgradeCode As String = "random", Optional ProductRemoteTag As String = "remote", Optional ShortcutLocations As String = "DS", Optional FlatFileTypes As String = "", Optional PerUser As Boolean = False)
|
||||
Dim Rnd = New Random()
|
||||
|
||||
If ProductUpgradeCode = "random" Then ProductUpgradeCode = GenerateGUIDfromString(Rnd.Next)
|
||||
If ProductPublisher = "" Then ProductPublisher = ProductName
|
||||
|
||||
Dim RegRoot = "HKLM"
|
||||
If PerUser = True Then RegRoot = "HKCU"
|
||||
|
||||
Dim FileTypes As New ArrayList
|
||||
If Not FlatFileTypes = "" Then FileTypes.AddRange(Split(FlatFileTypes, "|"))
|
||||
|
||||
Dim AppFilesGuid = GenerateGUIDfromString("AppFiles" & ProductUpgradeCode)
|
||||
Dim AppStartShortcutsGuid = GenerateGUIDfromString("AppStartShortcuts" & ProductUpgradeCode)
|
||||
Dim AppDeskShortcutsGuid = GenerateGUIDfromString("AppDeskShortcuts" & ProductUpgradeCode)
|
||||
|
||||
Dim wxsString = "<?xml version=""1.0""?>" & vbCrLf
|
||||
wxsString += "<?define ProductVersion = """ & ProductVersion & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductUpgradeCode = """ & ProductUpgradeCode & """?>" & vbCrLf
|
||||
wxsString += "<?define AppFilesGuid = """ & AppFilesGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define AppStartShortcutsGuid = """ & AppStartShortcutsGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define AppDeskShortcutsGuid = """ & AppDeskShortcutsGuid & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductName = """ & ProductName & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductPublisher = """ & ProductPublisher & """?>" & vbCrLf
|
||||
wxsString += "<?define ProductFileName = """ & ProductFileName & """?>" & vbCrLf
|
||||
wxsString += "<?define RegRoot = """ & RegRoot & """?>" & vbCrLf
|
||||
If Not ProductRemoteTag = "" Then ProductRemoteTag = " (" & ProductRemoteTag & ")"
|
||||
wxsString += "<?define ProductRemoteTag = """ & ProductRemoteTag & """?>" & vbCrLf
|
||||
wxsString += "<Wix xmlns=""http://schemas.microsoft.com/wix/2006/wi"">" & vbCrLf
|
||||
|
||||
wxsString += " <Product Id=""*"" UpgradeCode=""$(var.ProductUpgradeCode)"" " & vbCrLf
|
||||
wxsString += " Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Version=""$(var.ProductVersion)"" Manufacturer=""$(var.ProductPublisher)"" Language=""1033"">" & vbCrLf
|
||||
wxsString += " <Package InstallerVersion=""200"" Compressed=""yes"" Comments=""Windows Installer Package"""
|
||||
If Not PerUser Then
|
||||
wxsString += " InstallScope=""perMachine"""
|
||||
Else
|
||||
wxsString += " InstallPrivileges=""limited"""
|
||||
End If
|
||||
|
||||
wxsString += "/>" & vbCrLf
|
||||
wxsString += " <Media Id=""1"" Cabinet=""rdp2msi.cab"" EmbedCab=""yes""/>" & vbCrLf
|
||||
If Not PerUser Then wxsString += " <Property Id=""AllUSERS"" Value=""1""/>" & vbCrLf
|
||||
wxsString += " <Upgrade Id=""$(var.ProductUpgradeCode)"">" & vbCrLf
|
||||
wxsString += " <UpgradeVersion Minimum=""$(var.ProductVersion)"" OnlyDetect=""yes"" Property=""NEWERVERSIONDETECTED""/>" & vbCrLf
|
||||
wxsString += " <UpgradeVersion Minimum=""0.0.0"" Maximum=""$(var.ProductVersion)"" IncludeMinimum=""yes"" IncludeMaximum=""no"" " & vbCrLf
|
||||
wxsString += " Property=""OLDERVERSIONBEINGUPGRADED""/> " & vbCrLf
|
||||
wxsString += " </Upgrade>" & vbCrLf
|
||||
wxsString += " <Condition Message=""A newer version of this software is already installed."">NOT NEWERVERSIONDETECTED</Condition>" & vbCrLf
|
||||
wxsString += " <Property Id=""MstscProperty"" Value=""mstsc.exe""/>" & vbCrLf
|
||||
wxsString += " <Directory Id=""TARGETDIR"" Name=""SourceDir"">" & vbCrLf
|
||||
If Not PerUser Then
|
||||
wxsString += " <Directory Id=""ProgramFilesFolder"">" & vbCrLf
|
||||
Else
|
||||
wxsString += " <Directory Id=""LocalAppDataFolder"">" & vbCrLf
|
||||
End If
|
||||
wxsString += " <Directory Id=""INSTALLDIR"" Name=""RemotePackages"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationFiles"" Guid=""$(var.AppFilesGuid)"">" & vbCrLf
|
||||
wxsString += " <File Id=""rdpFile1"" Source=""$(var.ProductFileName).rdp""/>" & vbCrLf
|
||||
If HasIcon Then wxsString += " <File Id=""rdpIcon1"" Source=""$(var.ProductFileName).ico""/>" & vbCrLf
|
||||
If Not FlatFileTypes = "" Then
|
||||
For Each FileType In FileTypes
|
||||
wxsString += " <File Id=""$(var.ProductFileName)_" & FileType & ".ico"" Source=""$(var.ProductFileName)_" & FileType & ".ico"" />" & vbCrLf
|
||||
wxsString += " <ProgId Id=""remote.$(var.ProductFileName)." & FileType & "file"" Description=""$(var.ProductName) " & FileType & " file"" Icon=""$(var.ProductFileName)_" & FileType & ".ico"">" & vbCrLf
|
||||
wxsString += " <Extension Id=""" & FileType & """ ContentType=""application/" & FileType & """>" & vbCrLf
|
||||
wxsString += " <Verb Id=""open"" Command=""Open"" TargetProperty='MstscProperty' Argument='/REMOTEFILE:""%1"" ""[INSTALLDIR]$(var.ProductFileName).rdp""' />" & vbCrLf
|
||||
wxsString += " </Extension>" & vbCrLf
|
||||
wxsString += " </ProgId>" & vbCrLf
|
||||
Next
|
||||
End If
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
|
||||
If ShortcutLocations.ToUpper.Contains("S") Then
|
||||
wxsString += " <Directory Id=""ProgramMenuFolder"">" & vbCrLf
|
||||
If Not ShortcutLocations.ToUpper.Contains("N") Then wxsString += " <Directory Id=""ProgramMenuSubfolder"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationStartShortcuts"" Guid=""$(var.AppStartShortcutsGuid)"">" & vbCrLf
|
||||
wxsString += " <Shortcut Id=""rdpStartShortcut1"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Description=""$(var.ProductName)$(var.ProductRemoteTag)"" " & vbCrLf
|
||||
wxsString += " Target=""[INSTALLDIR]$(var.ProductFileName).rdp"" WorkingDirectory=""INSTALLDIR"""
|
||||
|
||||
If HasIcon Then
|
||||
wxsString += " Icon=""rdpStartIcon.rdp"" IconIndex=""0"">" & vbCrLf
|
||||
wxsString += " <Icon Id=""rdpStartIcon.rdp"" SourceFile=""$(var.ProductFileName).ico"" />" & vbCrLf
|
||||
wxsString += " </Shortcut>" & vbCrLf
|
||||
Else
|
||||
wxsString += "/>" & vbCrLf
|
||||
End If
|
||||
|
||||
wxsString += " <RegistryValue Root=""$(var.RegRoot)"" Key=""Software\RDP2MSI\$(var.ProductName)"" " & vbCrLf
|
||||
wxsString += " Name=""installed"" Type=""integer"" Value=""1"" KeyPath=""yes""/>" & vbCrLf
|
||||
wxsString += " <RemoveFolder Id=""ProgramMenuSubfolder"" On=""uninstall""/>" & vbCrLf
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
If Not ShortcutLocations.ToUpper.Contains("N") Then wxsString += " </Directory>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
End If
|
||||
|
||||
If ShortcutLocations.ToUpper.Contains("D") Then
|
||||
wxsString += " <Directory Id=""DesktopFolder"">" & vbCrLf
|
||||
wxsString += " <Component Id=""ApplicationDesktopShortcuts"" Guid=""$(var.AppDeskShortcutsGuid)"">" & vbCrLf
|
||||
wxsString += " <Shortcut Id=""rdpDesktopShortcut1"" Name=""$(var.ProductName)$(var.ProductRemoteTag)"" Description=""$(var.ProductName)$(var.ProductRemoteTag)"" " & vbCrLf
|
||||
wxsString += " Target=""[INSTALLDIR]$(var.ProductFileName).rdp"" WorkingDirectory=""INSTALLDIR"""
|
||||
|
||||
If HasIcon Then
|
||||
wxsString += " Icon=""rdpDeskIcon.rdp"" IconIndex=""0"">" & vbCrLf
|
||||
wxsString += " <Icon Id=""rdpDeskIcon.rdp"" SourceFile=""$(var.ProductFileName).ico"" />" & vbCrLf
|
||||
wxsString += " </Shortcut>" & vbCrLf
|
||||
Else
|
||||
wxsString += "/>" & vbCrLf
|
||||
End If
|
||||
|
||||
|
||||
wxsString += " <RegistryValue Root=""$(var.RegRoot)"" Key=""Software\RDP2MSI\$(var.ProductName)"" " & vbCrLf
|
||||
wxsString += " Name=""installed"" Type=""integer"" Value=""1"" KeyPath=""yes""/>" & vbCrLf
|
||||
wxsString += " </Component>" & vbCrLf
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
End If
|
||||
wxsString += " </Directory>" & vbCrLf
|
||||
|
||||
wxsString += " <InstallExecuteSequence>" & vbCrLf
|
||||
wxsString += " <RemoveExistingProducts After=""InstallValidate""/>" & vbCrLf
|
||||
wxsString += " </InstallExecuteSequence>" & vbCrLf
|
||||
wxsString += " "
|
||||
wxsString += " <Feature Id=""DefaultFeature"" Level=""1"">" & vbCrLf
|
||||
wxsString += " <ComponentRef Id=""ApplicationFiles""/>" & vbCrLf
|
||||
If ShortcutLocations.ToUpper.Contains("S") Then wxsString += " <ComponentRef Id=""ApplicationStartShortcuts""/>" & vbCrLf
|
||||
If ShortcutLocations.ToUpper.Contains("D") Then wxsString += " <ComponentRef Id=""ApplicationDesktopShortcuts""/>" & vbCrLf
|
||||
wxsString += " </Feature>" & vbCrLf
|
||||
If HasIcon Then
|
||||
wxsString += "<Icon Id=""rdpARPIcon.rdp"" SourceFile=""$(var.ProductFileName).ico"" />" & vbCrLf
|
||||
wxsString += "<Property Id=""ARPPRODUCTICON"" Value=""rdpARPIcon.rdp"" />" & vbCrLf
|
||||
End If
|
||||
wxsString += " </Product>" & vbCrLf
|
||||
wxsString += "</Wix>" & vbCrLf
|
||||
|
||||
Return wxsString
|
||||
|
||||
End Function
|
||||
|
||||
Function ReadRDPProperty(rdpFile As String, rdpProperty As String) As String
|
||||
Dim rdpFileContents = My.Computer.FileSystem.ReadAllText(rdpFile)
|
||||
Dim rdpFileLines = Split(rdpFileContents, vbLf)
|
||||
Dim rdpValue = ""
|
||||
For Each rdpLine In rdpFileLines
|
||||
rdpLine = Replace(rdpLine, vbCr, "")
|
||||
rdpLine = Replace(rdpLine, "|", "")
|
||||
Dim rdpLineSplit = Split(rdpLine, ":", 3)
|
||||
If rdpLineSplit(0) = rdpProperty Then
|
||||
rdpValue = rdpLineSplit(2)
|
||||
End If
|
||||
Next
|
||||
Return rdpValue
|
||||
End Function
|
||||
|
||||
Private Function GenerateGUIDfromString(TheString As String)
|
||||
Dim TheHash = getMD5Hash(TheString)
|
||||
Dim MyGuid As Guid = New Guid(TheHash)
|
||||
Return MyGuid.ToString
|
||||
End Function
|
||||
|
||||
Private Function getMD5Hash(ByVal strToHash As String) As String
|
||||
Dim md5Obj As New System.Security.Cryptography.MD5CryptoServiceProvider()
|
||||
Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
|
||||
|
||||
bytesToHash = md5Obj.ComputeHash(bytesToHash)
|
||||
|
||||
Dim strResult As String = ""
|
||||
Dim b As Byte
|
||||
|
||||
For Each b In bytesToHash
|
||||
strResult += b.ToString("x2")
|
||||
Next
|
||||
|
||||
Return strResult
|
||||
End Function
|
||||
|
||||
Private Declare Unicode Function WritePrivateProfileString Lib "kernel32" _
|
||||
Alias "WritePrivateProfileStringW" (ByVal lpApplicationName As String, _
|
||||
ByVal lpKeyName As String, ByVal lpString As String, _
|
||||
ByVal lpFileName As String) As Int32
|
||||
|
||||
Private Declare Unicode Function GetPrivateProfileString Lib "kernel32" _
|
||||
Alias "GetPrivateProfileStringW" (ByVal lpApplicationName As String, _
|
||||
ByVal lpKeyName As String, ByVal lpDefault As String, _
|
||||
ByVal lpReturnedString As String, ByVal nSize As Int32, _
|
||||
ByVal lpFileName As String) As Int32
|
||||
|
||||
Public Sub writeIni(ByVal iniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamVal As String)
|
||||
Dim Result As Integer = WritePrivateProfileString(Section, ParamName, ParamVal, iniFileName)
|
||||
End Sub
|
||||
|
||||
Public Function ReadIni(ByVal IniFileName As String, ByVal Section As String, ByVal ParamName As String, ByVal ParamDefault As String) As String
|
||||
Dim ParamVal As String = Space$(1024)
|
||||
Dim LenParamVal As Long = GetPrivateProfileString(Section, ParamName, ParamDefault, ParamVal, Len(ParamVal), IniFileName)
|
||||
ReadIni = Left$(ParamVal, LenParamVal)
|
||||
End Function
|
||||
|
||||
Public Function RunWait(App As String, Parameters As String) As Integer
|
||||
Dim proc As New Process
|
||||
proc.StartInfo.CreateNoWindow = True
|
||||
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
|
||||
proc.StartInfo.FileName = App
|
||||
proc.StartInfo.Arguments = Parameters
|
||||
proc.Start()
|
||||
proc.WaitForExit()
|
||||
Return proc.ExitCode
|
||||
End Function
|
||||
|
||||
End Module
|
52
remoteapp-tool/RemoteApp Tool.sln
Normal file
52
remoteapp-tool/RemoteApp Tool.sln
Normal file
@ -0,0 +1,52 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RemoteApp Tool", "RemoteApp Tool.vbproj", "{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{785B6808-B2FE-4C18-9D63-6DAB46482374} = {785B6808-B2FE-4C18-9D63-6DAB46482374}
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906} = {E1CB5F9C-230F-4967-8F19-335F8E4A4906}
|
||||
{258307D5-A407-4622-BF1A-BDCA8E3D2FAA} = {258307D5-A407-4622-BF1A-BDCA8E3D2FAA}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RemoteAppLib", "..\RemoteAppLib\RemoteAppLib.vbproj", "{785B6808-B2FE-4C18-9D63-6DAB46482374}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDP2MSILib", "..\RDP2MSILib\RDP2MSILib.vbproj", "{E1CB5F9C-230F-4967-8F19-335F8E4A4906}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDP2MSI", "..\RDP2MSI\RDP2MSI.vbproj", "{1001A958-40DB-4444-9CD7-09D1188072D1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906} = {E1CB5F9C-230F-4967-8F19-335F8E4A4906}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDPFileLib", "..\RDPFileLib\RDPFileLib.vbproj", "{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{785B6808-B2FE-4C18-9D63-6DAB46482374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{785B6808-B2FE-4C18-9D63-6DAB46482374}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{785B6808-B2FE-4C18-9D63-6DAB46482374}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{785B6808-B2FE-4C18-9D63-6DAB46482374}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E1CB5F9C-230F-4967-8F19-335F8E4A4906}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1001A958-40DB-4444-9CD7-09D1188072D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1001A958-40DB-4444-9CD7-09D1188072D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1001A958-40DB-4444-9CD7-09D1188072D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1001A958-40DB-4444-9CD7-09D1188072D1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{258307D5-A407-4622-BF1A-BDCA8E3D2FAA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
292
remoteapp-tool/RemoteApp Tool.vbproj
Normal file
292
remoteapp-tool/RemoteApp Tool.vbproj
Normal file
@ -0,0 +1,292 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{2D140FE4-0794-43AC-BE7B-9D918B3F9C61}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<StartupObject>RemoteApp_Tool.My.MyApplication</StartupObject>
|
||||
<RootNamespace>RemoteApp_Tool</RootNamespace>
|
||||
<AssemblyName>RemoteApp Tool</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<DelaySign>False</DelaySign>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</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>RemoteApp Tool.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>RemoteApp Tool.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>add-window.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>BB4C8620F86E472788E1B361CE835B5A7E437B86</ManifestCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestKeyFile>RemoteApp Tool_TemporaryKey.pfx</ManifestKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>false</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignManifests>true</SignManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetZone>LocalIntranet</TargetZone>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<Optimize>False</Optimize>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<BaseAddress>4194304</BaseAddress>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="IconLib, Version=0.73.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\IconLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ApplicationEvents.vb" />
|
||||
<Compile Include="HelpSystem.vb" />
|
||||
<Compile Include="IconModule.vb" />
|
||||
<Compile Include="LocalFtaModule.vb" />
|
||||
<Compile Include="RemoteAppCreateClientConnection.Designer.vb">
|
||||
<DependentUpon>RemoteAppCreateClientConnection.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppCreateClientConnection.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppFileTypeAssociation.Designer.vb">
|
||||
<DependentUpon>RemoteAppFileTypeAssociation.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppFileTypeAssociation.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppAboutWindow.Designer.vb">
|
||||
<DependentUpon>RemoteAppAboutWindow.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppAboutWindow.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppFunctions.vb" />
|
||||
<Compile Include="RemoteAppHostOptions.Designer.vb">
|
||||
<DependentUpon>RemoteAppHostOptions.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppHostOptions.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppEditWindow.Designer.vb">
|
||||
<DependentUpon>RemoteAppEditWindow.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppEditWindow.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppIconPicker.Designer.vb">
|
||||
<DependentUpon>RemoteAppIconPicker.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppIconPicker.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppMainWindow.Designer.vb">
|
||||
<DependentUpon>RemoteAppMainWindow.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RemoteAppMainWindow.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="RemoteAppAboutWindow.resx">
|
||||
<DependentUpon>RemoteAppAboutWindow.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppCreateClientConnection.resx">
|
||||
<DependentUpon>RemoteAppCreateClientConnection.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppFileTypeAssociation.resx">
|
||||
<DependentUpon>RemoteAppFileTypeAssociation.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppHostOptions.resx">
|
||||
<DependentUpon>RemoteAppHostOptions.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppEditWindow.resx">
|
||||
<DependentUpon>RemoteAppEditWindow.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppIconPicker.resx">
|
||||
<DependentUpon>RemoteAppIconPicker.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="RemoteAppMainWindow.resx">
|
||||
<DependentUpon>RemoteAppMainWindow.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.manifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<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">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="RemoteApp Tool_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 4.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="add-window.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\RDP2MSILib\RDP2MSILib.vbproj">
|
||||
<Project>{e1cb5f9c-230f-4967-8f19-335f8e4a4906}</Project>
|
||||
<Name>RDP2MSILib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\RDPFileLib\RDPFileLib.vbproj">
|
||||
<Project>{258307d5-a407-4622-bf1a-bdca8e3d2faa}</Project>
|
||||
<Name>RDPFileLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\RemoteAppLib\RemoteAppLib.vbproj">
|
||||
<Project>{785b6808-b2fe-4c18-9d63-6dab46482374}</Project>
|
||||
<Name>RemoteAppLib</Name>
|
||||
</ProjectReference>
|
||||
</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>
|
BIN
remoteapp-tool/RemoteApp Tool_TemporaryKey.pfx
Normal file
BIN
remoteapp-tool/RemoteApp Tool_TemporaryKey.pfx
Normal file
Binary file not shown.
152
remoteapp-tool/RemoteAppAboutWindow.Designer.vb
generated
Normal file
152
remoteapp-tool/RemoteAppAboutWindow.Designer.vb
generated
Normal file
@ -0,0 +1,152 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppAboutWindow
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppAboutWindow))
|
||||
Me.TitleLabel = New System.Windows.Forms.Label()
|
||||
Me.VersionLabel = New System.Windows.Forms.Label()
|
||||
Me.CopyrightLabel = New System.Windows.Forms.Label()
|
||||
Me.SiteLinkLabel = New System.Windows.Forms.LinkLabel()
|
||||
Me.IconLibCreatedByLabel = New System.Windows.Forms.Label()
|
||||
Me.IconLibLabel = New System.Windows.Forms.Label()
|
||||
Me.IconLibLinkLabel = New System.Windows.Forms.LinkLabel()
|
||||
Me.IconLibLicenceTextLabel = New System.Windows.Forms.Label()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'TitleLabel
|
||||
'
|
||||
Me.TitleLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.TitleLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.TitleLabel.Location = New System.Drawing.Point(17, 9)
|
||||
Me.TitleLabel.Name = "TitleLabel"
|
||||
Me.TitleLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.TitleLabel.TabIndex = 0
|
||||
Me.TitleLabel.Text = "RemoteApp Tool"
|
||||
Me.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'VersionLabel
|
||||
'
|
||||
Me.VersionLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.VersionLabel.Location = New System.Drawing.Point(17, 39)
|
||||
Me.VersionLabel.Name = "VersionLabel"
|
||||
Me.VersionLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.VersionLabel.TabIndex = 0
|
||||
Me.VersionLabel.Text = "Version 0.0.0.0"
|
||||
Me.VersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'CopyrightLabel
|
||||
'
|
||||
Me.CopyrightLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.CopyrightLabel.Location = New System.Drawing.Point(17, 69)
|
||||
Me.CopyrightLabel.Name = "CopyrightLabel"
|
||||
Me.CopyrightLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.CopyrightLabel.TabIndex = 0
|
||||
Me.CopyrightLabel.Text = "Created by Kim Knight"
|
||||
Me.CopyrightLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'SiteLinkLabel
|
||||
'
|
||||
Me.SiteLinkLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.SiteLinkLabel.Location = New System.Drawing.Point(17, 99)
|
||||
Me.SiteLinkLabel.Name = "SiteLinkLabel"
|
||||
Me.SiteLinkLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.SiteLinkLabel.TabIndex = 1
|
||||
Me.SiteLinkLabel.TabStop = True
|
||||
Me.SiteLinkLabel.Text = "www.kimknight.net/remoteapptool"
|
||||
Me.SiteLinkLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'IconLibCreatedByLabel
|
||||
'
|
||||
Me.IconLibCreatedByLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.IconLibCreatedByLabel.Location = New System.Drawing.Point(17, 159)
|
||||
Me.IconLibCreatedByLabel.Name = "IconLibCreatedByLabel"
|
||||
Me.IconLibCreatedByLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.IconLibCreatedByLabel.TabIndex = 4
|
||||
Me.IconLibCreatedByLabel.Text = "Created by CastorTiu"
|
||||
Me.IconLibCreatedByLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'IconLibLabel
|
||||
'
|
||||
Me.IconLibLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.IconLibLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.IconLibLabel.Location = New System.Drawing.Point(17, 129)
|
||||
Me.IconLibLabel.Name = "IconLibLabel"
|
||||
Me.IconLibLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.IconLibLabel.TabIndex = 5
|
||||
Me.IconLibLabel.Text = "IconLib"
|
||||
Me.IconLibLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'IconLibLinkLabel
|
||||
'
|
||||
Me.IconLibLinkLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.IconLibLinkLabel.Location = New System.Drawing.Point(17, 219)
|
||||
Me.IconLibLinkLabel.Name = "IconLibLinkLabel"
|
||||
Me.IconLibLinkLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.IconLibLinkLabel.TabIndex = 1
|
||||
Me.IconLibLinkLabel.TabStop = True
|
||||
Me.IconLibLinkLabel.Text = "http://creativecommons.org/licenses/by-sa/3.0/"
|
||||
Me.IconLibLinkLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'IconLibLicenceTextLabel
|
||||
'
|
||||
Me.IconLibLicenceTextLabel.Anchor = System.Windows.Forms.AnchorStyles.Top
|
||||
Me.IconLibLicenceTextLabel.Location = New System.Drawing.Point(17, 189)
|
||||
Me.IconLibLicenceTextLabel.Name = "IconLibLicenceTextLabel"
|
||||
Me.IconLibLicenceTextLabel.Size = New System.Drawing.Size(263, 30)
|
||||
Me.IconLibLicenceTextLabel.TabIndex = 4
|
||||
Me.IconLibLicenceTextLabel.Text = "Licensed under a Creative Commons" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Attribution-Share Alike 3.0 Unported License"
|
||||
Me.IconLibLicenceTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
'
|
||||
'RemoteAppAboutWindow
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.ClientSize = New System.Drawing.Size(298, 267)
|
||||
Me.Controls.Add(Me.IconLibLicenceTextLabel)
|
||||
Me.Controls.Add(Me.IconLibCreatedByLabel)
|
||||
Me.Controls.Add(Me.IconLibLabel)
|
||||
Me.Controls.Add(Me.IconLibLinkLabel)
|
||||
Me.Controls.Add(Me.SiteLinkLabel)
|
||||
Me.Controls.Add(Me.CopyrightLabel)
|
||||
Me.Controls.Add(Me.VersionLabel)
|
||||
Me.Controls.Add(Me.TitleLabel)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "RemoteAppAboutWindow"
|
||||
Me.Text = "RemoteAppAboutWindow"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents TitleLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents VersionLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents CopyrightLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents SiteLinkLabel As System.Windows.Forms.LinkLabel
|
||||
Friend WithEvents IconLibCreatedByLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents IconLibLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents IconLibLinkLabel As System.Windows.Forms.LinkLabel
|
||||
Friend WithEvents IconLibLicenceTextLabel As System.Windows.Forms.Label
|
||||
End Class
|
6334
remoteapp-tool/RemoteAppAboutWindow.resx
Normal file
6334
remoteapp-tool/RemoteAppAboutWindow.resx
Normal file
File diff suppressed because it is too large
Load Diff
27
remoteapp-tool/RemoteAppAboutWindow.vb
Normal file
27
remoteapp-tool/RemoteAppAboutWindow.vb
Normal file
@ -0,0 +1,27 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
|
||||
Public Class RemoteAppAboutWindow
|
||||
|
||||
Private Sub RemoteAppAboutWindow_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Me.Text = "About " & My.Application.Info.Title
|
||||
Me.TitleLabel.Text = My.Application.Info.Title
|
||||
Me.VersionLabel.Text = "Version " & My.Application.Info.Version.ToString
|
||||
End Sub
|
||||
|
||||
Private Sub SiteLinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles SiteLinkLabel.LinkClicked
|
||||
System.Diagnostics.Process.Start("http://www.kimknight.net/remoteapptool")
|
||||
End Sub
|
||||
|
||||
Private Sub IconLibLinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles IconLibLinkLabel.LinkClicked
|
||||
System.Diagnostics.Process.Start("http://creativecommons.org/licenses/by-sa/3.0/")
|
||||
End Sub
|
||||
|
||||
Private Sub ralibLinkLabel_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)
|
||||
System.Diagnostics.Process.Start("http://www.kimknight.net/")
|
||||
End Sub
|
||||
|
||||
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs)
|
||||
System.Diagnostics.Process.Start("http://www.kimknight.net/")
|
||||
End Sub
|
||||
End Class
|
628
remoteapp-tool/RemoteAppCreateClientConnection.Designer.vb
generated
Normal file
628
remoteapp-tool/RemoteAppCreateClientConnection.Designer.vb
generated
Normal file
@ -0,0 +1,628 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppCreateClientConnection
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppCreateClientConnection))
|
||||
Me.EditAfterSave = New System.Windows.Forms.CheckBox()
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.CreateButton = New System.Windows.Forms.Button()
|
||||
Me.FileSaveRDP = New System.Windows.Forms.SaveFileDialog()
|
||||
Me.CancelEditButton = New System.Windows.Forms.Button()
|
||||
Me.ServerGroupBox = New System.Windows.Forms.GroupBox()
|
||||
Me.Label13 = New System.Windows.Forms.Label()
|
||||
Me.Label14 = New System.Windows.Forms.Label()
|
||||
Me.Label12 = New System.Windows.Forms.Label()
|
||||
Me.ServerPort = New System.Windows.Forms.TextBox()
|
||||
Me.AltServerAddress = New System.Windows.Forms.TextBox()
|
||||
Me.ServerAddress = New System.Windows.Forms.TextBox()
|
||||
Me.RDGWGroupBox = New System.Windows.Forms.GroupBox()
|
||||
Me.AttemptDirectCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.UseRDGatewayCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.RDGWLabel = New System.Windows.Forms.Label()
|
||||
Me.GatewayAddress = New System.Windows.Forms.TextBox()
|
||||
Me.ClientConnectionGroupBox = New System.Windows.Forms.GroupBox()
|
||||
Me.MSIRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.RDPRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.CreateRAWebIcon = New System.Windows.Forms.CheckBox()
|
||||
Me.FTAButton = New System.Windows.Forms.Button()
|
||||
Me.FileBrowserIcon = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.FileSaveMSI = New System.Windows.Forms.SaveFileDialog()
|
||||
Me.ShortcutDesktopCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.MSIGroupBox = New System.Windows.Forms.GroupBox()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.PerMachineRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.PerUserRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.TopLevelRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.SubfolderRadioButton = New System.Windows.Forms.RadioButton()
|
||||
Me.ShortcutStartCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.ShortcutTagCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.ShortcutTagTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.ResetButton = New System.Windows.Forms.Button()
|
||||
Me.SaveButton = New System.Windows.Forms.Button()
|
||||
Me.FileTypesGroupBox = New System.Windows.Forms.GroupBox()
|
||||
Me.FTACountLabel = New System.Windows.Forms.Label()
|
||||
Me.DisabledFTACheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.ServerGroupBox.SuspendLayout()
|
||||
Me.RDGWGroupBox.SuspendLayout()
|
||||
Me.ClientConnectionGroupBox.SuspendLayout()
|
||||
Me.MSIGroupBox.SuspendLayout()
|
||||
Me.Panel1.SuspendLayout()
|
||||
Me.FileTypesGroupBox.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'EditAfterSave
|
||||
'
|
||||
Me.EditAfterSave.ImageIndex = 2
|
||||
Me.EditAfterSave.ImageList = Me.SmallerIcons
|
||||
Me.EditAfterSave.Location = New System.Drawing.Point(313, 13)
|
||||
Me.EditAfterSave.Name = "EditAfterSave"
|
||||
Me.EditAfterSave.Size = New System.Drawing.Size(165, 30)
|
||||
Me.EditAfterSave.TabIndex = 2
|
||||
Me.EditAfterSave.Text = "Manually edit RDP file"
|
||||
Me.EditAfterSave.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
|
||||
Me.EditAfterSave.UseVisualStyleBackColor = True
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "save-as_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "msi small.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(2, "doc_file_document_manager_paper_phone.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(3, "16.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(4, "cross.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(5, "pictures (1).ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(6, "Remote Desktop Connection.ico")
|
||||
'
|
||||
'CreateButton
|
||||
'
|
||||
Me.CreateButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.CreateButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CreateButton.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.CreateButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CreateButton.ImageIndex = 6
|
||||
Me.CreateButton.ImageList = Me.SmallerIcons
|
||||
Me.CreateButton.Location = New System.Drawing.Point(416, 482)
|
||||
Me.CreateButton.Name = "CreateButton"
|
||||
Me.CreateButton.Size = New System.Drawing.Size(80, 29)
|
||||
Me.CreateButton.TabIndex = 8
|
||||
Me.CreateButton.Text = "Create..."
|
||||
Me.CreateButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CreateButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FileSaveRDP
|
||||
'
|
||||
Me.FileSaveRDP.DefaultExt = "rdp"
|
||||
Me.FileSaveRDP.Filter = "RDP files|*.rdp"
|
||||
'
|
||||
'CancelEditButton
|
||||
'
|
||||
Me.CancelEditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.CancelEditButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CancelEditButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.CancelEditButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CancelEditButton.ImageIndex = 4
|
||||
Me.CancelEditButton.ImageList = Me.SmallerIcons
|
||||
Me.CancelEditButton.Location = New System.Drawing.Point(343, 482)
|
||||
Me.CancelEditButton.Name = "CancelEditButton"
|
||||
Me.CancelEditButton.Size = New System.Drawing.Size(67, 29)
|
||||
Me.CancelEditButton.TabIndex = 7
|
||||
Me.CancelEditButton.Text = "Cancel"
|
||||
Me.CancelEditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CancelEditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'ServerGroupBox
|
||||
'
|
||||
Me.ServerGroupBox.Controls.Add(Me.Label13)
|
||||
Me.ServerGroupBox.Controls.Add(Me.Label14)
|
||||
Me.ServerGroupBox.Controls.Add(Me.Label12)
|
||||
Me.ServerGroupBox.Controls.Add(Me.ServerPort)
|
||||
Me.ServerGroupBox.Controls.Add(Me.AltServerAddress)
|
||||
Me.ServerGroupBox.Controls.Add(Me.ServerAddress)
|
||||
Me.ServerGroupBox.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.ServerGroupBox.Location = New System.Drawing.Point(12, 92)
|
||||
Me.ServerGroupBox.Name = "ServerGroupBox"
|
||||
Me.ServerGroupBox.Size = New System.Drawing.Size(484, 87)
|
||||
Me.ServerGroupBox.TabIndex = 1
|
||||
Me.ServerGroupBox.TabStop = False
|
||||
Me.ServerGroupBox.Text = "Remote Server"
|
||||
'
|
||||
'Label13
|
||||
'
|
||||
Me.Label13.AutoSize = True
|
||||
Me.Label13.Location = New System.Drawing.Point(7, 54)
|
||||
Me.Label13.Name = "Label13"
|
||||
Me.Label13.Size = New System.Drawing.Size(101, 15)
|
||||
Me.Label13.TabIndex = 104
|
||||
Me.Label13.Text = "Alternative server:"
|
||||
'
|
||||
'Label14
|
||||
'
|
||||
Me.Label14.AutoSize = True
|
||||
Me.Label14.Location = New System.Drawing.Point(382, 25)
|
||||
Me.Label14.Name = "Label14"
|
||||
Me.Label14.Size = New System.Drawing.Size(32, 15)
|
||||
Me.Label14.TabIndex = 105
|
||||
Me.Label14.Text = "Port:"
|
||||
'
|
||||
'Label12
|
||||
'
|
||||
Me.Label12.AutoSize = True
|
||||
Me.Label12.Location = New System.Drawing.Point(7, 25)
|
||||
Me.Label12.Name = "Label12"
|
||||
Me.Label12.Size = New System.Drawing.Size(85, 15)
|
||||
Me.Label12.TabIndex = 106
|
||||
Me.Label12.Text = "Server address:"
|
||||
'
|
||||
'ServerPort
|
||||
'
|
||||
Me.ServerPort.Location = New System.Drawing.Point(420, 22)
|
||||
Me.ServerPort.Name = "ServerPort"
|
||||
Me.ServerPort.Size = New System.Drawing.Size(53, 23)
|
||||
Me.ServerPort.TabIndex = 1
|
||||
Me.ServerPort.Text = "3389"
|
||||
'
|
||||
'AltServerAddress
|
||||
'
|
||||
Me.AltServerAddress.Location = New System.Drawing.Point(121, 51)
|
||||
Me.AltServerAddress.Name = "AltServerAddress"
|
||||
Me.AltServerAddress.Size = New System.Drawing.Size(352, 23)
|
||||
Me.AltServerAddress.TabIndex = 2
|
||||
'
|
||||
'ServerAddress
|
||||
'
|
||||
Me.ServerAddress.Location = New System.Drawing.Point(121, 22)
|
||||
Me.ServerAddress.Name = "ServerAddress"
|
||||
Me.ServerAddress.Size = New System.Drawing.Size(255, 23)
|
||||
Me.ServerAddress.TabIndex = 0
|
||||
'
|
||||
'RDGWGroupBox
|
||||
'
|
||||
Me.RDGWGroupBox.Controls.Add(Me.AttemptDirectCheckBox)
|
||||
Me.RDGWGroupBox.Controls.Add(Me.UseRDGatewayCheckBox)
|
||||
Me.RDGWGroupBox.Controls.Add(Me.RDGWLabel)
|
||||
Me.RDGWGroupBox.Controls.Add(Me.GatewayAddress)
|
||||
Me.RDGWGroupBox.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.RDGWGroupBox.Location = New System.Drawing.Point(12, 185)
|
||||
Me.RDGWGroupBox.Name = "RDGWGroupBox"
|
||||
Me.RDGWGroupBox.Size = New System.Drawing.Size(484, 103)
|
||||
Me.RDGWGroupBox.TabIndex = 2
|
||||
Me.RDGWGroupBox.TabStop = False
|
||||
Me.RDGWGroupBox.Text = "Remote Desktop Gateway"
|
||||
'
|
||||
'AttemptDirectCheckBox
|
||||
'
|
||||
Me.AttemptDirectCheckBox.AutoSize = True
|
||||
Me.AttemptDirectCheckBox.Enabled = False
|
||||
Me.AttemptDirectCheckBox.Location = New System.Drawing.Point(10, 76)
|
||||
Me.AttemptDirectCheckBox.Name = "AttemptDirectCheckBox"
|
||||
Me.AttemptDirectCheckBox.Size = New System.Drawing.Size(326, 19)
|
||||
Me.AttemptDirectCheckBox.TabIndex = 2
|
||||
Me.AttemptDirectCheckBox.Text = "Only use RD Gateway if direct connection is unsuccessful"
|
||||
Me.AttemptDirectCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'UseRDGatewayCheckBox
|
||||
'
|
||||
Me.UseRDGatewayCheckBox.AutoSize = True
|
||||
Me.UseRDGatewayCheckBox.Location = New System.Drawing.Point(10, 22)
|
||||
Me.UseRDGatewayCheckBox.Name = "UseRDGatewayCheckBox"
|
||||
Me.UseRDGatewayCheckBox.Size = New System.Drawing.Size(111, 19)
|
||||
Me.UseRDGatewayCheckBox.TabIndex = 0
|
||||
Me.UseRDGatewayCheckBox.Text = "Use RD Gateway"
|
||||
Me.UseRDGatewayCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RDGWLabel
|
||||
'
|
||||
Me.RDGWLabel.AutoSize = True
|
||||
Me.RDGWLabel.Enabled = False
|
||||
Me.RDGWLabel.Location = New System.Drawing.Point(7, 50)
|
||||
Me.RDGWLabel.Name = "RDGWLabel"
|
||||
Me.RDGWLabel.Size = New System.Drawing.Size(116, 15)
|
||||
Me.RDGWLabel.TabIndex = 110
|
||||
Me.RDGWLabel.Text = "RD Gateway address:"
|
||||
'
|
||||
'GatewayAddress
|
||||
'
|
||||
Me.GatewayAddress.Enabled = False
|
||||
Me.GatewayAddress.Location = New System.Drawing.Point(145, 47)
|
||||
Me.GatewayAddress.Name = "GatewayAddress"
|
||||
Me.GatewayAddress.Size = New System.Drawing.Size(328, 23)
|
||||
Me.GatewayAddress.TabIndex = 1
|
||||
'
|
||||
'ClientConnectionGroupBox
|
||||
'
|
||||
Me.ClientConnectionGroupBox.Controls.Add(Me.MSIRadioButton)
|
||||
Me.ClientConnectionGroupBox.Controls.Add(Me.RDPRadioButton)
|
||||
Me.ClientConnectionGroupBox.Controls.Add(Me.CreateRAWebIcon)
|
||||
Me.ClientConnectionGroupBox.Controls.Add(Me.EditAfterSave)
|
||||
Me.ClientConnectionGroupBox.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.ClientConnectionGroupBox.Location = New System.Drawing.Point(12, 12)
|
||||
Me.ClientConnectionGroupBox.Name = "ClientConnectionGroupBox"
|
||||
Me.ClientConnectionGroupBox.Size = New System.Drawing.Size(484, 74)
|
||||
Me.ClientConnectionGroupBox.TabIndex = 0
|
||||
Me.ClientConnectionGroupBox.TabStop = False
|
||||
Me.ClientConnectionGroupBox.Text = "Client Connection"
|
||||
'
|
||||
'MSIRadioButton
|
||||
'
|
||||
Me.MSIRadioButton.AutoSize = True
|
||||
Me.MSIRadioButton.Location = New System.Drawing.Point(10, 47)
|
||||
Me.MSIRadioButton.Name = "MSIRadioButton"
|
||||
Me.MSIRadioButton.Size = New System.Drawing.Size(89, 19)
|
||||
Me.MSIRadioButton.TabIndex = 1
|
||||
Me.MSIRadioButton.TabStop = True
|
||||
Me.MSIRadioButton.Text = "MSI installer"
|
||||
Me.MSIRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RDPRadioButton
|
||||
'
|
||||
Me.RDPRadioButton.AutoSize = True
|
||||
Me.RDPRadioButton.Checked = True
|
||||
Me.RDPRadioButton.Location = New System.Drawing.Point(10, 22)
|
||||
Me.RDPRadioButton.Name = "RDPRadioButton"
|
||||
Me.RDPRadioButton.Size = New System.Drawing.Size(66, 19)
|
||||
Me.RDPRadioButton.TabIndex = 0
|
||||
Me.RDPRadioButton.TabStop = True
|
||||
Me.RDPRadioButton.Text = "RDP file"
|
||||
Me.RDPRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'CreateRAWebIcon
|
||||
'
|
||||
Me.CreateRAWebIcon.ImageIndex = 5
|
||||
Me.CreateRAWebIcon.ImageList = Me.SmallerIcons
|
||||
Me.CreateRAWebIcon.Location = New System.Drawing.Point(313, 36)
|
||||
Me.CreateRAWebIcon.Name = "CreateRAWebIcon"
|
||||
Me.CreateRAWebIcon.Size = New System.Drawing.Size(126, 30)
|
||||
Me.CreateRAWebIcon.TabIndex = 3
|
||||
Me.CreateRAWebIcon.Text = "Create icon files"
|
||||
Me.CreateRAWebIcon.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
|
||||
Me.CreateRAWebIcon.UseVisualStyleBackColor = True
|
||||
'
|
||||
'FTAButton
|
||||
'
|
||||
Me.FTAButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.FTAButton.ImageIndex = 2
|
||||
Me.FTAButton.ImageList = Me.SmallerIcons
|
||||
Me.FTAButton.Location = New System.Drawing.Point(301, 22)
|
||||
Me.FTAButton.Name = "FTAButton"
|
||||
Me.FTAButton.Size = New System.Drawing.Size(172, 29)
|
||||
Me.FTAButton.TabIndex = 1
|
||||
Me.FTAButton.Text = "File type associations..."
|
||||
Me.FTAButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.FTAButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FileBrowserIcon
|
||||
'
|
||||
Me.FileBrowserIcon.Filter = "Icons|*.exe;*.dll;*.ico|All files|*.*"
|
||||
Me.FileBrowserIcon.Title = "Browse..."
|
||||
'
|
||||
'FileSaveMSI
|
||||
'
|
||||
Me.FileSaveMSI.DefaultExt = "msi"
|
||||
Me.FileSaveMSI.Filter = "MSI files|*.msi"
|
||||
'
|
||||
'ShortcutDesktopCheckBox
|
||||
'
|
||||
Me.ShortcutDesktopCheckBox.AutoSize = True
|
||||
Me.ShortcutDesktopCheckBox.Checked = True
|
||||
Me.ShortcutDesktopCheckBox.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.ShortcutDesktopCheckBox.Location = New System.Drawing.Point(116, 18)
|
||||
Me.ShortcutDesktopCheckBox.Name = "ShortcutDesktopCheckBox"
|
||||
Me.ShortcutDesktopCheckBox.Size = New System.Drawing.Size(69, 19)
|
||||
Me.ShortcutDesktopCheckBox.TabIndex = 1
|
||||
Me.ShortcutDesktopCheckBox.Text = "Desktop"
|
||||
Me.ShortcutDesktopCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'MSIGroupBox
|
||||
'
|
||||
Me.MSIGroupBox.Controls.Add(Me.Panel1)
|
||||
Me.MSIGroupBox.Controls.Add(Me.TopLevelRadioButton)
|
||||
Me.MSIGroupBox.Controls.Add(Me.SubfolderRadioButton)
|
||||
Me.MSIGroupBox.Controls.Add(Me.ShortcutStartCheckBox)
|
||||
Me.MSIGroupBox.Controls.Add(Me.Label3)
|
||||
Me.MSIGroupBox.Controls.Add(Me.Label2)
|
||||
Me.MSIGroupBox.Controls.Add(Me.ShortcutTagCheckBox)
|
||||
Me.MSIGroupBox.Controls.Add(Me.ShortcutDesktopCheckBox)
|
||||
Me.MSIGroupBox.Controls.Add(Me.ShortcutTagTextBox)
|
||||
Me.MSIGroupBox.Controls.Add(Me.Label4)
|
||||
Me.MSIGroupBox.Controls.Add(Me.Label1)
|
||||
Me.MSIGroupBox.Enabled = False
|
||||
Me.MSIGroupBox.Location = New System.Drawing.Point(10, 363)
|
||||
Me.MSIGroupBox.Name = "MSIGroupBox"
|
||||
Me.MSIGroupBox.Size = New System.Drawing.Size(484, 107)
|
||||
Me.MSIGroupBox.TabIndex = 4
|
||||
Me.MSIGroupBox.TabStop = False
|
||||
Me.MSIGroupBox.Text = "MSI Options"
|
||||
'
|
||||
'Panel1
|
||||
'
|
||||
Me.Panel1.BackColor = System.Drawing.Color.Transparent
|
||||
Me.Panel1.Controls.Add(Me.PerMachineRadioButton)
|
||||
Me.Panel1.Controls.Add(Me.PerUserRadioButton)
|
||||
Me.Panel1.Location = New System.Drawing.Point(89, 76)
|
||||
Me.Panel1.Name = "Panel1"
|
||||
Me.Panel1.Size = New System.Drawing.Size(200, 26)
|
||||
Me.Panel1.TabIndex = 112
|
||||
'
|
||||
'PerMachineRadioButton
|
||||
'
|
||||
Me.PerMachineRadioButton.AutoSize = True
|
||||
Me.PerMachineRadioButton.Checked = True
|
||||
Me.PerMachineRadioButton.Location = New System.Drawing.Point(3, 3)
|
||||
Me.PerMachineRadioButton.Name = "PerMachineRadioButton"
|
||||
Me.PerMachineRadioButton.Size = New System.Drawing.Size(93, 19)
|
||||
Me.PerMachineRadioButton.TabIndex = 0
|
||||
Me.PerMachineRadioButton.TabStop = True
|
||||
Me.PerMachineRadioButton.Text = "Per-machine"
|
||||
Me.PerMachineRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'PerUserRadioButton
|
||||
'
|
||||
Me.PerUserRadioButton.AutoSize = True
|
||||
Me.PerUserRadioButton.Location = New System.Drawing.Point(100, 3)
|
||||
Me.PerUserRadioButton.Name = "PerUserRadioButton"
|
||||
Me.PerUserRadioButton.Size = New System.Drawing.Size(69, 19)
|
||||
Me.PerUserRadioButton.TabIndex = 1
|
||||
Me.PerUserRadioButton.TabStop = True
|
||||
Me.PerUserRadioButton.Text = "Per-user"
|
||||
Me.PerUserRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TopLevelRadioButton
|
||||
'
|
||||
Me.TopLevelRadioButton.AutoSize = True
|
||||
Me.TopLevelRadioButton.Location = New System.Drawing.Point(366, 17)
|
||||
Me.TopLevelRadioButton.Name = "TopLevelRadioButton"
|
||||
Me.TopLevelRadioButton.Size = New System.Drawing.Size(72, 19)
|
||||
Me.TopLevelRadioButton.TabIndex = 4
|
||||
Me.TopLevelRadioButton.Text = "Top level"
|
||||
Me.TopLevelRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'SubfolderRadioButton
|
||||
'
|
||||
Me.SubfolderRadioButton.AutoSize = True
|
||||
Me.SubfolderRadioButton.Checked = True
|
||||
Me.SubfolderRadioButton.Location = New System.Drawing.Point(284, 17)
|
||||
Me.SubfolderRadioButton.Name = "SubfolderRadioButton"
|
||||
Me.SubfolderRadioButton.Size = New System.Drawing.Size(76, 19)
|
||||
Me.SubfolderRadioButton.TabIndex = 3
|
||||
Me.SubfolderRadioButton.TabStop = True
|
||||
Me.SubfolderRadioButton.Text = "Subfolder"
|
||||
Me.SubfolderRadioButton.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ShortcutStartCheckBox
|
||||
'
|
||||
Me.ShortcutStartCheckBox.AutoSize = True
|
||||
Me.ShortcutStartCheckBox.Checked = True
|
||||
Me.ShortcutStartCheckBox.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.ShortcutStartCheckBox.Location = New System.Drawing.Point(191, 18)
|
||||
Me.ShortcutStartCheckBox.Name = "ShortcutStartCheckBox"
|
||||
Me.ShortcutStartCheckBox.Size = New System.Drawing.Size(87, 19)
|
||||
Me.ShortcutStartCheckBox.TabIndex = 2
|
||||
Me.ShortcutStartCheckBox.Text = "Start Menu:"
|
||||
Me.ShortcutStartCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(289, 50)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(11, 15)
|
||||
Me.Label3.TabIndex = 7
|
||||
Me.Label3.Text = ")"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(110, 49)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(11, 15)
|
||||
Me.Label2.TabIndex = 4
|
||||
Me.Label2.Text = "("
|
||||
'
|
||||
'ShortcutTagCheckBox
|
||||
'
|
||||
Me.ShortcutTagCheckBox.AutoSize = True
|
||||
Me.ShortcutTagCheckBox.Checked = True
|
||||
Me.ShortcutTagCheckBox.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.ShortcutTagCheckBox.Location = New System.Drawing.Point(10, 48)
|
||||
Me.ShortcutTagCheckBox.Name = "ShortcutTagCheckBox"
|
||||
Me.ShortcutTagCheckBox.Size = New System.Drawing.Size(94, 19)
|
||||
Me.ShortcutTagCheckBox.TabIndex = 5
|
||||
Me.ShortcutTagCheckBox.Text = "Shortcut tag:"
|
||||
Me.ShortcutTagCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ShortcutTagTextBox
|
||||
'
|
||||
Me.ShortcutTagTextBox.Location = New System.Drawing.Point(127, 46)
|
||||
Me.ShortcutTagTextBox.Name = "ShortcutTagTextBox"
|
||||
Me.ShortcutTagTextBox.Size = New System.Drawing.Size(156, 23)
|
||||
Me.ShortcutTagTextBox.TabIndex = 6
|
||||
Me.ShortcutTagTextBox.Text = "remote"
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(8, 80)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(75, 15)
|
||||
Me.Label4.TabIndex = 8
|
||||
Me.Label4.Text = "Install scope:"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(7, 19)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(103, 15)
|
||||
Me.Label1.TabIndex = 0
|
||||
Me.Label1.Text = "Place shortcuts in:"
|
||||
'
|
||||
'ResetButton
|
||||
'
|
||||
Me.ResetButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.ResetButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.ResetButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.ResetButton.ImageIndex = 3
|
||||
Me.ResetButton.ImageList = Me.SmallerIcons
|
||||
Me.ResetButton.Location = New System.Drawing.Point(126, 482)
|
||||
Me.ResetButton.Name = "ResetButton"
|
||||
Me.ResetButton.Size = New System.Drawing.Size(121, 29)
|
||||
Me.ResetButton.TabIndex = 6
|
||||
Me.ResetButton.Text = "Reset to default"
|
||||
Me.ResetButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.ResetButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SaveButton
|
||||
'
|
||||
Me.SaveButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.SaveButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.SaveButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.SaveButton.ImageIndex = 0
|
||||
Me.SaveButton.ImageList = Me.SmallerIcons
|
||||
Me.SaveButton.Location = New System.Drawing.Point(12, 482)
|
||||
Me.SaveButton.Name = "SaveButton"
|
||||
Me.SaveButton.Size = New System.Drawing.Size(108, 29)
|
||||
Me.SaveButton.TabIndex = 5
|
||||
Me.SaveButton.Text = "Save settings"
|
||||
Me.SaveButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.SaveButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FileTypesGroupBox
|
||||
'
|
||||
Me.FileTypesGroupBox.Controls.Add(Me.FTACountLabel)
|
||||
Me.FileTypesGroupBox.Controls.Add(Me.DisabledFTACheckBox)
|
||||
Me.FileTypesGroupBox.Controls.Add(Me.FTAButton)
|
||||
Me.FileTypesGroupBox.Location = New System.Drawing.Point(12, 294)
|
||||
Me.FileTypesGroupBox.Name = "FileTypesGroupBox"
|
||||
Me.FileTypesGroupBox.Size = New System.Drawing.Size(482, 63)
|
||||
Me.FileTypesGroupBox.TabIndex = 3
|
||||
Me.FileTypesGroupBox.TabStop = False
|
||||
Me.FileTypesGroupBox.Text = "File Type Associations"
|
||||
'
|
||||
'FTACountLabel
|
||||
'
|
||||
Me.FTACountLabel.AutoSize = True
|
||||
Me.FTACountLabel.Location = New System.Drawing.Point(154, 29)
|
||||
Me.FTACountLabel.Name = "FTACountLabel"
|
||||
Me.FTACountLabel.Size = New System.Drawing.Size(52, 15)
|
||||
Me.FTACountLabel.TabIndex = 2
|
||||
Me.FTACountLabel.Text = "Count: 0"
|
||||
'
|
||||
'DisabledFTACheckBox
|
||||
'
|
||||
Me.DisabledFTACheckBox.AutoSize = True
|
||||
Me.DisabledFTACheckBox.Location = New System.Drawing.Point(10, 28)
|
||||
Me.DisabledFTACheckBox.Name = "DisabledFTACheckBox"
|
||||
Me.DisabledFTACheckBox.Size = New System.Drawing.Size(71, 19)
|
||||
Me.DisabledFTACheckBox.TabIndex = 0
|
||||
Me.DisabledFTACheckBox.Text = "Disabled"
|
||||
Me.DisabledFTACheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RemoteAppCreateClientConnection
|
||||
'
|
||||
Me.AcceptButton = Me.CreateButton
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.CancelButton = Me.CancelEditButton
|
||||
Me.ClientSize = New System.Drawing.Size(507, 523)
|
||||
Me.Controls.Add(Me.FileTypesGroupBox)
|
||||
Me.Controls.Add(Me.MSIGroupBox)
|
||||
Me.Controls.Add(Me.ClientConnectionGroupBox)
|
||||
Me.Controls.Add(Me.RDGWGroupBox)
|
||||
Me.Controls.Add(Me.ServerGroupBox)
|
||||
Me.Controls.Add(Me.CreateButton)
|
||||
Me.Controls.Add(Me.SaveButton)
|
||||
Me.Controls.Add(Me.ResetButton)
|
||||
Me.Controls.Add(Me.CancelEditButton)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "RemoteAppCreateClientConnection"
|
||||
Me.Text = "RemoteAppCreateClientConnection"
|
||||
Me.ServerGroupBox.ResumeLayout(False)
|
||||
Me.ServerGroupBox.PerformLayout()
|
||||
Me.RDGWGroupBox.ResumeLayout(False)
|
||||
Me.RDGWGroupBox.PerformLayout()
|
||||
Me.ClientConnectionGroupBox.ResumeLayout(False)
|
||||
Me.ClientConnectionGroupBox.PerformLayout()
|
||||
Me.MSIGroupBox.ResumeLayout(False)
|
||||
Me.MSIGroupBox.PerformLayout()
|
||||
Me.Panel1.ResumeLayout(False)
|
||||
Me.Panel1.PerformLayout()
|
||||
Me.FileTypesGroupBox.ResumeLayout(False)
|
||||
Me.FileTypesGroupBox.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents EditAfterSave As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents CreateButton As System.Windows.Forms.Button
|
||||
Friend WithEvents FileSaveRDP As System.Windows.Forms.SaveFileDialog
|
||||
Friend WithEvents CancelEditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents ServerGroupBox As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents Label13 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label14 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label12 As System.Windows.Forms.Label
|
||||
Friend WithEvents ServerPort As System.Windows.Forms.TextBox
|
||||
Friend WithEvents AltServerAddress As System.Windows.Forms.TextBox
|
||||
Friend WithEvents ServerAddress As System.Windows.Forms.TextBox
|
||||
Friend WithEvents RDGWGroupBox As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents UseRDGatewayCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents RDGWLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents GatewayAddress As System.Windows.Forms.TextBox
|
||||
Friend WithEvents ClientConnectionGroupBox As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents MSIRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents RDPRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents FTAButton As System.Windows.Forms.Button
|
||||
Friend WithEvents FileBrowserIcon As System.Windows.Forms.OpenFileDialog
|
||||
Friend WithEvents FileSaveMSI As System.Windows.Forms.SaveFileDialog
|
||||
Friend WithEvents AttemptDirectCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents ShortcutDesktopCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents MSIGroupBox As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents ShortcutStartCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents ShortcutTagCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents ShortcutTagTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label1 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label3 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label2 As System.Windows.Forms.Label
|
||||
Friend WithEvents TopLevelRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents SubfolderRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents ResetButton As System.Windows.Forms.Button
|
||||
Friend WithEvents SaveButton As System.Windows.Forms.Button
|
||||
Friend WithEvents CreateRAWebIcon As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents Panel1 As System.Windows.Forms.Panel
|
||||
Friend WithEvents PerMachineRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents PerUserRadioButton As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents Label4 As System.Windows.Forms.Label
|
||||
Friend WithEvents FileTypesGroupBox As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents DisabledFTACheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents FTACountLabel As System.Windows.Forms.Label
|
||||
End Class
|
6501
remoteapp-tool/RemoteAppCreateClientConnection.resx
Normal file
6501
remoteapp-tool/RemoteAppCreateClientConnection.resx
Normal file
File diff suppressed because it is too large
Load Diff
357
remoteapp-tool/RemoteAppCreateClientConnection.vb
Normal file
357
remoteapp-tool/RemoteAppCreateClientConnection.vb
Normal file
@ -0,0 +1,357 @@
|
||||
Imports VB = Microsoft.VisualBasic
|
||||
|
||||
Public Class RemoteAppCreateClientConnection
|
||||
|
||||
Private RemoteApp As New RemoteAppLib.RemoteApp
|
||||
|
||||
Public Sub CreateClientConnection(SelectedRemoteApp As RemoteAppLib.RemoteApp)
|
||||
|
||||
RemoteApp = SelectedRemoteApp
|
||||
|
||||
Dim RemoteAppShortName = RemoteApp.Name
|
||||
Me.Text = "Create Client Connection for " & RemoteAppShortName
|
||||
|
||||
SetCCWindowSettings()
|
||||
|
||||
If Me.ServerAddress.Text = "" Then Me.ServerAddress.Text = System.Net.Dns.GetHostName
|
||||
If Me.AltServerAddress.Text = "" Then Me.AltServerAddress.Text = Me.ServerAddress.Text
|
||||
If Me.ServerPort.Text = "0" Then Me.ServerPort.Text = "3389"
|
||||
|
||||
If Not My.Computer.FileSystem.FileExists(RemoteApp.IconPath) Then
|
||||
CreateRAWebIcon.Checked = False
|
||||
CreateRAWebIcon.Enabled = False
|
||||
Else
|
||||
CreateRAWebIcon.Enabled = RDPRadioButton.Checked
|
||||
End If
|
||||
|
||||
Dim wx As New RDP2MSIlib.RDP
|
||||
If Not wx.WixInstalled Then
|
||||
RDPRadioButton.Checked = True
|
||||
MSIRadioButton.Enabled = False
|
||||
MSIRadioButton.Text = "MSI installer (requires WiX Toolset)"
|
||||
End If
|
||||
|
||||
If Not RemoteApp.FileTypeAssociations Is Nothing Then _
|
||||
FTACountLabel.Text = "Count: " & RemoteApp.FileTypeAssociations.Count
|
||||
|
||||
Me.RDPRadioButton.Focus()
|
||||
HelpSystem.SetupTips(Me)
|
||||
Me.ShowDialog()
|
||||
RemoteAppMainWindow.ReloadApps()
|
||||
Me.Dispose()
|
||||
End Sub
|
||||
|
||||
Sub ResetCCWindowSettings()
|
||||
My.Settings.SavedConnectionModeMSI = False
|
||||
My.Settings.SavedOpenWithNotepad = False
|
||||
My.Settings.SavedServerAddress = System.Net.Dns.GetHostName
|
||||
My.Settings.SavedServerPort = 3389
|
||||
My.Settings.SavedAltServerAddress = My.Settings.SavedServerAddress
|
||||
My.Settings.SavedUseRDGateway = False
|
||||
My.Settings.SavedRDGatewayAddress = ""
|
||||
My.Settings.SavedAttemptDirectRDGateway = False
|
||||
My.Settings.SavedMSIShortcutDesktop = True
|
||||
My.Settings.SavedMSIShortcutStart = True
|
||||
My.Settings.SavedMSIShortcutStartTopLevel = False
|
||||
My.Settings.SavedUseShortcutTag = True
|
||||
My.Settings.SavedShortcutTag = "remote"
|
||||
My.Settings.SavedClientConnectionOptions = False
|
||||
My.Settings.SavedCreateRAWebIcon = False
|
||||
My.Settings.SavedMSIPerUser = False
|
||||
My.Settings.SavedDisableFTA = False
|
||||
End Sub
|
||||
|
||||
Sub SaveCCWindowSettings()
|
||||
My.Settings.SavedConnectionModeMSI = MSIRadioButton.Checked
|
||||
My.Settings.SavedOpenWithNotepad = EditAfterSave.Checked
|
||||
My.Settings.SavedServerAddress = ServerAddress.Text
|
||||
My.Settings.SavedServerPort = Val(ServerPort.Text)
|
||||
My.Settings.SavedAltServerAddress = AltServerAddress.Text
|
||||
My.Settings.SavedUseRDGateway = UseRDGatewayCheckBox.Checked
|
||||
My.Settings.SavedRDGatewayAddress = GatewayAddress.Text
|
||||
My.Settings.SavedAttemptDirectRDGateway = AttemptDirectCheckBox.Checked
|
||||
My.Settings.SavedMSIShortcutDesktop = ShortcutDesktopCheckBox.Checked
|
||||
My.Settings.SavedMSIShortcutStart = ShortcutStartCheckBox.Checked
|
||||
My.Settings.SavedMSIShortcutStartTopLevel = TopLevelRadioButton.Checked
|
||||
My.Settings.SavedUseShortcutTag = ShortcutTagCheckBox.Checked
|
||||
My.Settings.SavedShortcutTag = ShortcutTagTextBox.Text
|
||||
My.Settings.SavedCreateRAWebIcon = CreateRAWebIcon.Checked
|
||||
My.Settings.SavedMSIPerUser = PerUserRadioButton.Checked
|
||||
My.Settings.SavedDisableFTA = DisabledFTACheckBox.Checked
|
||||
End Sub
|
||||
|
||||
Sub SetCCWindowSettings()
|
||||
If My.Settings.SavedConnectionModeMSI = True Then
|
||||
RDPRadioButton.Checked = False
|
||||
MSIRadioButton.Checked = True
|
||||
Else
|
||||
RDPRadioButton.Checked = True
|
||||
MSIRadioButton.Checked = False
|
||||
End If
|
||||
EditAfterSave.Checked = My.Settings.SavedOpenWithNotepad
|
||||
ServerAddress.Text = My.Settings.SavedServerAddress
|
||||
ServerPort.Text = My.Settings.SavedServerPort
|
||||
AltServerAddress.Text = My.Settings.SavedAltServerAddress
|
||||
UseRDGatewayCheckBox.Checked = My.Settings.SavedUseRDGateway
|
||||
GatewayAddress.Text = My.Settings.SavedRDGatewayAddress
|
||||
AttemptDirectCheckBox.Checked = My.Settings.SavedAttemptDirectRDGateway
|
||||
ShortcutDesktopCheckBox.Checked = My.Settings.SavedMSIShortcutDesktop
|
||||
ShortcutStartCheckBox.Checked = My.Settings.SavedMSIShortcutStart
|
||||
If My.Settings.SavedMSIShortcutStartTopLevel = True Then
|
||||
SubfolderRadioButton.Checked = False
|
||||
TopLevelRadioButton.Checked = True
|
||||
Else
|
||||
SubfolderRadioButton.Checked = True
|
||||
TopLevelRadioButton.Checked = False
|
||||
End If
|
||||
ShortcutTagCheckBox.Checked = My.Settings.SavedUseShortcutTag
|
||||
ShortcutTagTextBox.Text = My.Settings.SavedShortcutTag
|
||||
MSIGroupBox.Enabled = MSIRadioButton.Checked
|
||||
CreateRAWebIcon.Checked = My.Settings.SavedCreateRAWebIcon
|
||||
DisabledFTACheckBox.Checked = My.Settings.SavedDisableFTA
|
||||
If My.Settings.SavedMSIPerUser = False Then
|
||||
PerMachineRadioButton.Checked = True
|
||||
PerUserRadioButton.Checked = False
|
||||
Else
|
||||
PerMachineRadioButton.Checked = False
|
||||
PerUserRadioButton.Checked = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UseRDGatewayCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles UseRDGatewayCheckBox.CheckedChanged
|
||||
If UseRDGatewayCheckBox.Checked Then
|
||||
Me.GatewayAddress.Enabled = True
|
||||
Me.RDGWLabel.Enabled = True
|
||||
Me.AttemptDirectCheckBox.Enabled = True
|
||||
Else
|
||||
Me.GatewayAddress.Enabled = False
|
||||
Me.RDGWLabel.Enabled = False
|
||||
Me.AttemptDirectCheckBox.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RDPRadioButton_CheckedChanged(sender As Object, e As EventArgs) Handles RDPRadioButton.CheckedChanged
|
||||
MSIGroupBox.Enabled = MSIRadioButton.Checked
|
||||
EditAfterSave.Enabled = RDPRadioButton.Checked
|
||||
CreateRAWebIcon.Enabled = RDPRadioButton.Checked
|
||||
|
||||
If RDPRadioButton.Checked Then
|
||||
CreateButton.ImageIndex = 6
|
||||
Else
|
||||
CreateButton.ImageIndex = 1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateButton_Click(sender As Object, e As EventArgs) Handles CreateButton.Click
|
||||
Dim RDPPath = ""
|
||||
Dim MSIPath = ""
|
||||
Dim TempMSIPath = ""
|
||||
|
||||
If DisabledFTACheckBox.Checked And Not RemoteApp.FileTypeAssociations Is Nothing Then RemoteApp.FileTypeAssociations.Clear()
|
||||
|
||||
If RDPRadioButton.Checked Then
|
||||
FileSaveRDP.FileName = RemoteApp.Name
|
||||
If Not FileSaveRDP.ShowDialog() = Windows.Forms.DialogResult.OK Then Exit Sub
|
||||
RDPPath = FileSaveRDP.FileName
|
||||
Else
|
||||
FileSaveMSI.FileName = RemoteApp.Name
|
||||
If Not FileSaveMSI.ShowDialog() = Windows.Forms.DialogResult.OK Then Exit Sub
|
||||
MSIPath = FileSaveMSI.FileName
|
||||
RDPPath = Environment.GetEnvironmentVariable("TEMP") & "\" & RemoteApp.Name & ".rdp"
|
||||
TempMSIPath = Environment.GetEnvironmentVariable("TEMP") & "\" & RemoteApp.Name & ".msi"
|
||||
End If
|
||||
|
||||
Dim gwaddress As String = ""
|
||||
Dim trydirect As Boolean = False
|
||||
If UseRDGatewayCheckBox.Checked Then
|
||||
gwaddress = GatewayAddress.Text
|
||||
trydirect = AttemptDirectCheckBox.Checked
|
||||
End If
|
||||
|
||||
|
||||
If RDPRadioButton.Checked Then
|
||||
CreateRDPFile(RDPPath, RemoteApp)
|
||||
'!!!!!!! If it's an RDP file
|
||||
If EditAfterSave.Checked Then
|
||||
Dim CmdLine = GetSysDir() & "\notepad.exe"
|
||||
System.Diagnostics.Process.Start(CmdLine, FileSaveRDP.FileName)
|
||||
End If
|
||||
If CreateRAWebIcon.Checked Then
|
||||
Dim IconFilePath = Microsoft.VisualBasic.Left(RDPPath, RDPPath.Length - 4) & ".ico"
|
||||
If ExtractToIco(RemoteApp.IconPath, RemoteApp.IconIndex, IconFilePath) = False Then
|
||||
MessageBox.Show("Icon could not be created the RemoteApp. RDP file will still be created.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
End If
|
||||
For Each FTA As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
Dim ProductFileName = VB.Left(RDPPath, RDPPath.Length - 4)
|
||||
ExtractFTIcon(ProductFileName, FTA)
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
'!!!!!!! If it's an MSI
|
||||
Dim RDP As New RDP2MSIlib.RDP
|
||||
CreateRDPFile(RDPPath, RemoteApp)
|
||||
|
||||
RDP.rdpPath = RDPPath
|
||||
RDP.ShortcutOnDesktop = ShortcutDesktopCheckBox.Checked
|
||||
RDP.ShortcutInStart = ShortcutStartCheckBox.Checked
|
||||
RDP.ShortcutSubfolderInStart = SubfolderRadioButton.Checked
|
||||
RDP.ProductRemoteTag = ShortcutTagTextBox.Text
|
||||
RDP.PerUser = PerUserRadioButton.Checked
|
||||
|
||||
Dim FilesToDelete As New ArrayList
|
||||
Dim ProductFileName = VB.Left(RDPPath, RDPPath.Length - 4)
|
||||
Dim IconFilePath = ProductFileName & ".ico"
|
||||
|
||||
FilesToDelete.Add(RDPPath)
|
||||
|
||||
If ExtractToIco(RemoteApp.IconPath, RemoteApp.IconIndex, IconFilePath) = False Then
|
||||
MessageBox.Show("There was an error loading icon:" & vbCrLf & RemoteApp.IconPath & "," & RemoteApp.IconIndex & vbCrLf & "The MSI will still be created but the main icon will be missing.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
Else
|
||||
FilesToDelete.Add(IconFilePath)
|
||||
End If
|
||||
|
||||
If Not RemoteApp.FileTypeAssociations Is Nothing Then
|
||||
For Each FTA As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
ExtractFTIcon(ProductFileName, FTA)
|
||||
FilesToDelete.Add(ProductFileName & "." & FTA.Extension & ".ico")
|
||||
Next
|
||||
RDP.FlatFileTypes = RemoteApp.FileTypeAssociations.GetFlatFileTypes
|
||||
End If
|
||||
|
||||
|
||||
RDP.CreateMSI(MSIPath)
|
||||
|
||||
DeleteFiles(FilesToDelete)
|
||||
|
||||
End If
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ExtractFTIcon(ProductFileName As String, FTA As RemoteAppLib.FileTypeAssociation)
|
||||
'Extract icon for filetype
|
||||
If ExtractToIco(FTA.IconPath, FTA.IconIndex, ProductFileName & "." & FTA.Extension & ".ico") = False Then
|
||||
'If filetype icon fails to extract, then grab the default document icon from Shell32.dll
|
||||
ExtractToIco(GetSysDir() & "\shell32.dll", 0, ProductFileName & "." & FTA.Extension & ".ico")
|
||||
'Possibly show an error here??
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateRDPFile(RDPPath As String, RemoteApp As RemoteAppLib.RemoteApp)
|
||||
|
||||
Dim App As New RemoteAppLib.RemoteApp
|
||||
App = RemoteApp
|
||||
Dim FileTypeAssociations As RemoteAppLib.FileTypeAssociationCollection
|
||||
FileTypeAssociations = App.FileTypeAssociations
|
||||
|
||||
Dim ServerAddress = Me.ServerAddress.Text
|
||||
Dim AltServerAddress = Me.AltServerAddress.Text
|
||||
Dim ServerPort = Me.ServerPort.Text
|
||||
|
||||
Dim FlatFileTypes = ""
|
||||
If Not FileTypeAssociations Is Nothing Then FlatFileTypes = FileTypeAssociations.GetFlatFileTypes
|
||||
|
||||
Dim RDPfile As New RDPFileLib.RDPFile
|
||||
RDPfile.full_address = ServerAddress
|
||||
RDPfile.alternate_full_address = AltServerAddress
|
||||
RDPfile.server_port = Val(ServerPort)
|
||||
|
||||
RDPfile.remoteapplicationname = App.FullName
|
||||
RDPfile.remoteapplicationprogram = "||" & App.Name
|
||||
RDPfile.remoteapplicationmode = 1
|
||||
RDPfile.disableremoteappcapscheck = 1
|
||||
|
||||
RDPfile.alternate_shell = "rdpinit.exe"
|
||||
|
||||
If UseRDGatewayCheckBox.Checked Then
|
||||
RDPfile.gatewayhostname = Me.GatewayAddress.Text
|
||||
If Me.AttemptDirectCheckBox.CheckAlign Then RDPfile.gatewayusagemethod = 2 Else RDPfile.gatewayusagemethod = 1
|
||||
RDPfile.gatewayprofileusagemethod = 1
|
||||
End If
|
||||
|
||||
RDPfile.prompt_for_credentials_on_client = 1
|
||||
RDPfile.promptcredentialonce = 0
|
||||
|
||||
RDPfile.devicestoredirect = "*"
|
||||
RDPfile.drivestoredirect = "*"
|
||||
RDPfile.redirectcomports = 1
|
||||
RDPfile.redirectdrives = 1
|
||||
|
||||
RDPfile.allow_desktop_composition = 1
|
||||
RDPfile.allow_font_smoothing = 1
|
||||
RDPfile.span_monitors = 1
|
||||
RDPfile.use_multimon = 1
|
||||
|
||||
RDPfile.remoteapplicationfileextensions = FlatFileTypes
|
||||
|
||||
RDPfile.SaveRDPfile(RDPPath)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function GetFlatFileTypesList(AppName As String, Optional Delim As String = ",") As String
|
||||
Dim BaseKeyName As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications\" & AppName & "\Filetypes"
|
||||
Dim FlatFTList = ""
|
||||
|
||||
Try
|
||||
Dim BaseKey As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey(BaseKeyName)
|
||||
|
||||
For Each FT As String In BaseKey.GetSubKeyNames
|
||||
FlatFTList &= "." & FT & Delim
|
||||
Next
|
||||
FlatFTList = FlatFTList.TrimEnd(Delim)
|
||||
|
||||
Catch Ex As Exception
|
||||
|
||||
End Try
|
||||
Return FlatFTList
|
||||
End Function
|
||||
|
||||
Private Sub FTAButton_Click(sender As Object, e As EventArgs) Handles FTAButton.Click
|
||||
MessageBox.Show(Me, "Changes made here to File Type Associations are for this client connection only and will not be saved for next time." & vbCrLf & vbCrLf & _
|
||||
"To make permanent changes to the File Type Associations for this RemoteApp, edit the RemoteApp.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
RemoteApp = RemoteAppFileTypeAssociation.EditFileTypes(RemoteApp)
|
||||
If Not RemoteApp.FileTypeAssociations Is Nothing Then _
|
||||
FTACountLabel.Text = "Count: " & RemoteApp.FileTypeAssociations.Count
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ShortcutStartCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles ShortcutStartCheckBox.CheckedChanged
|
||||
SubfolderRadioButton.Enabled = ShortcutStartCheckBox.Checked
|
||||
TopLevelRadioButton.Enabled = ShortcutStartCheckBox.Checked
|
||||
End Sub
|
||||
|
||||
Private Sub ShortcutTagCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles ShortcutTagCheckBox.CheckedChanged
|
||||
ShortcutTagTextBox.Enabled = ShortcutTagCheckBox.Checked
|
||||
End Sub
|
||||
|
||||
Private Sub ServerAddress_TextChanged(sender As Object, e As EventArgs) Handles ServerAddress.TextChanged
|
||||
ValidateDNSname(ServerAddress)
|
||||
End Sub
|
||||
|
||||
Private Sub AltServerAddress_TextChanged(sender As Object, e As EventArgs) Handles AltServerAddress.TextChanged
|
||||
ValidateDNSname(AltServerAddress)
|
||||
End Sub
|
||||
|
||||
Private Sub ServerPort_TextChanged(sender As Object, e As EventArgs) Handles ServerPort.TextChanged
|
||||
ValidatePort(ServerPort)
|
||||
End Sub
|
||||
|
||||
Private Sub ResetButton_Click(sender As Object, e As EventArgs) Handles ResetButton.Click
|
||||
ResetCCWindowSettings()
|
||||
SetCCWindowSettings()
|
||||
End Sub
|
||||
|
||||
Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
|
||||
SaveCCWindowSettings()
|
||||
End Sub
|
||||
|
||||
Private Sub DisabledFTACheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles DisabledFTACheckBox.CheckedChanged
|
||||
If Me.DisabledFTACheckBox.Checked Then
|
||||
Me.FTAButton.Enabled = False
|
||||
Me.FTACountLabel.Enabled = False
|
||||
Else
|
||||
Me.FTAButton.Enabled = True
|
||||
Me.FTACountLabel.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
452
remoteapp-tool/RemoteAppEditWindow.Designer.vb
generated
Normal file
452
remoteapp-tool/RemoteAppEditWindow.Designer.vb
generated
Normal file
@ -0,0 +1,452 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppEditWindow
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppEditWindow))
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.IconPathCopyButton = New System.Windows.Forms.Button()
|
||||
Me.VPathCopyButton = New System.Windows.Forms.Button()
|
||||
Me.TSWAbox = New System.Windows.Forms.ComboBox()
|
||||
Me.CommandLineOptionCombo = New System.Windows.Forms.ComboBox()
|
||||
Me.IconPathText = New System.Windows.Forms.TextBox()
|
||||
Me.CommandLineText = New System.Windows.Forms.TextBox()
|
||||
Me.Label11 = New System.Windows.Forms.Label()
|
||||
Me.Label10 = New System.Windows.Forms.Label()
|
||||
Me.Label8 = New System.Windows.Forms.Label()
|
||||
Me.VPathText = New System.Windows.Forms.TextBox()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.PathText = New System.Windows.Forms.TextBox()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.FullNameText = New System.Windows.Forms.TextBox()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.IconIndexText = New System.Windows.Forms.TextBox()
|
||||
Me.ShortNameText = New System.Windows.Forms.TextBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.Label12 = New System.Windows.Forms.Label()
|
||||
Me.CancelEditButton = New System.Windows.Forms.Button()
|
||||
Me.FileBrowserPath = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.FileBrowserIcon = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.FileBrowserVPath = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.SaveButton = New System.Windows.Forms.Button()
|
||||
Me.BrowseIconPath = New System.Windows.Forms.Button()
|
||||
Me.BrowseVPath = New System.Windows.Forms.Button()
|
||||
Me.BrowsePath = New System.Windows.Forms.Button()
|
||||
Me.FTAButton = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "favorites_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "folder_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(2, "dotdotdot.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(3, "inside_icons_azure_marker_map_socialize_base.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(4, "pictures (1).ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(5, "pictures.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(6, "arrows_line_connector_with_draw.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(7, "doc_file_document_manager_paper_phone.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(8, "cross.ico")
|
||||
'
|
||||
'IconPathCopyButton
|
||||
'
|
||||
Me.IconPathCopyButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconPathCopyButton.AutoSize = True
|
||||
Me.IconPathCopyButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.IconPathCopyButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.IconPathCopyButton.ImageIndex = 6
|
||||
Me.IconPathCopyButton.ImageList = Me.SmallerIcons
|
||||
Me.IconPathCopyButton.Location = New System.Drawing.Point(382, 97)
|
||||
Me.IconPathCopyButton.Name = "IconPathCopyButton"
|
||||
Me.IconPathCopyButton.Size = New System.Drawing.Size(61, 27)
|
||||
Me.IconPathCopyButton.TabIndex = 15
|
||||
Me.IconPathCopyButton.Text = "Copy"
|
||||
Me.IconPathCopyButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.IconPathCopyButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'VPathCopyButton
|
||||
'
|
||||
Me.VPathCopyButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.VPathCopyButton.AutoSize = True
|
||||
Me.VPathCopyButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.VPathCopyButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.VPathCopyButton.ImageIndex = 6
|
||||
Me.VPathCopyButton.ImageList = Me.SmallerIcons
|
||||
Me.VPathCopyButton.Location = New System.Drawing.Point(382, 67)
|
||||
Me.VPathCopyButton.Name = "VPathCopyButton"
|
||||
Me.VPathCopyButton.Size = New System.Drawing.Size(61, 27)
|
||||
Me.VPathCopyButton.TabIndex = 9
|
||||
Me.VPathCopyButton.Text = "Copy"
|
||||
Me.VPathCopyButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.VPathCopyButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'TSWAbox
|
||||
'
|
||||
Me.TSWAbox.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.TSWAbox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.TSWAbox.FormattingEnabled = True
|
||||
Me.TSWAbox.Items.AddRange(New Object() {"No", "Yes"})
|
||||
Me.TSWAbox.Location = New System.Drawing.Point(321, 157)
|
||||
Me.TSWAbox.Name = "TSWAbox"
|
||||
Me.TSWAbox.Size = New System.Drawing.Size(81, 23)
|
||||
Me.TSWAbox.TabIndex = 22
|
||||
'
|
||||
'CommandLineOptionCombo
|
||||
'
|
||||
Me.CommandLineOptionCombo.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CommandLineOptionCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.CommandLineOptionCombo.FormattingEnabled = True
|
||||
Me.CommandLineOptionCombo.Items.AddRange(New Object() {"Disabled", "Optional", "Enforced"})
|
||||
Me.CommandLineOptionCombo.Location = New System.Drawing.Point(145, 157)
|
||||
Me.CommandLineOptionCombo.Name = "CommandLineOptionCombo"
|
||||
Me.CommandLineOptionCombo.Size = New System.Drawing.Size(81, 23)
|
||||
Me.CommandLineOptionCombo.TabIndex = 20
|
||||
'
|
||||
'IconPathText
|
||||
'
|
||||
Me.IconPathText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconPathText.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.IconPathText.Location = New System.Drawing.Point(78, 99)
|
||||
Me.IconPathText.Name = "IconPathText"
|
||||
Me.IconPathText.Size = New System.Drawing.Size(159, 23)
|
||||
Me.IconPathText.TabIndex = 12
|
||||
'
|
||||
'CommandLineText
|
||||
'
|
||||
Me.CommandLineText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CommandLineText.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CommandLineText.Location = New System.Drawing.Point(112, 128)
|
||||
Me.CommandLineText.Name = "CommandLineText"
|
||||
Me.CommandLineText.Size = New System.Drawing.Size(364, 23)
|
||||
Me.CommandLineText.TabIndex = 18
|
||||
'
|
||||
'Label11
|
||||
'
|
||||
Me.Label11.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.Label11.AutoSize = True
|
||||
Me.Label11.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label11.Location = New System.Drawing.Point(243, 103)
|
||||
Me.Label11.Name = "Label11"
|
||||
Me.Label11.Size = New System.Drawing.Size(64, 15)
|
||||
Me.Label11.TabIndex = 13
|
||||
Me.Label11.Text = "Icon Index:"
|
||||
'
|
||||
'Label10
|
||||
'
|
||||
Me.Label10.AutoSize = True
|
||||
Me.Label10.Location = New System.Drawing.Point(232, 160)
|
||||
Me.Label10.Name = "Label10"
|
||||
Me.Label10.Size = New System.Drawing.Size(83, 15)
|
||||
Me.Label10.TabIndex = 21
|
||||
Me.Label10.Text = "TSWebAccess:"
|
||||
'
|
||||
'Label8
|
||||
'
|
||||
Me.Label8.AutoSize = True
|
||||
Me.Label8.Location = New System.Drawing.Point(12, 160)
|
||||
Me.Label8.Name = "Label8"
|
||||
Me.Label8.Size = New System.Drawing.Size(127, 15)
|
||||
Me.Label8.TabIndex = 19
|
||||
Me.Label8.Text = "Command line option:"
|
||||
'
|
||||
'VPathText
|
||||
'
|
||||
Me.VPathText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.VPathText.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.VPathText.Location = New System.Drawing.Point(60, 70)
|
||||
Me.VPathText.Name = "VPathText"
|
||||
Me.VPathText.Size = New System.Drawing.Size(315, 23)
|
||||
Me.VPathText.TabIndex = 8
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = True
|
||||
Me.Label7.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label7.Location = New System.Drawing.Point(12, 102)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(60, 15)
|
||||
Me.Label7.TabIndex = 11
|
||||
Me.Label7.Text = "Icon path:"
|
||||
'
|
||||
'PathText
|
||||
'
|
||||
Me.PathText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.PathText.Location = New System.Drawing.Point(60, 41)
|
||||
Me.PathText.Name = "PathText"
|
||||
Me.PathText.Size = New System.Drawing.Size(383, 23)
|
||||
Me.PathText.TabIndex = 5
|
||||
'
|
||||
'Label6
|
||||
'
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label6.Location = New System.Drawing.Point(12, 131)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(89, 15)
|
||||
Me.Label6.TabIndex = 17
|
||||
Me.Label6.Text = "Command line:"
|
||||
'
|
||||
'FullNameText
|
||||
'
|
||||
Me.FullNameText.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.FullNameText.Location = New System.Drawing.Point(304, 12)
|
||||
Me.FullNameText.Name = "FullNameText"
|
||||
Me.FullNameText.Size = New System.Drawing.Size(172, 23)
|
||||
Me.FullNameText.TabIndex = 3
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label5.Location = New System.Drawing.Point(12, 73)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(41, 15)
|
||||
Me.Label5.TabIndex = 7
|
||||
Me.Label5.Text = "VPath:"
|
||||
'
|
||||
'IconIndexText
|
||||
'
|
||||
Me.IconIndexText.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconIndexText.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.IconIndexText.Location = New System.Drawing.Point(315, 99)
|
||||
Me.IconIndexText.Name = "IconIndexText"
|
||||
Me.IconIndexText.Size = New System.Drawing.Size(60, 23)
|
||||
Me.IconIndexText.TabIndex = 14
|
||||
Me.IconIndexText.Text = "0"
|
||||
'
|
||||
'ShortNameText
|
||||
'
|
||||
Me.ShortNameText.Location = New System.Drawing.Point(60, 12)
|
||||
Me.ShortNameText.Name = "ShortNameText"
|
||||
Me.ShortNameText.Size = New System.Drawing.Size(170, 23)
|
||||
Me.ShortNameText.TabIndex = 1
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(12, 44)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(34, 15)
|
||||
Me.Label4.TabIndex = 4
|
||||
Me.Label4.Text = "Path:"
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Location = New System.Drawing.Point(236, 15)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(62, 15)
|
||||
Me.Label3.TabIndex = 2
|
||||
Me.Label3.Text = "Full name:"
|
||||
'
|
||||
'Label12
|
||||
'
|
||||
Me.Label12.AutoSize = True
|
||||
Me.Label12.Location = New System.Drawing.Point(12, 15)
|
||||
Me.Label12.Name = "Label12"
|
||||
Me.Label12.Size = New System.Drawing.Size(42, 15)
|
||||
Me.Label12.TabIndex = 0
|
||||
Me.Label12.Text = "Name:"
|
||||
'
|
||||
'CancelEditButton
|
||||
'
|
||||
Me.CancelEditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CancelEditButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CancelEditButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.CancelEditButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CancelEditButton.ImageIndex = 8
|
||||
Me.CancelEditButton.ImageList = Me.SmallerIcons
|
||||
Me.CancelEditButton.Location = New System.Drawing.Point(327, 189)
|
||||
Me.CancelEditButton.Name = "CancelEditButton"
|
||||
Me.CancelEditButton.Size = New System.Drawing.Size(75, 29)
|
||||
Me.CancelEditButton.TabIndex = 24
|
||||
Me.CancelEditButton.Text = "Cancel"
|
||||
Me.CancelEditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CancelEditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FileBrowserPath
|
||||
'
|
||||
Me.FileBrowserPath.Filter = "Programs|*.exe;*.com;*.cmd;*.bat|All files|*.*"
|
||||
Me.FileBrowserPath.Title = "Browse..."
|
||||
'
|
||||
'FileBrowserIcon
|
||||
'
|
||||
Me.FileBrowserIcon.Filter = "Icons|*.exe;*.dll;*.ico|All files|*.*"
|
||||
Me.FileBrowserIcon.Title = "Browse..."
|
||||
'
|
||||
'FileBrowserVPath
|
||||
'
|
||||
Me.FileBrowserVPath.Filter = "Programs|*.exe;*.com;*.cmd;*.bat|All files|*.*"
|
||||
Me.FileBrowserVPath.Title = "Browse..."
|
||||
'
|
||||
'SaveButton
|
||||
'
|
||||
Me.SaveButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.SaveButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.SaveButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.SaveButton.ImageIndex = 0
|
||||
Me.SaveButton.ImageList = Me.SmallerIcons
|
||||
Me.SaveButton.Location = New System.Drawing.Point(407, 189)
|
||||
Me.SaveButton.Name = "SaveButton"
|
||||
Me.SaveButton.Size = New System.Drawing.Size(67, 29)
|
||||
Me.SaveButton.TabIndex = 25
|
||||
Me.SaveButton.Text = "Save"
|
||||
Me.SaveButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.SaveButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'BrowseIconPath
|
||||
'
|
||||
Me.BrowseIconPath.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.BrowseIconPath.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.BrowseIconPath.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.BrowseIconPath.ImageIndex = 4
|
||||
Me.BrowseIconPath.ImageList = Me.SmallerIcons
|
||||
Me.BrowseIconPath.Location = New System.Drawing.Point(449, 97)
|
||||
Me.BrowseIconPath.Name = "BrowseIconPath"
|
||||
Me.BrowseIconPath.Size = New System.Drawing.Size(27, 27)
|
||||
Me.BrowseIconPath.TabIndex = 16
|
||||
Me.BrowseIconPath.UseVisualStyleBackColor = False
|
||||
'
|
||||
'BrowseVPath
|
||||
'
|
||||
Me.BrowseVPath.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.BrowseVPath.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.BrowseVPath.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.BrowseVPath.ImageIndex = 1
|
||||
Me.BrowseVPath.ImageList = Me.SmallerIcons
|
||||
Me.BrowseVPath.Location = New System.Drawing.Point(449, 67)
|
||||
Me.BrowseVPath.Name = "BrowseVPath"
|
||||
Me.BrowseVPath.Size = New System.Drawing.Size(27, 27)
|
||||
Me.BrowseVPath.TabIndex = 10
|
||||
Me.BrowseVPath.UseVisualStyleBackColor = False
|
||||
'
|
||||
'BrowsePath
|
||||
'
|
||||
Me.BrowsePath.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.BrowsePath.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.BrowsePath.ImageIndex = 1
|
||||
Me.BrowsePath.ImageList = Me.SmallerIcons
|
||||
Me.BrowsePath.Location = New System.Drawing.Point(449, 38)
|
||||
Me.BrowsePath.Name = "BrowsePath"
|
||||
Me.BrowsePath.Size = New System.Drawing.Size(27, 27)
|
||||
Me.BrowsePath.TabIndex = 6
|
||||
Me.BrowsePath.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FTAButton
|
||||
'
|
||||
Me.FTAButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.FTAButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.FTAButton.ImageIndex = 7
|
||||
Me.FTAButton.ImageList = Me.SmallerIcons
|
||||
Me.FTAButton.Location = New System.Drawing.Point(12, 189)
|
||||
Me.FTAButton.Name = "FTAButton"
|
||||
Me.FTAButton.Size = New System.Drawing.Size(172, 29)
|
||||
Me.FTAButton.TabIndex = 23
|
||||
Me.FTAButton.Text = "File type associations..."
|
||||
Me.FTAButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.FTAButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'RemoteAppEditWindow
|
||||
'
|
||||
Me.AcceptButton = Me.SaveButton
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.CancelButton = Me.CancelEditButton
|
||||
Me.ClientSize = New System.Drawing.Size(488, 230)
|
||||
Me.Controls.Add(Me.FTAButton)
|
||||
Me.Controls.Add(Me.CancelEditButton)
|
||||
Me.Controls.Add(Me.SaveButton)
|
||||
Me.Controls.Add(Me.BrowseIconPath)
|
||||
Me.Controls.Add(Me.IconPathCopyButton)
|
||||
Me.Controls.Add(Me.VPathCopyButton)
|
||||
Me.Controls.Add(Me.TSWAbox)
|
||||
Me.Controls.Add(Me.CommandLineOptionCombo)
|
||||
Me.Controls.Add(Me.IconPathText)
|
||||
Me.Controls.Add(Me.CommandLineText)
|
||||
Me.Controls.Add(Me.Label11)
|
||||
Me.Controls.Add(Me.Label10)
|
||||
Me.Controls.Add(Me.Label8)
|
||||
Me.Controls.Add(Me.VPathText)
|
||||
Me.Controls.Add(Me.Label7)
|
||||
Me.Controls.Add(Me.PathText)
|
||||
Me.Controls.Add(Me.Label6)
|
||||
Me.Controls.Add(Me.FullNameText)
|
||||
Me.Controls.Add(Me.Label5)
|
||||
Me.Controls.Add(Me.IconIndexText)
|
||||
Me.Controls.Add(Me.ShortNameText)
|
||||
Me.Controls.Add(Me.Label4)
|
||||
Me.Controls.Add(Me.Label3)
|
||||
Me.Controls.Add(Me.Label12)
|
||||
Me.Controls.Add(Me.BrowseVPath)
|
||||
Me.Controls.Add(Me.BrowsePath)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MaximumSize = New System.Drawing.Size(9000, 269)
|
||||
Me.MinimizeBox = False
|
||||
Me.MinimumSize = New System.Drawing.Size(504, 269)
|
||||
Me.Name = "RemoteAppEditWindow"
|
||||
Me.Text = "RemoteAppEditWindow"
|
||||
Me.ResumeLayout(false)
|
||||
Me.PerformLayout
|
||||
|
||||
End Sub
|
||||
Friend WithEvents BrowseIconPath As System.Windows.Forms.Button
|
||||
Friend WithEvents IconPathCopyButton As System.Windows.Forms.Button
|
||||
Friend WithEvents VPathCopyButton As System.Windows.Forms.Button
|
||||
Friend WithEvents TSWAbox As System.Windows.Forms.ComboBox
|
||||
Friend WithEvents CommandLineOptionCombo As System.Windows.Forms.ComboBox
|
||||
Friend WithEvents IconPathText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents CommandLineText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label11 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label10 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label8 As System.Windows.Forms.Label
|
||||
Friend WithEvents VPathText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label7 As System.Windows.Forms.Label
|
||||
Friend WithEvents PathText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label6 As System.Windows.Forms.Label
|
||||
Friend WithEvents FullNameText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label5 As System.Windows.Forms.Label
|
||||
Friend WithEvents IconIndexText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents ShortNameText As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label4 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label3 As System.Windows.Forms.Label
|
||||
Friend WithEvents Label12 As System.Windows.Forms.Label
|
||||
Friend WithEvents BrowseVPath As System.Windows.Forms.Button
|
||||
Friend WithEvents BrowsePath As System.Windows.Forms.Button
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents SaveButton As System.Windows.Forms.Button
|
||||
Friend WithEvents CancelEditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents FileBrowserPath As System.Windows.Forms.OpenFileDialog
|
||||
Friend WithEvents FileBrowserIcon As System.Windows.Forms.OpenFileDialog
|
||||
Friend WithEvents FileBrowserVPath As System.Windows.Forms.OpenFileDialog
|
||||
Friend WithEvents FTAButton As System.Windows.Forms.Button
|
||||
End Class
|
6508
remoteapp-tool/RemoteAppEditWindow.resx
Normal file
6508
remoteapp-tool/RemoteAppEditWindow.resx
Normal file
File diff suppressed because it is too large
Load Diff
231
remoteapp-tool/RemoteAppEditWindow.vb
Normal file
231
remoteapp-tool/RemoteAppEditWindow.vb
Normal file
@ -0,0 +1,231 @@
|
||||
Imports RemoteAppLib
|
||||
|
||||
Public Class RemoteAppEditWindow
|
||||
|
||||
Private RemoteApp As New RemoteApp
|
||||
|
||||
Public Function EditRemoteApp(SelectedRemoteApp As RemoteApp) As RemoteApp
|
||||
HelpSystem.SetupTips(Me)
|
||||
RemoteApp = SelectedRemoteApp
|
||||
Me.Text = "Properties of " & RemoteApp.Name
|
||||
Me.Size = Me.MinimumSize
|
||||
HelpSystem.SetupTips(Me)
|
||||
Me.LoadValues()
|
||||
Dim dlgResult = Me.ShowDialog()
|
||||
RemoteAppMainWindow.ReloadApps()
|
||||
Me.Dispose()
|
||||
Return RemoteApp
|
||||
End Function
|
||||
|
||||
Public Function CreateRemoteApp(Optional Advanced As Boolean = False) As RemoteApp
|
||||
Me.Text = "New RemoteApp"
|
||||
Me.Size = Me.MinimumSize
|
||||
HelpSystem.SetupTips(Me)
|
||||
Me.CommandLineOptionCombo.SelectedIndex = 1
|
||||
Me.TSWAbox.SelectedIndex = 0
|
||||
Me.FTAButton.Enabled = False
|
||||
|
||||
If Advanced Then
|
||||
|
||||
Me.ShowDialog()
|
||||
Else
|
||||
If DoBrowsePath() = True Then
|
||||
|
||||
SaveAndCloseOrWindow()
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Me.Dispose()
|
||||
Return RemoteApp
|
||||
End Function
|
||||
|
||||
Private Sub SetToolTips()
|
||||
Dim toolTip1 As New ToolTip()
|
||||
' Set up the delays for the ToolTip.
|
||||
toolTip1.AutoPopDelay = 5000
|
||||
toolTip1.InitialDelay = 1000
|
||||
toolTip1.ReshowDelay = 500
|
||||
|
||||
toolTip1.SetToolTip(Me.BrowseIconPath, "Select an icon")
|
||||
toolTip1.SetToolTip(Me.BrowsePath, "Browse for application")
|
||||
toolTip1.SetToolTip(Me.BrowseVPath, "Browse for application")
|
||||
toolTip1.SetToolTip(Me.VPathCopyButton, "Copy Path into VPath")
|
||||
toolTip1.SetToolTip(Me.IconPathCopyButton, "Copy Path into Icon path")
|
||||
End Sub
|
||||
|
||||
Sub LoadValues()
|
||||
|
||||
Me.ShortNameText.Text = RemoteApp.Name
|
||||
Me.CommandLineOptionCombo.SelectedIndex = RemoteApp.CommandLineOption
|
||||
|
||||
Me.FullNameText.Text = RemoteApp.FullName
|
||||
Me.PathText.Text = RemoteApp.Path
|
||||
Me.VPathText.Text = RemoteApp.VPath
|
||||
Me.CommandLineText.Text = RemoteApp.CommandLine
|
||||
Me.CommandLineOptionCombo.SelectedIndex = RemoteApp.CommandLineOption
|
||||
Me.IconPathText.Text = RemoteApp.IconPath
|
||||
Me.IconIndexText.Text = RemoteApp.IconIndex
|
||||
Dim TSWA As Integer = 0
|
||||
If RemoteApp.TSWA = True Then TSWA = 1
|
||||
Me.TSWAbox.SelectedIndex = TSWA
|
||||
|
||||
Dim TheIcon = ReturnIcon(Me.IconPathText.Text, Val(Me.IconIndexText.Text), True)
|
||||
If Not TheIcon Is Nothing Then
|
||||
Me.Icon = TheIcon
|
||||
Else
|
||||
Me.Icon = RemoteAppMainWindow.Icon
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CancelEditButton_Click(sender As Object, e As EventArgs) Handles CancelEditButton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub VPathCopyButton_Click(sender As Object, e As EventArgs) Handles VPathCopyButton.Click
|
||||
Me.VPathText.Text = Me.PathText.Text
|
||||
End Sub
|
||||
|
||||
Private Sub IconPathCopyButton_Click(sender As Object, e As EventArgs) Handles IconPathCopyButton.Click
|
||||
Me.IconPathText.Text = Me.PathText.Text
|
||||
End Sub
|
||||
|
||||
Private Sub BrowseVPath_Click(sender As Object, e As EventArgs) Handles BrowseVPath.Click
|
||||
If My.Computer.FileSystem.FileExists(VPathText.Text) Then FileBrowserVPath.InitialDirectory = My.Computer.FileSystem.GetParentPath(VPathText.Text)
|
||||
If FileBrowserVPath.ShowDialog() = Windows.Forms.DialogResult.OK Then Me.VPathText.Text = FileBrowserVPath.FileName
|
||||
End Sub
|
||||
|
||||
Private Sub BrowseIconPath_Click(sender As Object, e As EventArgs) Handles BrowseIconPath.Click
|
||||
IconPick()
|
||||
End Sub
|
||||
|
||||
Private Sub IconPick()
|
||||
Dim StartPath As String = GetSysDir() & "\shell32.dll"
|
||||
Dim StartIndex As Integer = Val(Me.IconIndexText.Text)
|
||||
If My.Computer.FileSystem.FileExists(IconPathText.Text) Then StartPath = IconPathText.Text
|
||||
Dim PickedIcon = RemoteAppIconPicker.PickIcon(StartPath, StartIndex)
|
||||
If Not PickedIcon.IconPath Is Nothing Then
|
||||
Me.IconPathText.Text = PickedIcon.IconPath
|
||||
Me.IconIndexText.Text = PickedIcon.IconIndex
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BrowsePath_Click(sender As Object, e As EventArgs) Handles BrowsePath.Click
|
||||
DoBrowsePath()
|
||||
End Sub
|
||||
|
||||
Private Function DoBrowsePath() As Boolean
|
||||
|
||||
DoBrowsePath = False
|
||||
|
||||
If My.Computer.FileSystem.FileExists(PathText.Text) Then FileBrowserPath.InitialDirectory = My.Computer.FileSystem.GetParentPath(PathText.Text)
|
||||
If FileBrowserPath.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||
Dim FilePath = FileBrowserPath.FileName
|
||||
Me.PathText.Text = FilePath
|
||||
RemoteApp.Path = FilePath
|
||||
If Me.VPathText.Text = "" Then RemoteApp.VPath = FilePath
|
||||
If Me.IconPathText.Text = "" Then RemoteApp.IconPath = FilePath
|
||||
If FilePath.ToLower.EndsWith(".exe") Then
|
||||
Dim title = GetEXETitle(FilePath)
|
||||
If Me.ShortNameText.Text = "" Then RemoteApp.Name = FixShortAppName(title)
|
||||
If Me.FullNameText.Text = "" Then RemoteApp.FullName = title
|
||||
End If
|
||||
LoadValues()
|
||||
DoBrowsePath = True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub SaveRemoteApp(ShortName As String, FullName As String, Path As String, VPath As String, CommandLine As String, CommandLineSetting As Integer, IconPath As String, IconIndex As Integer, ShowInTSWA As Integer)
|
||||
|
||||
Dim SysApps As New SystemRemoteApps
|
||||
|
||||
If Not RemoteApp.Name Is Nothing Then If Not RemoteApp.Name = ShortName Then SysApps.RenameApp(RemoteApp.Name, ShortName)
|
||||
|
||||
RemoteApp.Name = ShortName
|
||||
RemoteApp.FullName = FullName
|
||||
RemoteApp.Path = Path
|
||||
RemoteApp.VPath = VPath
|
||||
RemoteApp.IconPath = IconPath
|
||||
RemoteApp.IconIndex = IconIndex
|
||||
RemoteApp.CommandLine = CommandLine
|
||||
RemoteApp.CommandLineOption = CommandLineSetting
|
||||
RemoteApp.TSWA = ShowInTSWA
|
||||
|
||||
SysApps.SaveApp(RemoteApp)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function DoesAppExist(AppName As String) As Boolean
|
||||
Dim AppExists = False
|
||||
|
||||
Dim sra As New SystemRemoteApps
|
||||
Dim AppCol As New RemoteAppCollection
|
||||
|
||||
AppCol = sra.GetAll
|
||||
|
||||
For Each App As RemoteApp In AppCol
|
||||
If App.Name = AppName Then AppExists = True
|
||||
Next
|
||||
|
||||
Return AppExists
|
||||
End Function
|
||||
|
||||
Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
|
||||
SaveAndClose()
|
||||
End Sub
|
||||
|
||||
Private Sub SaveAndCloseOrWindow()
|
||||
If Me.ShortNameText.Text = "" Then
|
||||
MessageBox.Show("Name must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Me.ShowDialog()
|
||||
ElseIf Me.FullNameText.Text = "" Then
|
||||
MessageBox.Show("Full name must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Me.ShowDialog()
|
||||
ElseIf Me.PathText.Text = "" Then
|
||||
MessageBox.Show("Path must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Me.ShowDialog()
|
||||
ElseIf Not Me.ShortNameText.Text = RemoteApp.Name And DoesAppExist(Me.ShortNameText.Text) Then
|
||||
MessageBox.Show("A RemoteApp with the same name already exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Me.ShowDialog()
|
||||
ElseIf Me.Text = "New RemoteApp" And DoesAppExist(Me.ShortNameText.Text) Then
|
||||
MessageBox.Show("A RemoteApp with the same name already exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Me.ShowDialog()
|
||||
Else
|
||||
SaveRemoteApp(Me.ShortNameText.Text.Trim, Me.FullNameText.Text, Me.PathText.Text, Me.VPathText.Text, Me.CommandLineText.Text, Me.CommandLineOptionCombo.SelectedIndex, Me.IconPathText.Text, Val(IconIndexText.Text), Me.TSWAbox.SelectedIndex)
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SaveAndClose()
|
||||
If Me.ShortNameText.Text = "" Then
|
||||
MessageBox.Show("Name must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
ElseIf Me.FullNameText.Text = "" Then
|
||||
MessageBox.Show("Full name must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
ElseIf Me.PathText.Text = "" Then
|
||||
MessageBox.Show("Path must not be blank.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
ElseIf Not Me.ShortNameText.Text = RemoteApp.Name And DoesAppExist(Me.ShortNameText.Text) Then
|
||||
MessageBox.Show("A RemoteApp with the same name already exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
ElseIf Me.Text = "New RemoteApp" And DoesAppExist(Me.ShortNameText.Text) Then
|
||||
MessageBox.Show("A RemoteApp with the same name already exists.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
Else
|
||||
SaveRemoteApp(Me.ShortNameText.Text.Trim, Me.FullNameText.Text, Me.PathText.Text, Me.VPathText.Text, Me.CommandLineText.Text, Me.CommandLineOptionCombo.SelectedIndex, Me.IconPathText.Text, Val(IconIndexText.Text), Me.TSWAbox.SelectedIndex)
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub IconIndexText_TextChanged(sender As Object, e As EventArgs) Handles IconIndexText.TextChanged
|
||||
ValidateInteger(IconIndexText)
|
||||
End Sub
|
||||
|
||||
Private Sub FTAButton_Click(sender As Object, e As EventArgs) Handles FTAButton.Click
|
||||
|
||||
RemoteAppFileTypeAssociation.EditFileTypes(RemoteApp)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ShortNameText_TextChanged(sender As Object, e As EventArgs) Handles ShortNameText.TextChanged
|
||||
ValidateAppName(Me.ShortNameText)
|
||||
End Sub
|
||||
|
||||
End Class
|
231
remoteapp-tool/RemoteAppFileTypeAssociation.Designer.vb
generated
Normal file
231
remoteapp-tool/RemoteAppFileTypeAssociation.Designer.vb
generated
Normal file
@ -0,0 +1,231 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppFileTypeAssociation
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppFileTypeAssociation))
|
||||
Me.FTAListView = New System.Windows.Forms.ListView()
|
||||
Me.FileExtension = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.IconPath = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.IconIndex = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.Associated = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.CreateButton = New System.Windows.Forms.Button()
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.DeleteButton = New System.Windows.Forms.Button()
|
||||
Me.EditButton = New System.Windows.Forms.Button()
|
||||
Me.CloseButton = New System.Windows.Forms.Button()
|
||||
Me.SetAssociationButton = New System.Windows.Forms.Button()
|
||||
Me.SmallerIcons2 = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'FTAListView
|
||||
'
|
||||
Me.FTAListView.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.FTAListView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.FTAListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.FileExtension, Me.IconPath, Me.IconIndex, Me.Associated})
|
||||
Me.FTAListView.FullRowSelect = True
|
||||
Me.FTAListView.GridLines = True
|
||||
Me.FTAListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
|
||||
Me.FTAListView.HideSelection = False
|
||||
Me.FTAListView.Location = New System.Drawing.Point(-1, -1)
|
||||
Me.FTAListView.MultiSelect = False
|
||||
Me.FTAListView.Name = "FTAListView"
|
||||
Me.FTAListView.Size = New System.Drawing.Size(496, 164)
|
||||
Me.FTAListView.Sorting = System.Windows.Forms.SortOrder.Ascending
|
||||
Me.FTAListView.TabIndex = 0
|
||||
Me.FTAListView.UseCompatibleStateImageBehavior = False
|
||||
Me.FTAListView.View = System.Windows.Forms.View.Details
|
||||
'
|
||||
'FileExtension
|
||||
'
|
||||
Me.FileExtension.Text = "Extension"
|
||||
Me.FileExtension.Width = 64
|
||||
'
|
||||
'IconPath
|
||||
'
|
||||
Me.IconPath.Text = "Icon Path"
|
||||
Me.IconPath.Width = 305
|
||||
'
|
||||
'IconIndex
|
||||
'
|
||||
Me.IconIndex.Text = "Index"
|
||||
Me.IconIndex.Width = 51
|
||||
'
|
||||
'Associated
|
||||
'
|
||||
Me.Associated.Text = "Association"
|
||||
Me.Associated.Width = 76
|
||||
'
|
||||
'CreateButton
|
||||
'
|
||||
Me.CreateButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.CreateButton.AutoSize = True
|
||||
Me.CreateButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatAppearance.BorderSize = 0
|
||||
Me.CreateButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CreateButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.CreateButton.ImageIndex = 1
|
||||
Me.CreateButton.ImageList = Me.SmallerIcons
|
||||
Me.CreateButton.Location = New System.Drawing.Point(12, 169)
|
||||
Me.CreateButton.Name = "CreateButton"
|
||||
Me.CreateButton.Size = New System.Drawing.Size(29, 29)
|
||||
Me.CreateButton.TabIndex = 1
|
||||
Me.CreateButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CreateButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "properties.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "plus.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(2, "minus.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(3, "tick.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(4, "flag2-add.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(5, "settings-16.ico")
|
||||
'
|
||||
'DeleteButton
|
||||
'
|
||||
Me.DeleteButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.DeleteButton.AutoSize = True
|
||||
Me.DeleteButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.Enabled = False
|
||||
Me.DeleteButton.FlatAppearance.BorderSize = 0
|
||||
Me.DeleteButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.DeleteButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.DeleteButton.ImageIndex = 2
|
||||
Me.DeleteButton.ImageList = Me.SmallerIcons
|
||||
Me.DeleteButton.Location = New System.Drawing.Point(48, 169)
|
||||
Me.DeleteButton.Name = "DeleteButton"
|
||||
Me.DeleteButton.Size = New System.Drawing.Size(29, 29)
|
||||
Me.DeleteButton.TabIndex = 2
|
||||
Me.DeleteButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.DeleteButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'EditButton
|
||||
'
|
||||
Me.EditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.EditButton.AutoSize = True
|
||||
Me.EditButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.Enabled = False
|
||||
Me.EditButton.FlatAppearance.BorderSize = 0
|
||||
Me.EditButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.EditButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.EditButton.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.EditButton.ImageIndex = 0
|
||||
Me.EditButton.ImageList = Me.SmallerIcons
|
||||
Me.EditButton.Location = New System.Drawing.Point(84, 169)
|
||||
Me.EditButton.Name = "EditButton"
|
||||
Me.EditButton.Size = New System.Drawing.Size(29, 29)
|
||||
Me.EditButton.TabIndex = 3
|
||||
Me.EditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.EditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'CloseButton
|
||||
'
|
||||
Me.CloseButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CloseButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CloseButton.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.CloseButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CloseButton.ImageIndex = 3
|
||||
Me.CloseButton.ImageList = Me.SmallerIcons
|
||||
Me.CloseButton.Location = New System.Drawing.Point(415, 169)
|
||||
Me.CloseButton.Name = "CloseButton"
|
||||
Me.CloseButton.Size = New System.Drawing.Size(67, 29)
|
||||
Me.CloseButton.TabIndex = 6
|
||||
Me.CloseButton.Text = "OK"
|
||||
Me.CloseButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CloseButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SetAssociationButton
|
||||
'
|
||||
Me.SetAssociationButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.SetAssociationButton.AutoSize = True
|
||||
Me.SetAssociationButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.SetAssociationButton.Enabled = False
|
||||
Me.SetAssociationButton.FlatAppearance.BorderSize = 0
|
||||
Me.SetAssociationButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.SetAssociationButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.SetAssociationButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.SetAssociationButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.SetAssociationButton.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.SetAssociationButton.ImageIndex = 4
|
||||
Me.SetAssociationButton.ImageList = Me.SmallerIcons
|
||||
Me.SetAssociationButton.Location = New System.Drawing.Point(119, 169)
|
||||
Me.SetAssociationButton.Name = "SetAssociationButton"
|
||||
Me.SetAssociationButton.Size = New System.Drawing.Size(29, 29)
|
||||
Me.SetAssociationButton.TabIndex = 4
|
||||
Me.SetAssociationButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.SetAssociationButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SmallerIcons2
|
||||
'
|
||||
Me.SmallerIcons2.ImageStream = CType(resources.GetObject("SmallerIcons2.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons2.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons2.Images.SetKeyName(0, "cross.ico")
|
||||
'
|
||||
'RemoteAppFileTypeAssociation
|
||||
'
|
||||
Me.AcceptButton = Me.CloseButton
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.ClientSize = New System.Drawing.Size(494, 208)
|
||||
Me.Controls.Add(Me.SetAssociationButton)
|
||||
Me.Controls.Add(Me.CloseButton)
|
||||
Me.Controls.Add(Me.CreateButton)
|
||||
Me.Controls.Add(Me.DeleteButton)
|
||||
Me.Controls.Add(Me.EditButton)
|
||||
Me.Controls.Add(Me.FTAListView)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.MinimumSize = New System.Drawing.Size(510, 247)
|
||||
Me.Name = "RemoteAppFileTypeAssociation"
|
||||
Me.Text = "File Type Associations"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents FTAListView As System.Windows.Forms.ListView
|
||||
Friend WithEvents FileExtension As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconPath As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconIndex As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents CreateButton As System.Windows.Forms.Button
|
||||
Friend WithEvents DeleteButton As System.Windows.Forms.Button
|
||||
Friend WithEvents EditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents CloseButton As System.Windows.Forms.Button
|
||||
Friend WithEvents Associated As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents SetAssociationButton As System.Windows.Forms.Button
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents SmallerIcons2 As System.Windows.Forms.ImageList
|
||||
End Class
|
6468
remoteapp-tool/RemoteAppFileTypeAssociation.resx
Normal file
6468
remoteapp-tool/RemoteAppFileTypeAssociation.resx
Normal file
File diff suppressed because it is too large
Load Diff
196
remoteapp-tool/RemoteAppFileTypeAssociation.vb
Normal file
196
remoteapp-tool/RemoteAppFileTypeAssociation.vb
Normal file
@ -0,0 +1,196 @@
|
||||
Public Class RemoteAppFileTypeAssociation
|
||||
|
||||
Private RemoteApp As New RemoteAppLib.RemoteApp
|
||||
|
||||
Public Function EditFileTypes(SelectedRemoteApp As RemoteAppLib.RemoteApp) As RemoteAppLib.RemoteApp
|
||||
RemoteApp = SelectedRemoteApp
|
||||
Me.Text = "File type associations for " & RemoteApp.Name
|
||||
HelpSystem.SetupTips(Me)
|
||||
LoadFTAs()
|
||||
Me.ShowDialog()
|
||||
Me.Dispose()
|
||||
Return RemoteApp
|
||||
End Function
|
||||
|
||||
'Private Sub SetToolTips()
|
||||
' Dim toolTip1 As New ToolTip()
|
||||
' ' Set up the delays for the ToolTip.
|
||||
' toolTip1.AutoPopDelay = 5000
|
||||
' toolTip1.InitialDelay = 1000
|
||||
' toolTip1.ReshowDelay = 500
|
||||
' ' Force the ToolTip text to be displayed whether or not the form is active:
|
||||
' ' toolTip1.ShowAlways = True
|
||||
|
||||
' toolTip1.SetToolTip(Me.CreateButton, "Create a new File Type Association")
|
||||
' toolTip1.SetToolTip(Me.DeleteButton, "Delete selected File Type Association")
|
||||
' toolTip1.SetToolTip(Me.EditButton, "Change icon of selected File Type Association")
|
||||
'End Sub
|
||||
|
||||
Private Sub LoadFTAs()
|
||||
FTAListView.Items.Clear()
|
||||
|
||||
If Not RemoteApp.FileTypeAssociations Is Nothing Then
|
||||
For Each fta As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
Dim FTitem As New ListViewItem(fta.Extension)
|
||||
|
||||
Dim ftaStatus As String
|
||||
If LocalFtaModule.DoesFTAExist(fta.Extension) Then
|
||||
'FTA exists - created by another app
|
||||
ftaStatus = "Existing"
|
||||
If LocalFtaModule.IsFTAMine(fta.Extension) Then
|
||||
'FTA exists - created by RemoteApp Tool
|
||||
ftaStatus = "Yes"
|
||||
End If
|
||||
Else
|
||||
'FTA does not exist
|
||||
ftaStatus = "No"
|
||||
End If
|
||||
|
||||
|
||||
FTitem.SubItems.Add(fta.IconPath)
|
||||
FTitem.SubItems.Add(fta.IconIndex)
|
||||
FTitem.SubItems.Add(ftaStatus)
|
||||
FTAListView.Items.Add(FTitem)
|
||||
Next
|
||||
End If
|
||||
CheckSelection()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CreateButton_Click(sender As Object, e As EventArgs) Handles CreateButton.Click
|
||||
If RemoteApp.FileTypeAssociations Is Nothing Then
|
||||
Dim FTACol As New RemoteAppLib.FileTypeAssociationCollection
|
||||
RemoteApp.FileTypeAssociations = FTACol
|
||||
End If
|
||||
|
||||
Dim FTA As New RemoteAppLib.FileTypeAssociation
|
||||
FTA = RemoteAppIconPicker.ManageFTA(RemoteApp.IconPath, 0)
|
||||
Dim SameFTA As Boolean = False
|
||||
If Not FTA.Extension Is Nothing Then
|
||||
For Each RAFTA As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
If RAFTA.Extension = FTA.Extension Then SameFTA = True
|
||||
Next
|
||||
If Not SameFTA Then
|
||||
RemoteApp.FileTypeAssociations.Add(FTA)
|
||||
Else
|
||||
MessageBox.Show("There is already an association for filetype: " & FTA.Extension, "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
|
||||
End If
|
||||
|
||||
End If
|
||||
LoadFTAs()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub FTAListView_DoubleClick(sender As Object, e As EventArgs) Handles FTAListView.DoubleClick
|
||||
EditFTA()
|
||||
End Sub
|
||||
|
||||
Private Sub FTAListView_SelectedIndexChanged(sender As Object, e As EventArgs) Handles FTAListView.SelectedIndexChanged
|
||||
CheckSelection()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckSelection()
|
||||
If FTAListView.SelectedItems.Count > 0 Then
|
||||
Me.EditButton.Enabled = True
|
||||
Me.DeleteButton.Enabled = True
|
||||
Me.SetAssociationButton.Enabled = True
|
||||
Else
|
||||
Me.EditButton.Enabled = False
|
||||
Me.DeleteButton.Enabled = False
|
||||
Me.SetAssociationButton.Enabled = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CloseButton_Click(sender As Object, e As EventArgs) Handles CloseButton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteButton_Click(sender As Object, e As EventArgs) Handles DeleteButton.Click
|
||||
Dim FileType = FTAListView.SelectedItems(0).Text
|
||||
If MessageBox.Show("Are you sure you want to remove filetype:" & vbCrLf & "." & FileType & " ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Yes Then
|
||||
Dim IconPath = FTAListView.SelectedItems(0).SubItems(0).Text
|
||||
Dim IconIndex = FTAListView.SelectedItems(0).SubItems(1).Text
|
||||
Dim FTAtoRemove As New RemoteAppLib.FileTypeAssociation
|
||||
For Each FTA As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
If FTA.Extension = FileType Then FTAtoRemove = FTA
|
||||
Next
|
||||
RemoteApp.FileTypeAssociations.Remove(FTAtoRemove)
|
||||
End If
|
||||
|
||||
LoadFTAs()
|
||||
End Sub
|
||||
|
||||
Private Sub EditButton_Click(sender As Object, e As EventArgs) Handles EditButton.Click
|
||||
EditFTA()
|
||||
End Sub
|
||||
|
||||
Private Sub EditFTA()
|
||||
Dim FTA As New RemoteAppLib.FileTypeAssociation
|
||||
|
||||
FTA = RemoteAppIconPicker.ManageFTA(Me.FTAListView.SelectedItems(0).SubItems(1).Text, Val(Me.FTAListView.SelectedItems(0).SubItems(2).Text), Me.FTAListView.SelectedItems(0).Text, True)
|
||||
|
||||
If Not FTA.Extension Is Nothing Then
|
||||
Dim IconPath = FTAListView.SelectedItems(0).SubItems(0).Text
|
||||
Dim IconIndex = FTAListView.SelectedItems(0).SubItems(1).Text
|
||||
Dim FileType = FTAListView.SelectedItems(0).Text
|
||||
Dim FTAtoRemove As New RemoteAppLib.FileTypeAssociation
|
||||
|
||||
For Each FTA2 As RemoteAppLib.FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
If FTA2.Extension = FileType Then FTAtoRemove = FTA2
|
||||
Next
|
||||
RemoteApp.FileTypeAssociations.Remove(FTAtoRemove)
|
||||
RemoteApp.FileTypeAssociations.Add(FTA)
|
||||
LoadFTAs()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub SetAssociationButton_Click(sender As Object, e As EventArgs) Handles SetAssociationButton.Click ' NEED TO SORT OUT EVERYTHING IN THIS SUB!!!
|
||||
Dim fta As New RemoteAppLib.FileTypeAssociation
|
||||
fta.Extension = FTAListView.SelectedItems(0).SubItems(0).Text
|
||||
fta.IconPath = FTAListView.SelectedItems(0).SubItems(1).Text
|
||||
fta.IconIndex = FTAListView.SelectedItems(0).SubItems(2).Text
|
||||
|
||||
Dim MsgBoxResult As Windows.Forms.DialogResult = Windows.Forms.DialogResult.Cancel
|
||||
|
||||
If LocalFtaModule.DoesFTAExist(fta.Extension) Then
|
||||
'An existing association was found
|
||||
If Not IsFTAMine(fta.Extension) Then
|
||||
'FTA found and belongs to another application (replace?)
|
||||
MsgBoxResult = MessageBox.Show("An association already exists on the local computer for filetype. " & _
|
||||
"Would you like to replace it?" & vbCrLf & vbCrLf & _
|
||||
"Warning: This association was created by another application. " & _
|
||||
"Replacing it can cause problems. " & _
|
||||
"If the existing association is working, there is no need to replace it.", _
|
||||
"File Type Association", _
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)
|
||||
If MsgBoxResult = Windows.Forms.DialogResult.Yes Then _
|
||||
LocalFtaModule.CreateFTA(fta, RemoteApp.Path, RemoteApp.Name, True)
|
||||
Else
|
||||
'FTA found and belongs to RemoteApp Tool (remove)
|
||||
MsgBoxResult = MessageBox.Show("Are you sure you want to remove this file type association on the local computer?", _
|
||||
"File Type Association", _
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)
|
||||
If MsgBoxResult = Windows.Forms.DialogResult.Yes Then _
|
||||
LocalFtaModule.DeleteFTA(fta.Extension)
|
||||
End If
|
||||
|
||||
Else
|
||||
'FTA not found (create)
|
||||
If LocalFtaModule.CreateFTA(fta, RemoteApp.Path, RemoteApp.Name) = True Then
|
||||
MessageBox.Show("File type association created for " & fta.Extension & ".", "File Type Association", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
Else
|
||||
MessageBox.Show("File type association not created. There was an error.", "File Type Association", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Me.LoadFTAs()
|
||||
End Sub
|
||||
|
||||
Private Sub CancelButton_Click(sender As Object, e As EventArgs)
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
113
remoteapp-tool/RemoteAppFunctions.vb
Normal file
113
remoteapp-tool/RemoteAppFunctions.vb
Normal file
@ -0,0 +1,113 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports RemoteAppLib
|
||||
|
||||
Module RemoteAppFunction
|
||||
|
||||
Public Sub ValidateInteger(TheTextBox As TextBox)
|
||||
Dim cloc = TheTextBox.SelectionStart
|
||||
TheTextBox.Text = Val(TheTextBox.Text)
|
||||
TheTextBox.Select(TheTextBox.Text.Length, 0)
|
||||
TheTextBox.Select(cloc, 0)
|
||||
End Sub
|
||||
|
||||
Public Sub ValidatePort(TheTextBox As TextBox)
|
||||
Dim cloc = TheTextBox.SelectionStart
|
||||
If Val(TheTextBox.Text) > 65535 Then
|
||||
TheTextBox.Text = "65535"
|
||||
cloc = TheTextBox.Text.Length
|
||||
End If
|
||||
|
||||
TheTextBox.Text = Val(TheTextBox.Text)
|
||||
TheTextBox.Select(TheTextBox.Text.Length, 0)
|
||||
TheTextBox.Select(cloc, 0)
|
||||
End Sub
|
||||
|
||||
Public Sub ValidateSeconds(TheTextBox As TextBox)
|
||||
Dim cloc = TheTextBox.SelectionStart
|
||||
If Val(TheTextBox.Text) > 2147483 Then
|
||||
TheTextBox.Text = 2147483
|
||||
cloc = TheTextBox.Text.Length
|
||||
End If
|
||||
|
||||
TheTextBox.Text = Val(TheTextBox.Text)
|
||||
TheTextBox.Select(TheTextBox.Text.Length, 0)
|
||||
TheTextBox.Select(cloc, 0)
|
||||
End Sub
|
||||
|
||||
Public Sub ValidateAppName(TheTextBox As TextBox)
|
||||
ValidateTextBoxR(TheTextBox, "[^\p{L}0-9\-_"" ""]")
|
||||
End Sub
|
||||
|
||||
Private Sub ValidateTextBoxR(TheTextBox As TextBox, regex As String)
|
||||
Dim cloc = TheTextBox.SelectionStart
|
||||
Dim rx As New Regex(regex)
|
||||
If (rx.IsMatch(TheTextBox.Text)) Then
|
||||
TheTextBox.Text = rx.Replace(TheTextBox.Text, "")
|
||||
TheTextBox.Select(cloc - 1, 0)
|
||||
Else
|
||||
TheTextBox.Select(cloc, 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function FixShortAppName(TheText As String)
|
||||
If TheText <> "" Then
|
||||
Dim rx As New Regex("[^\p{L}0-9\-_"" ""]")
|
||||
If (rx.IsMatch(TheText)) Then
|
||||
TheText = rx.Replace(TheText, "")
|
||||
End If
|
||||
End If
|
||||
TheText = TheText.Trim
|
||||
Return TheText
|
||||
End Function
|
||||
|
||||
Public Sub ValidateDNSname(ByVal TheTextBox As TextBox)
|
||||
' pattern matches any character that is NOT A-Z (allows upper and lower case alphabets)
|
||||
Dim rx As New Regex("[^\p{L}0-9\-\.]")
|
||||
If (rx.IsMatch(TheTextBox.Text)) Then
|
||||
TheTextBox.Text = rx.Replace(TheTextBox.Text, "")
|
||||
TheTextBox.Select(TheTextBox.Text.Length, 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub ValidateFileType(ByVal TheTextBox As TextBox)
|
||||
' pattern matches any character that is NOT A-Z (allows upper and lower case alphabets)
|
||||
Dim rx As New Regex("[^\p{L}0-9\-_\!\@\#\$\%\^\&\(\)\{\}\[\]\+\=\;\,\']")
|
||||
If (rx.IsMatch(TheTextBox.Text)) Then
|
||||
TheTextBox.Text = rx.Replace(TheTextBox.Text, "")
|
||||
TheTextBox.Select(TheTextBox.Text.Length, 0)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetAppBitmap(RemoteAppShortName As String)
|
||||
On Error Resume Next
|
||||
Dim AppKey As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications" & "\" & RemoteAppShortName
|
||||
Dim TheRegKey = My.Computer.Registry.LocalMachine.OpenSubKey(AppKey)
|
||||
Dim TheIcon = ReturnIcon("", 0).ToBitmap
|
||||
If Not TheRegKey Is Nothing Then
|
||||
Dim IconPath = TheRegKey.GetValue("IconPath", "")
|
||||
Dim IconIndex = TheRegKey.GetValue("IconIndex", "")
|
||||
TheIcon = ReturnIcon(IconPath, IconIndex).ToBitmap
|
||||
End If
|
||||
Return TheIcon
|
||||
End Function
|
||||
|
||||
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
|
||||
|
||||
Public Function GetSysDir() As String
|
||||
Return Environment.SystemDirectory.ToString
|
||||
End Function
|
||||
|
||||
Public Sub DeleteFiles(FilesArray As ArrayList)
|
||||
For Each dFile In FilesArray
|
||||
If My.Computer.FileSystem.FileExists(dFile) Then My.Computer.FileSystem.DeleteFile(dFile)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function GetEXETitle(exePath As String)
|
||||
Dim pname = System.Diagnostics.FileVersionInfo.GetVersionInfo(exePath).FileDescription
|
||||
If pname = "" Then pname = Left(My.Computer.FileSystem.GetFileInfo(exePath).Name, My.Computer.FileSystem.GetFileInfo(exePath).Name.Length - 4)
|
||||
|
||||
Return pname
|
||||
End Function
|
||||
|
||||
End Module
|
220
remoteapp-tool/RemoteAppHostOptions.Designer.vb
generated
Normal file
220
remoteapp-tool/RemoteAppHostOptions.Designer.vb
generated
Normal file
@ -0,0 +1,220 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppHostOptions
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppHostOptions))
|
||||
Me.TimeoutDisconnectedCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.DisableAllowListCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.DisconnectTimeTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label1 = New System.Windows.Forms.Label()
|
||||
Me.TimeoutIdleCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.IdleTimeTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.LogoffWhenTimoutCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.SaveButton = New System.Windows.Forms.Button()
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.CancelEditButton = New System.Windows.Forms.Button()
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox = New System.Windows.Forms.CheckBox()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'TimeoutDisconnectedCheckBox
|
||||
'
|
||||
Me.TimeoutDisconnectedCheckBox.AutoSize = True
|
||||
Me.TimeoutDisconnectedCheckBox.Location = New System.Drawing.Point(14, 64)
|
||||
Me.TimeoutDisconnectedCheckBox.Name = "TimeoutDisconnectedCheckBox"
|
||||
Me.TimeoutDisconnectedCheckBox.Size = New System.Drawing.Size(212, 19)
|
||||
Me.TimeoutDisconnectedCheckBox.TabIndex = 2
|
||||
Me.TimeoutDisconnectedCheckBox.Text = "Timeout for disconnected sessions:"
|
||||
Me.TimeoutDisconnectedCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'DisableAllowListCheckBox
|
||||
'
|
||||
Me.DisableAllowListCheckBox.AutoSize = True
|
||||
Me.DisableAllowListCheckBox.Location = New System.Drawing.Point(14, 14)
|
||||
Me.DisableAllowListCheckBox.Name = "DisableAllowListCheckBox"
|
||||
Me.DisableAllowListCheckBox.Size = New System.Drawing.Size(137, 19)
|
||||
Me.DisableAllowListCheckBox.TabIndex = 0
|
||||
Me.DisableAllowListCheckBox.Text = "Disable AppAllowList"
|
||||
Me.DisableAllowListCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'DisconnectTimeTextBox
|
||||
'
|
||||
Me.DisconnectTimeTextBox.Location = New System.Drawing.Point(245, 62)
|
||||
Me.DisconnectTimeTextBox.MaxLength = 8
|
||||
Me.DisconnectTimeTextBox.Name = "DisconnectTimeTextBox"
|
||||
Me.DisconnectTimeTextBox.Size = New System.Drawing.Size(83, 23)
|
||||
Me.DisconnectTimeTextBox.TabIndex = 3
|
||||
Me.DisconnectTimeTextBox.Text = "0"
|
||||
'
|
||||
'Label1
|
||||
'
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Location = New System.Drawing.Point(336, 66)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(50, 15)
|
||||
Me.Label1.TabIndex = 4
|
||||
Me.Label1.Text = "seconds"
|
||||
'
|
||||
'TimeoutIdleCheckBox
|
||||
'
|
||||
Me.TimeoutIdleCheckBox.AutoSize = True
|
||||
Me.TimeoutIdleCheckBox.Location = New System.Drawing.Point(14, 91)
|
||||
Me.TimeoutIdleCheckBox.Name = "TimeoutIdleCheckBox"
|
||||
Me.TimeoutIdleCheckBox.Size = New System.Drawing.Size(160, 19)
|
||||
Me.TimeoutIdleCheckBox.TabIndex = 5
|
||||
Me.TimeoutIdleCheckBox.Text = "Timeout for idle sessions:"
|
||||
Me.TimeoutIdleCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'IdleTimeTextBox
|
||||
'
|
||||
Me.IdleTimeTextBox.Location = New System.Drawing.Point(189, 89)
|
||||
Me.IdleTimeTextBox.MaxLength = 8
|
||||
Me.IdleTimeTextBox.Name = "IdleTimeTextBox"
|
||||
Me.IdleTimeTextBox.Size = New System.Drawing.Size(83, 23)
|
||||
Me.IdleTimeTextBox.TabIndex = 6
|
||||
Me.IdleTimeTextBox.Text = "0"
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Location = New System.Drawing.Point(280, 91)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(50, 15)
|
||||
Me.Label2.TabIndex = 7
|
||||
Me.Label2.Text = "seconds"
|
||||
'
|
||||
'LogoffWhenTimoutCheckBox
|
||||
'
|
||||
Me.LogoffWhenTimoutCheckBox.AutoSize = True
|
||||
Me.LogoffWhenTimoutCheckBox.Location = New System.Drawing.Point(14, 117)
|
||||
Me.LogoffWhenTimoutCheckBox.Name = "LogoffWhenTimoutCheckBox"
|
||||
Me.LogoffWhenTimoutCheckBox.Size = New System.Drawing.Size(262, 19)
|
||||
Me.LogoffWhenTimoutCheckBox.TabIndex = 8
|
||||
Me.LogoffWhenTimoutCheckBox.Text = "Logoff sessions when time limits are reached"
|
||||
Me.LogoffWhenTimoutCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'SaveButton
|
||||
'
|
||||
Me.SaveButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.SaveButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.SaveButton.FlatAppearance.BorderSize = 0
|
||||
Me.SaveButton.ImageIndex = 0
|
||||
Me.SaveButton.ImageList = Me.SmallerIcons
|
||||
Me.SaveButton.Location = New System.Drawing.Point(334, 190)
|
||||
Me.SaveButton.Name = "SaveButton"
|
||||
Me.SaveButton.Size = New System.Drawing.Size(67, 29)
|
||||
Me.SaveButton.TabIndex = 11
|
||||
Me.SaveButton.Text = "Save"
|
||||
Me.SaveButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.SaveButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "favorites_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "cross.ico")
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label3.ForeColor = System.Drawing.Color.Maroon
|
||||
Me.Label3.Location = New System.Drawing.Point(11, 145)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(385, 33)
|
||||
Me.Label3.TabIndex = 9
|
||||
Me.Label3.Text = "Note: Settings here will be overridden by local policy and group policy. Some set" & _
|
||||
"tings require a reboot."
|
||||
'
|
||||
'CancelEditButton
|
||||
'
|
||||
Me.CancelEditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CancelEditButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CancelEditButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.CancelEditButton.ImageIndex = 1
|
||||
Me.CancelEditButton.ImageList = Me.SmallerIcons
|
||||
Me.CancelEditButton.Location = New System.Drawing.Point(253, 190)
|
||||
Me.CancelEditButton.Name = "CancelEditButton"
|
||||
Me.CancelEditButton.Size = New System.Drawing.Size(75, 29)
|
||||
Me.CancelEditButton.TabIndex = 10
|
||||
Me.CancelEditButton.Text = "Cancel"
|
||||
Me.CancelEditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CancelEditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'AllowUnlistedRemoteProgramsCheckBox
|
||||
'
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.AutoSize = True
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Location = New System.Drawing.Point(14, 39)
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Name = "AllowUnlistedRemoteProgramsCheckBox"
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Size = New System.Drawing.Size(200, 19)
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.TabIndex = 1
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Text = "Allow Unlisted Remote Programs"
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.UseVisualStyleBackColor = True
|
||||
'
|
||||
'RemoteAppHostOptions
|
||||
'
|
||||
Me.AcceptButton = Me.SaveButton
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.CancelButton = Me.CancelEditButton
|
||||
Me.ClientSize = New System.Drawing.Size(413, 231)
|
||||
Me.Controls.Add(Me.SaveButton)
|
||||
Me.Controls.Add(Me.CancelEditButton)
|
||||
Me.Controls.Add(Me.Label3)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.Label1)
|
||||
Me.Controls.Add(Me.IdleTimeTextBox)
|
||||
Me.Controls.Add(Me.DisconnectTimeTextBox)
|
||||
Me.Controls.Add(Me.AllowUnlistedRemoteProgramsCheckBox)
|
||||
Me.Controls.Add(Me.DisableAllowListCheckBox)
|
||||
Me.Controls.Add(Me.LogoffWhenTimoutCheckBox)
|
||||
Me.Controls.Add(Me.TimeoutIdleCheckBox)
|
||||
Me.Controls.Add(Me.TimeoutDisconnectedCheckBox)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "RemoteAppHostOptions"
|
||||
Me.Text = "Host Options"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents TimeoutDisconnectedCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents DisableAllowListCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents DisconnectTimeTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label1 As System.Windows.Forms.Label
|
||||
Friend WithEvents TimeoutIdleCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents IdleTimeTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents Label2 As System.Windows.Forms.Label
|
||||
Friend WithEvents LogoffWhenTimoutCheckBox As System.Windows.Forms.CheckBox
|
||||
Friend WithEvents SaveButton As System.Windows.Forms.Button
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents Label3 As System.Windows.Forms.Label
|
||||
Friend WithEvents CancelEditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents AllowUnlistedRemoteProgramsCheckBox As System.Windows.Forms.CheckBox
|
||||
End Class
|
6377
remoteapp-tool/RemoteAppHostOptions.resx
Normal file
6377
remoteapp-tool/RemoteAppHostOptions.resx
Normal file
File diff suppressed because it is too large
Load Diff
139
remoteapp-tool/RemoteAppHostOptions.vb
Normal file
139
remoteapp-tool/RemoteAppHostOptions.vb
Normal file
@ -0,0 +1,139 @@
|
||||
Public Class RemoteAppHostOptions
|
||||
|
||||
Private Sub DisconnectTimeTextBox_TextChanged(sender As Object, e As EventArgs) Handles DisconnectTimeTextBox.TextChanged
|
||||
ValidateSeconds(Me.DisconnectTimeTextBox)
|
||||
End Sub
|
||||
|
||||
Private Sub IdleTimeTextBox_TextChanged(sender As Object, e As EventArgs) Handles IdleTimeTextBox.TextChanged
|
||||
ValidateSeconds(Me.IdleTimeTextBox)
|
||||
End Sub
|
||||
|
||||
Private Sub SaveButton_Click(sender As Object, e As EventArgs) Handles SaveButton.Click
|
||||
|
||||
Dim PolicyKeyStringMS = "SOFTWARE\Policies\Microsoft"
|
||||
Dim PolicyKeyString = "SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"
|
||||
Dim PolicyKey As Microsoft.Win32.RegistryKey
|
||||
|
||||
'Create policy reg keys
|
||||
Dim PolicyKeyMS = My.Computer.Registry.LocalMachine.OpenSubKey(PolicyKeyStringMS, True)
|
||||
Dim PolicyKeyWNT = PolicyKeyMS.CreateSubKey("Windows NT")
|
||||
Dim PolicyKeyTS = PolicyKeyWNT.CreateSubKey("Terminal Services")
|
||||
|
||||
PolicyKey = My.Computer.Registry.LocalMachine.OpenSubKey(PolicyKeyString, True)
|
||||
|
||||
If Me.DisableAllowListCheckBox.Checked Then
|
||||
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList", "fDisabledAllowList", "1", Microsoft.Win32.RegistryValueKind.DWord)
|
||||
Else
|
||||
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList", "fDisabledAllowList", "0", Microsoft.Win32.RegistryValueKind.DWord)
|
||||
End If
|
||||
|
||||
If Me.AllowUnlistedRemoteProgramsCheckBox.Checked Then
|
||||
PolicyKey.SetValue("fAllowUnlistedRemotePrograms", 1, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
Else
|
||||
PolicyKey.DeleteValue("fAllowUnlistedRemotePrograms", False)
|
||||
End If
|
||||
|
||||
If Me.TimeoutDisconnectedCheckBox.Checked Then
|
||||
PolicyKey.SetValue("MaxDisconnectionTime", Val(DisconnectTimeTextBox.Text) * 1000, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
Else
|
||||
PolicyKey.DeleteValue("MaxDisconnectionTime", False)
|
||||
End If
|
||||
|
||||
If Me.TimeoutIdleCheckBox.Checked Then
|
||||
PolicyKey.SetValue("MaxIdleTime", Val(IdleTimeTextBox.Text) * 1000, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
Else
|
||||
PolicyKey.DeleteValue("MaxIdleTime", False)
|
||||
End If
|
||||
|
||||
If Me.LogoffWhenTimoutCheckBox.Checked Then
|
||||
PolicyKey.SetValue("fResetBroken", "1", Microsoft.Win32.RegistryValueKind.DWord)
|
||||
Else
|
||||
PolicyKey.DeleteValue("fResetBroken", False)
|
||||
End If
|
||||
|
||||
Me.Close()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub SetValues()
|
||||
On Error Resume Next
|
||||
|
||||
Dim PolicyKeyString = "SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services"
|
||||
Dim PolicyKey = My.Computer.Registry.LocalMachine.OpenSubKey(PolicyKeyString, False)
|
||||
|
||||
Me.DisconnectTimeTextBox.Text = "0"
|
||||
Me.IdleTimeTextBox.Text = "0"
|
||||
|
||||
If Val(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList", "fDisabledAllowList", "")) = 1 Then
|
||||
Me.DisableAllowListCheckBox.Checked = True
|
||||
Else
|
||||
Me.DisableAllowListCheckBox.Checked = False
|
||||
End If
|
||||
|
||||
Dim MaxDisconnectionTime = -1
|
||||
MaxDisconnectionTime = PolicyKey.GetValue("MaxDisconnectionTime", -1)
|
||||
If Not MaxDisconnectionTime = -1 Then
|
||||
Me.TimeoutDisconnectedCheckBox.Checked = True
|
||||
Me.DisconnectTimeTextBox.Text = MaxDisconnectionTime / 1000
|
||||
Else
|
||||
Me.TimeoutDisconnectedCheckBox.Checked = False
|
||||
End If
|
||||
|
||||
Dim MaxIdleTime = -1
|
||||
MaxIdleTime = PolicyKey.GetValue("MaxIdleTime", -1)
|
||||
If Not MaxIdleTime = -1 Then
|
||||
Me.TimeoutIdleCheckBox.Checked = True
|
||||
Me.IdleTimeTextBox.Text = MaxIdleTime / 1000
|
||||
Else
|
||||
Me.TimeoutIdleCheckBox.Checked = False
|
||||
End If
|
||||
|
||||
Dim fResetBroken = PolicyKey.GetValue("fResetBroken")
|
||||
If Not fResetBroken = Nothing Then
|
||||
Me.LogoffWhenTimoutCheckBox.Checked = True
|
||||
Else
|
||||
Me.LogoffWhenTimoutCheckBox.Checked = False
|
||||
End If
|
||||
|
||||
Dim fAllowUnlistedRemotePrograms = PolicyKey.GetValue("fAllowUnlistedRemotePrograms")
|
||||
If Not fAllowUnlistedRemotePrograms = Nothing Then
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Checked = True
|
||||
Else
|
||||
Me.AllowUnlistedRemoteProgramsCheckBox.Checked = False
|
||||
End If
|
||||
|
||||
If Me.TimeoutDisconnectedCheckBox.Checked = True Then
|
||||
Me.DisconnectTimeTextBox.Enabled = True
|
||||
Else
|
||||
Me.DisconnectTimeTextBox.Enabled = False
|
||||
End If
|
||||
|
||||
If Me.TimeoutIdleCheckBox.Checked = True Then
|
||||
Me.IdleTimeTextBox.Enabled = True
|
||||
Else
|
||||
Me.IdleTimeTextBox.Enabled = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TimeoutDisconnectedCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles TimeoutDisconnectedCheckBox.CheckedChanged
|
||||
If Me.TimeoutDisconnectedCheckBox.Checked = True Then
|
||||
Me.DisconnectTimeTextBox.Enabled = True
|
||||
Else
|
||||
Me.DisconnectTimeTextBox.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TimeoutIdleCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles TimeoutIdleCheckBox.CheckedChanged
|
||||
If Me.TimeoutIdleCheckBox.Checked = True Then
|
||||
Me.IdleTimeTextBox.Enabled = True
|
||||
Else
|
||||
Me.IdleTimeTextBox.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CancelEditButton_Click(sender As Object, e As EventArgs) Handles CancelEditButton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
278
remoteapp-tool/RemoteAppIconPicker.Designer.vb
generated
Normal file
278
remoteapp-tool/RemoteAppIconPicker.Designer.vb
generated
Normal file
@ -0,0 +1,278 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppIconPicker
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppIconPicker))
|
||||
Me.IconList = New System.Windows.Forms.ListView()
|
||||
Me.ShortName = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.Title = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.Path = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.VPath = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.RequiredCommandLine = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.CommandLineSetting = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.IconPath = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.IconIndex = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.SecurityDescriptor = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.ShowInTSWA = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
|
||||
Me.BrowseButton = New System.Windows.Forms.Button()
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.IconPathTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.IconIndexTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.FileBrowserIcon = New System.Windows.Forms.OpenFileDialog()
|
||||
Me.CancelEditButton = New System.Windows.Forms.Button()
|
||||
Me.OKButton = New System.Windows.Forms.Button()
|
||||
Me.FileTypeLabel = New System.Windows.Forms.Label()
|
||||
Me.FileTypeTextBox = New System.Windows.Forms.TextBox()
|
||||
Me.IconIndexLabel = New System.Windows.Forms.Label()
|
||||
Me.SmallIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'IconList
|
||||
'
|
||||
Me.IconList.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconList.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ShortName, Me.Title, Me.Path, Me.VPath, Me.RequiredCommandLine, Me.CommandLineSetting, Me.IconPath, Me.IconIndex, Me.SecurityDescriptor, Me.ShowInTSWA})
|
||||
Me.IconList.GridLines = True
|
||||
Me.IconList.HideSelection = False
|
||||
Me.IconList.LargeImageList = Me.SmallIcons
|
||||
Me.IconList.Location = New System.Drawing.Point(16, 41)
|
||||
Me.IconList.MultiSelect = False
|
||||
Me.IconList.Name = "IconList"
|
||||
Me.IconList.Size = New System.Drawing.Size(471, 143)
|
||||
Me.IconList.SmallImageList = Me.SmallIcons
|
||||
Me.IconList.TabIndex = 4
|
||||
Me.IconList.UseCompatibleStateImageBehavior = False
|
||||
'
|
||||
'ShortName
|
||||
'
|
||||
Me.ShortName.Text = "ShortName"
|
||||
Me.ShortName.Width = 200
|
||||
'
|
||||
'Title
|
||||
'
|
||||
Me.Title.Text = "Name"
|
||||
'
|
||||
'Path
|
||||
'
|
||||
Me.Path.Text = "Path"
|
||||
'
|
||||
'VPath
|
||||
'
|
||||
Me.VPath.Text = "VPath"
|
||||
'
|
||||
'RequiredCommandLine
|
||||
'
|
||||
Me.RequiredCommandLine.Text = "RequiredCommandLine"
|
||||
'
|
||||
'CommandLineSetting
|
||||
'
|
||||
Me.CommandLineSetting.Text = "CommandLineSetting"
|
||||
'
|
||||
'IconPath
|
||||
'
|
||||
Me.IconPath.Text = "IconPath"
|
||||
'
|
||||
'IconIndex
|
||||
'
|
||||
Me.IconIndex.Text = "IconIndex"
|
||||
'
|
||||
'SecurityDescriptor
|
||||
'
|
||||
Me.SecurityDescriptor.Text = "SecurityDescriptor"
|
||||
'
|
||||
'ShowInTSWA
|
||||
'
|
||||
Me.ShowInTSWA.Text = "ShowInTSWA"
|
||||
'
|
||||
'BrowseButton
|
||||
'
|
||||
Me.BrowseButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.BrowseButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.BrowseButton.ImageIndex = 0
|
||||
Me.BrowseButton.ImageList = Me.SmallerIcons
|
||||
Me.BrowseButton.Location = New System.Drawing.Point(14, 8)
|
||||
Me.BrowseButton.Name = "BrowseButton"
|
||||
Me.BrowseButton.Size = New System.Drawing.Size(82, 29)
|
||||
Me.BrowseButton.TabIndex = 0
|
||||
Me.BrowseButton.Text = "Browse..."
|
||||
Me.BrowseButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.BrowseButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "folder_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "tick.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(2, "cross.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(3, "settings-16.ico")
|
||||
'
|
||||
'IconPathTextBox
|
||||
'
|
||||
Me.IconPathTextBox.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconPathTextBox.Location = New System.Drawing.Point(103, 12)
|
||||
Me.IconPathTextBox.Name = "IconPathTextBox"
|
||||
Me.IconPathTextBox.ReadOnly = True
|
||||
Me.IconPathTextBox.Size = New System.Drawing.Size(267, 23)
|
||||
Me.IconPathTextBox.TabIndex = 1
|
||||
'
|
||||
'IconIndexTextBox
|
||||
'
|
||||
Me.IconIndexTextBox.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconIndexTextBox.Location = New System.Drawing.Point(420, 12)
|
||||
Me.IconIndexTextBox.Name = "IconIndexTextBox"
|
||||
Me.IconIndexTextBox.ReadOnly = True
|
||||
Me.IconIndexTextBox.Size = New System.Drawing.Size(67, 23)
|
||||
Me.IconIndexTextBox.TabIndex = 3
|
||||
Me.IconIndexTextBox.Visible = False
|
||||
'
|
||||
'FileBrowserIcon
|
||||
'
|
||||
Me.FileBrowserIcon.Filter = "Icons|*.exe;*.dll;*.ico|All files|*.*"
|
||||
Me.FileBrowserIcon.Title = "Browse..."
|
||||
'
|
||||
'CancelEditButton
|
||||
'
|
||||
Me.CancelEditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CancelEditButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CancelEditButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.CancelEditButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CancelEditButton.ImageIndex = 2
|
||||
Me.CancelEditButton.ImageList = Me.SmallerIcons
|
||||
Me.CancelEditButton.Location = New System.Drawing.Point(339, 190)
|
||||
Me.CancelEditButton.Name = "CancelEditButton"
|
||||
Me.CancelEditButton.Size = New System.Drawing.Size(75, 29)
|
||||
Me.CancelEditButton.TabIndex = 7
|
||||
Me.CancelEditButton.Text = "Cancel"
|
||||
Me.CancelEditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CancelEditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'OKButton
|
||||
'
|
||||
Me.OKButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.OKButton.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.OKButton.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.OKButton.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.OKButton.ImageIndex = 1
|
||||
Me.OKButton.ImageList = Me.SmallerIcons
|
||||
Me.OKButton.Location = New System.Drawing.Point(420, 190)
|
||||
Me.OKButton.Name = "OKButton"
|
||||
Me.OKButton.Size = New System.Drawing.Size(67, 29)
|
||||
Me.OKButton.TabIndex = 8
|
||||
Me.OKButton.Text = "OK"
|
||||
Me.OKButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.OKButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'FileTypeLabel
|
||||
'
|
||||
Me.FileTypeLabel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.FileTypeLabel.AutoSize = True
|
||||
Me.FileTypeLabel.Location = New System.Drawing.Point(12, 197)
|
||||
Me.FileTypeLabel.Name = "FileTypeLabel"
|
||||
Me.FileTypeLabel.Size = New System.Drawing.Size(66, 15)
|
||||
Me.FileTypeLabel.TabIndex = 5
|
||||
Me.FileTypeLabel.Text = "File type: ."
|
||||
Me.FileTypeLabel.Visible = False
|
||||
'
|
||||
'FileTypeTextBox
|
||||
'
|
||||
Me.FileTypeTextBox.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.FileTypeTextBox.Location = New System.Drawing.Point(76, 194)
|
||||
Me.FileTypeTextBox.Name = "FileTypeTextBox"
|
||||
Me.FileTypeTextBox.Size = New System.Drawing.Size(80, 23)
|
||||
Me.FileTypeTextBox.TabIndex = 6
|
||||
Me.FileTypeTextBox.Text = "xyz"
|
||||
Me.FileTypeTextBox.Visible = False
|
||||
'
|
||||
'IconIndexLabel
|
||||
'
|
||||
Me.IconIndexLabel.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.IconIndexLabel.AutoSize = True
|
||||
Me.IconIndexLabel.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.IconIndexLabel.Location = New System.Drawing.Point(376, 15)
|
||||
Me.IconIndexLabel.Name = "IconIndexLabel"
|
||||
Me.IconIndexLabel.Size = New System.Drawing.Size(38, 15)
|
||||
Me.IconIndexLabel.TabIndex = 2
|
||||
Me.IconIndexLabel.Text = "Index:"
|
||||
Me.IconIndexLabel.Visible = False
|
||||
'
|
||||
'SmallIcons
|
||||
'
|
||||
Me.SmallIcons.ImageStream = CType(resources.GetObject("SmallIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallIcons.Images.SetKeyName(0, "smallicons.ico")
|
||||
'
|
||||
'RemoteAppIconPicker
|
||||
'
|
||||
Me.AcceptButton = Me.OKButton
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.CancelButton = Me.CancelEditButton
|
||||
Me.ClientSize = New System.Drawing.Size(499, 231)
|
||||
Me.Controls.Add(Me.IconIndexLabel)
|
||||
Me.Controls.Add(Me.CancelEditButton)
|
||||
Me.Controls.Add(Me.OKButton)
|
||||
Me.Controls.Add(Me.IconIndexTextBox)
|
||||
Me.Controls.Add(Me.IconPathTextBox)
|
||||
Me.Controls.Add(Me.BrowseButton)
|
||||
Me.Controls.Add(Me.IconList)
|
||||
Me.Controls.Add(Me.FileTypeTextBox)
|
||||
Me.Controls.Add(Me.FileTypeLabel)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.MinimumSize = New System.Drawing.Size(515, 270)
|
||||
Me.Name = "RemoteAppIconPicker"
|
||||
Me.Text = "RemoteAppIconPicker"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents IconList As System.Windows.Forms.ListView
|
||||
Friend WithEvents ShortName As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents Title As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents Path As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents VPath As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents RequiredCommandLine As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents CommandLineSetting As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconPath As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconIndex As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents SecurityDescriptor As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents ShowInTSWA As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents BrowseButton As System.Windows.Forms.Button
|
||||
Friend WithEvents IconPathTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents IconIndexTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents FileBrowserIcon As System.Windows.Forms.OpenFileDialog
|
||||
Friend WithEvents CancelEditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents OKButton As System.Windows.Forms.Button
|
||||
Friend WithEvents FileTypeLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents FileTypeTextBox As System.Windows.Forms.TextBox
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents IconIndexLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents SmallIcons As System.Windows.Forms.ImageList
|
||||
End Class
|
6495
remoteapp-tool/RemoteAppIconPicker.resx
Normal file
6495
remoteapp-tool/RemoteAppIconPicker.resx
Normal file
File diff suppressed because it is too large
Load Diff
158
remoteapp-tool/RemoteAppIconPicker.vb
Normal file
158
remoteapp-tool/RemoteAppIconPicker.vb
Normal file
@ -0,0 +1,158 @@
|
||||
Public Class RemoteAppIconPicker
|
||||
|
||||
Dim NoValidate As Boolean = False
|
||||
|
||||
Public Function PickIcon(DefaultPath As String, Optional DefaultIndex As Integer = 0) As RemoteAppLib.IconSelection
|
||||
Me.FileTypeLabel.Visible = False
|
||||
Me.FileTypeTextBox.Visible = False
|
||||
Me.IconIndexLabel.Visible = False
|
||||
Me.IconIndexTextBox.Visible = False
|
||||
|
||||
Me.Text = "Select Icon"
|
||||
|
||||
Me.IconPathTextBox.Text = DefaultPath
|
||||
Me.IconIndexTextBox.Text = DefaultIndex.ToString
|
||||
|
||||
LoadIcons()
|
||||
Dim IconPick As New RemoteAppLib.IconSelection
|
||||
|
||||
If Me.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||
IconPick.IconPath = Me.IconPathTextBox.Text
|
||||
IconPick.IconIndex = Me.IconIndexTextBox.Text
|
||||
End If
|
||||
|
||||
Return IconPick
|
||||
|
||||
Me.Dispose()
|
||||
|
||||
End Function
|
||||
|
||||
Public Function ManageFTA(DefaultPath As String, Optional DefaultIndex As Integer = 0, Optional FileType As String = ".xyz", Optional IsEdit As Boolean = False) As RemoteAppLib.FileTypeAssociation
|
||||
|
||||
Dim FTA As New RemoteAppLib.FileTypeAssociation
|
||||
|
||||
Me.FileTypeLabel.Visible = True
|
||||
Me.FileTypeTextBox.Visible = True
|
||||
Me.IconIndexLabel.Visible = True
|
||||
Me.IconIndexTextBox.Visible = True
|
||||
Me.IconIndexTextBox.ReadOnly = True
|
||||
|
||||
If IsEdit = True Then
|
||||
FileTypeTextBox.ReadOnly = True
|
||||
Else
|
||||
FileTypeTextBox.ReadOnly = False
|
||||
End If
|
||||
|
||||
Me.Text = "File Type"
|
||||
|
||||
Me.FileTypeTextBox.Text = FileType
|
||||
Me.IconPathTextBox.Text = DefaultPath
|
||||
Me.IconIndexTextBox.Text = DefaultIndex
|
||||
|
||||
LoadIcons()
|
||||
|
||||
If Me.ShowDialog = Windows.Forms.DialogResult.OK Then
|
||||
FTA.Extension = Me.FileTypeTextBox.Text
|
||||
FTA.IconPath = Me.IconPathTextBox.Text
|
||||
FTA.IconIndex = Me.IconIndexTextBox.Text
|
||||
End If
|
||||
|
||||
Me.Dispose()
|
||||
|
||||
Return FTA
|
||||
|
||||
End Function
|
||||
|
||||
Private Function LoadIcons() As Boolean
|
||||
Me.IconList.Clear()
|
||||
Me.SmallIcons.Images.Clear()
|
||||
Dim IconError As Boolean = False
|
||||
|
||||
Me.IconIndexLabel.Visible = True
|
||||
Me.IconIndexTextBox.Visible = True
|
||||
|
||||
If My.Computer.FileSystem.FileExists(Me.IconPathTextBox.Text) Then
|
||||
Dim mIcon As New IconLib.MultiIcon
|
||||
Dim IconIndex As Integer = 0
|
||||
|
||||
Try
|
||||
mIcon.Load(Me.IconPathTextBox.Text)
|
||||
Me.IconIndexTextBox.ReadOnly = True
|
||||
Catch Ex As Exception
|
||||
IconError = True
|
||||
NoValidate = True
|
||||
Me.OKButton.Enabled = True
|
||||
MessageBox.Show("There was an error loading icons from:" & vbCrLf & Me.IconPathTextBox.Text & vbCrLf & "Icons may still be usable, but you can not select one using the icon picker.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
|
||||
Me.IconIndexTextBox.Text = "0"
|
||||
Me.IconIndexTextBox.ReadOnly = False
|
||||
End Try
|
||||
|
||||
If Not IconError Then
|
||||
NoValidate = False
|
||||
For Each sIcon In mIcon
|
||||
Dim IconKey = IconIndex
|
||||
Dim IconItem As New ListViewItem(IconKey)
|
||||
Dim fiImage As IconLib.IconImage = sIcon.Item(0)
|
||||
For Each iImage In sIcon
|
||||
If iImage.Icon.Width = 32 Then
|
||||
Select Case iImage.ColorsInPalette
|
||||
Case 0
|
||||
fiImage = iImage
|
||||
Case Else
|
||||
If iImage.ColorsInPalette > fiImage.ColorsInPalette Then fiImage = iImage
|
||||
End Select
|
||||
If iImage.ColorsInPalette = 0 Then fiImage = iImage
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Dim TheBitmap = fiImage.Icon.ToBitmap
|
||||
|
||||
Me.SmallIcons.Images.Add(IconKey, TheBitmap)
|
||||
IconItem.ImageKey = IconKey
|
||||
|
||||
IconList.Items.Add(IconItem)
|
||||
IconIndex += 1
|
||||
Next
|
||||
If Not NoValidate Then Me.OKButton.Enabled = False
|
||||
End If
|
||||
End If
|
||||
Return IconError
|
||||
End Function
|
||||
|
||||
Private Sub IconList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles IconList.SelectedIndexChanged
|
||||
CheckSelection()
|
||||
End Sub
|
||||
|
||||
Private Sub CheckSelection()
|
||||
If Me.IconList.SelectedItems.Count > 0 Then
|
||||
'something is selected
|
||||
If Not FileTypeTextBox.Text = "" Then Me.OKButton.Enabled = True
|
||||
Me.IconIndexTextBox.Text = Me.IconList.SelectedItems(0).Text
|
||||
|
||||
Else
|
||||
'nothing is selected
|
||||
If Not NoValidate Then Me.OKButton.Enabled = False
|
||||
Me.IconIndexTextBox.Text = "0"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BrowseButton_Click(sender As Object, e As EventArgs) Handles BrowseButton.Click
|
||||
If My.Computer.FileSystem.FileExists(Me.IconPathTextBox.Text) Then _
|
||||
Me.FileBrowserIcon.InitialDirectory = My.Computer.FileSystem.GetParentPath(Me.IconPathTextBox.Text)
|
||||
If FileBrowserIcon.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||
Me.IconPathTextBox.Text = FileBrowserIcon.FileName
|
||||
LoadIcons()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub FileTypeTextBox_TextChanged(sender As Object, e As EventArgs) Handles FileTypeTextBox.TextChanged
|
||||
ValidateFileType(FileTypeTextBox)
|
||||
If Me.FileTypeTextBox.Text = "" Then Me.OKButton.Enabled = False Else If Me.IconList.SelectedItems.Count = 1 Then Me.OKButton.Enabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub IconIndexTextBox_TextChanged(sender As Object, e As EventArgs) Handles IconIndexTextBox.TextChanged
|
||||
ValidateInteger(IconIndexTextBox)
|
||||
End Sub
|
||||
|
||||
End Class
|
391
remoteapp-tool/RemoteAppMainWindow.Designer.vb
generated
Normal file
391
remoteapp-tool/RemoteAppMainWindow.Designer.vb
generated
Normal file
@ -0,0 +1,391 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class RemoteAppMainWindow
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<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
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(RemoteAppMainWindow))
|
||||
Me.AppList = New System.Windows.Forms.ListView()
|
||||
Me.ShortName = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.Title = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.Path = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.VPath = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.RequiredCommandLine = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.CommandLineSetting = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.IconPath = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.IconIndex = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.SecurityDescriptor = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.ShowInTSWA = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
|
||||
Me.SmallIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.SmallerIcons = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.NoAppsLabel = New System.Windows.Forms.Label()
|
||||
Me.CreateButton = New System.Windows.Forms.Button()
|
||||
Me.DeleteButton = New System.Windows.Forms.Button()
|
||||
Me.EditButton = New System.Windows.Forms.Button()
|
||||
Me.CreateClientConnection = New System.Windows.Forms.Button()
|
||||
Me.ToolsMenuStrip = New System.Windows.Forms.MenuStrip()
|
||||
Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ToolsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.HostOptionsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.HelpToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.WebsiteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.AboutToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
|
||||
Me.RemoveUnusedFileTypeAssociationsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.NewRemoteAppadvancedToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.ToolsMenuStrip.SuspendLayout()
|
||||
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'AppList
|
||||
'
|
||||
Me.AppList.Alignment = System.Windows.Forms.ListViewAlignment.[Default]
|
||||
Me.AppList.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.AppList.BackColor = System.Drawing.Color.White
|
||||
Me.AppList.BorderStyle = System.Windows.Forms.BorderStyle.None
|
||||
Me.AppList.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ShortName, Me.Title, Me.Path, Me.VPath, Me.RequiredCommandLine, Me.CommandLineSetting, Me.IconPath, Me.IconIndex, Me.SecurityDescriptor, Me.ShowInTSWA})
|
||||
Me.AppList.GridLines = True
|
||||
Me.AppList.HideSelection = False
|
||||
Me.AppList.LargeImageList = Me.SmallIcons
|
||||
Me.AppList.Location = New System.Drawing.Point(12, 28)
|
||||
Me.AppList.MultiSelect = False
|
||||
Me.AppList.Name = "AppList"
|
||||
Me.AppList.Size = New System.Drawing.Size(423, 189)
|
||||
Me.AppList.SmallImageList = Me.SmallIcons
|
||||
Me.AppList.TabIndex = 1
|
||||
Me.AppList.TileSize = New System.Drawing.Size(200, 36)
|
||||
Me.AppList.UseCompatibleStateImageBehavior = False
|
||||
Me.AppList.View = System.Windows.Forms.View.Tile
|
||||
'
|
||||
'ShortName
|
||||
'
|
||||
Me.ShortName.Text = "ShortName"
|
||||
Me.ShortName.Width = 200
|
||||
'
|
||||
'Title
|
||||
'
|
||||
Me.Title.Text = "Name"
|
||||
'
|
||||
'Path
|
||||
'
|
||||
Me.Path.Text = "Path"
|
||||
'
|
||||
'VPath
|
||||
'
|
||||
Me.VPath.Text = "VPath"
|
||||
'
|
||||
'RequiredCommandLine
|
||||
'
|
||||
Me.RequiredCommandLine.Text = "RequiredCommandLine"
|
||||
'
|
||||
'CommandLineSetting
|
||||
'
|
||||
Me.CommandLineSetting.Text = "CommandLineSetting"
|
||||
'
|
||||
'IconPath
|
||||
'
|
||||
Me.IconPath.Text = "IconPath"
|
||||
'
|
||||
'IconIndex
|
||||
'
|
||||
Me.IconIndex.Text = "IconIndex"
|
||||
'
|
||||
'SecurityDescriptor
|
||||
'
|
||||
Me.SecurityDescriptor.Text = "SecurityDescriptor"
|
||||
'
|
||||
'ShowInTSWA
|
||||
'
|
||||
Me.ShowInTSWA.Text = "ShowInTSWA"
|
||||
'
|
||||
'SmallIcons
|
||||
'
|
||||
Me.SmallIcons.ImageStream = CType(resources.GetObject("SmallIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallIcons.Images.SetKeyName(0, "smallicons.ico")
|
||||
'
|
||||
'SmallerIcons
|
||||
'
|
||||
Me.SmallerIcons.ImageStream = CType(resources.GetObject("SmallerIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.SmallerIcons.TransparentColor = System.Drawing.Color.Transparent
|
||||
Me.SmallerIcons.Images.SetKeyName(0, "tools_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(1, "help_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(2, "folder_16x16.png")
|
||||
Me.SmallerIcons.Images.SetKeyName(3, "msi small.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(4, "properties.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(5, "plus.ico")
|
||||
Me.SmallerIcons.Images.SetKeyName(6, "minus.ico")
|
||||
'
|
||||
'NoAppsLabel
|
||||
'
|
||||
Me.NoAppsLabel.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.NoAppsLabel.ForeColor = System.Drawing.Color.DarkGray
|
||||
Me.NoAppsLabel.Location = New System.Drawing.Point(12, 91)
|
||||
Me.NoAppsLabel.Name = "NoAppsLabel"
|
||||
Me.NoAppsLabel.Size = New System.Drawing.Size(410, 58)
|
||||
Me.NoAppsLabel.TabIndex = 0
|
||||
Me.NoAppsLabel.Text = "There are no RemoteApps hosted on this computer." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Click + to add one."
|
||||
Me.NoAppsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||
Me.NoAppsLabel.Visible = False
|
||||
'
|
||||
'CreateButton
|
||||
'
|
||||
Me.CreateButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.CreateButton.AutoSize = True
|
||||
Me.CreateButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatAppearance.BorderSize = 0
|
||||
Me.CreateButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.CreateButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.CreateButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.CreateButton.ImageIndex = 5
|
||||
Me.CreateButton.ImageList = Me.SmallerIcons
|
||||
Me.CreateButton.Location = New System.Drawing.Point(12, 227)
|
||||
Me.CreateButton.Name = "CreateButton"
|
||||
Me.CreateButton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.CreateButton.TabIndex = 2
|
||||
Me.CreateButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CreateButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'DeleteButton
|
||||
'
|
||||
Me.DeleteButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.DeleteButton.AutoSize = True
|
||||
Me.DeleteButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.Enabled = False
|
||||
Me.DeleteButton.FlatAppearance.BorderSize = 0
|
||||
Me.DeleteButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.DeleteButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.DeleteButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.DeleteButton.ImageIndex = 6
|
||||
Me.DeleteButton.ImageList = Me.SmallerIcons
|
||||
Me.DeleteButton.Location = New System.Drawing.Point(40, 227)
|
||||
Me.DeleteButton.Name = "DeleteButton"
|
||||
Me.DeleteButton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.DeleteButton.TabIndex = 3
|
||||
Me.DeleteButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.DeleteButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'EditButton
|
||||
'
|
||||
Me.EditButton.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.EditButton.AutoSize = True
|
||||
Me.EditButton.BackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.Enabled = False
|
||||
Me.EditButton.FlatAppearance.BorderSize = 0
|
||||
Me.EditButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent
|
||||
Me.EditButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.EditButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.EditButton.ForeColor = System.Drawing.SystemColors.ControlText
|
||||
Me.EditButton.ImageIndex = 4
|
||||
Me.EditButton.ImageList = Me.SmallerIcons
|
||||
Me.EditButton.Location = New System.Drawing.Point(68, 227)
|
||||
Me.EditButton.Name = "EditButton"
|
||||
Me.EditButton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.EditButton.TabIndex = 4
|
||||
Me.EditButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.EditButton.UseVisualStyleBackColor = False
|
||||
'
|
||||
'CreateClientConnection
|
||||
'
|
||||
Me.CreateClientConnection.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.CreateClientConnection.AutoSize = True
|
||||
Me.CreateClientConnection.BackColor = System.Drawing.Color.WhiteSmoke
|
||||
Me.CreateClientConnection.Enabled = False
|
||||
Me.CreateClientConnection.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.CreateClientConnection.ImageIndex = 3
|
||||
Me.CreateClientConnection.ImageList = Me.SmallerIcons
|
||||
Me.CreateClientConnection.Location = New System.Drawing.Point(239, 224)
|
||||
Me.CreateClientConnection.Name = "CreateClientConnection"
|
||||
Me.CreateClientConnection.Size = New System.Drawing.Size(183, 29)
|
||||
Me.CreateClientConnection.TabIndex = 6
|
||||
Me.CreateClientConnection.Text = "Create Client Connection..."
|
||||
Me.CreateClientConnection.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
|
||||
Me.CreateClientConnection.UseVisualStyleBackColor = False
|
||||
'
|
||||
'ToolsMenuStrip
|
||||
'
|
||||
Me.ToolsMenuStrip.AllowMerge = False
|
||||
Me.ToolsMenuStrip.AutoSize = False
|
||||
Me.ToolsMenuStrip.BackColor = System.Drawing.Color.Transparent
|
||||
Me.ToolsMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.ToolsToolStripMenuItem, Me.HelpToolStripMenuItem})
|
||||
Me.ToolsMenuStrip.Location = New System.Drawing.Point(0, 0)
|
||||
Me.ToolsMenuStrip.Name = "ToolsMenuStrip"
|
||||
Me.ToolsMenuStrip.ShowItemToolTips = True
|
||||
Me.ToolsMenuStrip.Size = New System.Drawing.Size(434, 24)
|
||||
Me.ToolsMenuStrip.TabIndex = 5
|
||||
'
|
||||
'FileToolStripMenuItem
|
||||
'
|
||||
Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewRemoteAppadvancedToolStripMenuItem, Me.ToolStripSeparator2, Me.ExitToolStripMenuItem})
|
||||
Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
|
||||
Me.FileToolStripMenuItem.Size = New System.Drawing.Size(37, 20)
|
||||
Me.FileToolStripMenuItem.Text = "File"
|
||||
'
|
||||
'ExitToolStripMenuItem
|
||||
'
|
||||
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
|
||||
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(92, 22)
|
||||
Me.ExitToolStripMenuItem.Text = "Exit"
|
||||
'
|
||||
'ToolsToolStripMenuItem
|
||||
'
|
||||
Me.ToolsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.HostOptionsToolStripMenuItem, Me.ToolStripSeparator3, Me.RemoveUnusedFileTypeAssociationsToolStripMenuItem})
|
||||
Me.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem"
|
||||
Me.ToolsToolStripMenuItem.Size = New System.Drawing.Size(94, 20)
|
||||
Me.ToolsToolStripMenuItem.Text = "&Tools"
|
||||
'
|
||||
'HostOptionsToolStripMenuItem
|
||||
'
|
||||
Me.HostOptionsToolStripMenuItem.Name = "HostOptionsToolStripMenuItem"
|
||||
Me.HostOptionsToolStripMenuItem.Size = New System.Drawing.Size(280, 22)
|
||||
Me.HostOptionsToolStripMenuItem.Text = "Host Options..."
|
||||
'
|
||||
'HelpToolStripMenuItem
|
||||
'
|
||||
Me.HelpToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WebsiteToolStripMenuItem, Me.ToolStripSeparator1, Me.AboutToolStripMenuItem})
|
||||
Me.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem"
|
||||
Me.HelpToolStripMenuItem.Size = New System.Drawing.Size(44, 20)
|
||||
Me.HelpToolStripMenuItem.Text = "Help"
|
||||
'
|
||||
'WebsiteToolStripMenuItem
|
||||
'
|
||||
Me.WebsiteToolStripMenuItem.Name = "WebsiteToolStripMenuItem"
|
||||
Me.WebsiteToolStripMenuItem.Size = New System.Drawing.Size(116, 22)
|
||||
Me.WebsiteToolStripMenuItem.Text = "Website"
|
||||
'
|
||||
'ToolStripSeparator1
|
||||
'
|
||||
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
|
||||
Me.ToolStripSeparator1.Size = New System.Drawing.Size(113, 6)
|
||||
'
|
||||
'AboutToolStripMenuItem
|
||||
'
|
||||
Me.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem"
|
||||
Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(116, 22)
|
||||
Me.AboutToolStripMenuItem.Text = "About..."
|
||||
'
|
||||
'PictureBox1
|
||||
'
|
||||
Me.PictureBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.PictureBox1.Location = New System.Drawing.Point(-1, 27)
|
||||
Me.PictureBox1.Name = "PictureBox1"
|
||||
Me.PictureBox1.Size = New System.Drawing.Size(435, 191)
|
||||
Me.PictureBox1.TabIndex = 7
|
||||
Me.PictureBox1.TabStop = False
|
||||
'
|
||||
'RemoveUnusedFileTypeAssociationsToolStripMenuItem
|
||||
'
|
||||
Me.RemoveUnusedFileTypeAssociationsToolStripMenuItem.Name = "RemoveUnusedFileTypeAssociationsToolStripMenuItem"
|
||||
Me.RemoveUnusedFileTypeAssociationsToolStripMenuItem.Size = New System.Drawing.Size(280, 22)
|
||||
Me.RemoveUnusedFileTypeAssociationsToolStripMenuItem.Text = "Remove unused file type associations..."
|
||||
'
|
||||
'NewRemoteAppadvancedToolStripMenuItem
|
||||
'
|
||||
Me.NewRemoteAppadvancedToolStripMenuItem.Name = "NewRemoteAppadvancedToolStripMenuItem"
|
||||
Me.NewRemoteAppadvancedToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
|
||||
Me.NewRemoteAppadvancedToolStripMenuItem.Text = "New RemoteApp (advanced)..."
|
||||
'
|
||||
'ToolStripSeparator2
|
||||
'
|
||||
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
|
||||
Me.ToolStripSeparator2.Size = New System.Drawing.Size(232, 6)
|
||||
'
|
||||
'ToolStripSeparator3
|
||||
'
|
||||
Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
|
||||
Me.ToolStripSeparator3.Size = New System.Drawing.Size(277, 6)
|
||||
'
|
||||
'RemoteAppMainWindow
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 15.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.White
|
||||
Me.ClientSize = New System.Drawing.Size(434, 261)
|
||||
Me.Controls.Add(Me.NoAppsLabel)
|
||||
Me.Controls.Add(Me.CreateClientConnection)
|
||||
Me.Controls.Add(Me.CreateButton)
|
||||
Me.Controls.Add(Me.DeleteButton)
|
||||
Me.Controls.Add(Me.EditButton)
|
||||
Me.Controls.Add(Me.ToolsMenuStrip)
|
||||
Me.Controls.Add(Me.AppList)
|
||||
Me.Controls.Add(Me.PictureBox1)
|
||||
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.MainMenuStrip = Me.ToolsMenuStrip
|
||||
Me.MinimumSize = New System.Drawing.Size(450, 300)
|
||||
Me.Name = "RemoteAppMainWindow"
|
||||
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show
|
||||
Me.Text = "RemoteApp Tool"
|
||||
Me.ToolsMenuStrip.ResumeLayout(False)
|
||||
Me.ToolsMenuStrip.PerformLayout()
|
||||
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
Friend WithEvents AppList As System.Windows.Forms.ListView
|
||||
Friend WithEvents ShortName As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents Title As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents Path As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents VPath As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents RequiredCommandLine As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents CommandLineSetting As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconPath As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents IconIndex As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents SecurityDescriptor As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents ShowInTSWA As System.Windows.Forms.ColumnHeader
|
||||
Friend WithEvents SmallIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents CreateButton As System.Windows.Forms.Button
|
||||
Friend WithEvents SmallerIcons As System.Windows.Forms.ImageList
|
||||
Friend WithEvents DeleteButton As System.Windows.Forms.Button
|
||||
Friend WithEvents EditButton As System.Windows.Forms.Button
|
||||
Friend WithEvents NoAppsLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents CreateClientConnection As System.Windows.Forms.Button
|
||||
Friend WithEvents ToolsMenuStrip As System.Windows.Forms.MenuStrip
|
||||
Friend WithEvents ToolsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents HostOptionsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents HelpToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents AboutToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents WebsiteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
|
||||
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents RemoveUnusedFileTypeAssociationsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents NewRemoteAppadvancedToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
|
||||
Friend WithEvents ToolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
|
||||
End Class
|
6555
remoteapp-tool/RemoteAppMainWindow.resx
Normal file
6555
remoteapp-tool/RemoteAppMainWindow.resx
Normal file
File diff suppressed because it is too large
Load Diff
167
remoteapp-tool/RemoteAppMainWindow.vb
Normal file
167
remoteapp-tool/RemoteAppMainWindow.vb
Normal file
@ -0,0 +1,167 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.ComponentModel
|
||||
Imports RemoteAppLib
|
||||
|
||||
Public Class RemoteAppMainWindow
|
||||
|
||||
Private Sub RemoteAppMainWindow_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||
If Not Me.WindowState = FormWindowState.Maximized Then
|
||||
My.Settings.MainWindowWidth = Me.Width
|
||||
My.Settings.MainWindowHeight = Me.Height
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RemoteAppMainWindow_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Dim sra As New SystemRemoteApps
|
||||
sra.Init()
|
||||
|
||||
Try
|
||||
TestIconLib()
|
||||
Catch ex As System.IO.FileNotFoundException
|
||||
MessageBox.Show("IconLib.dll is unavailable. Please add it to the RemoteApp Tool folder.")
|
||||
End
|
||||
End Try
|
||||
|
||||
Me.Text = My.Application.Info.Title & " " & My.Application.Info.Version.ToString & " (" & System.Net.Dns.GetHostName & ")"
|
||||
If Not My.Computer.Keyboard.ShiftKeyDown Then
|
||||
If Not My.Settings.MainWindowWidth < Me.MinimumSize.Width Then Me.Width = My.Settings.MainWindowWidth
|
||||
If Not My.Settings.MainWindowHeight < Me.MinimumSize.Height Then Me.Height = My.Settings.MainWindowHeight
|
||||
End If
|
||||
HelpSystem.SetupTips(Me)
|
||||
AddSysMenuItems()
|
||||
ReloadApps()
|
||||
End Sub
|
||||
|
||||
Public Sub ReloadApps()
|
||||
Me.AppList.Clear()
|
||||
|
||||
Dim SystemApps As New SystemRemoteApps
|
||||
Dim Apps As New RemoteAppCollection
|
||||
|
||||
Apps = SystemApps.GetAll
|
||||
|
||||
For Each App As RemoteApp In Apps
|
||||
SmallIcons.Images.RemoveByKey(App.Name)
|
||||
Dim TheBitmap = GetAppBitmap(App.Name)
|
||||
Dim AppItem As New ListViewItem(App.Name)
|
||||
AppItem.ToolTipText = App.FullName
|
||||
AppItem.ImageIndex = 0
|
||||
Me.SmallIcons.Images.Add(App.Name, TheBitmap)
|
||||
AppItem.ImageKey = App.Name
|
||||
AppList.Items.Add(AppItem)
|
||||
Next
|
||||
|
||||
If Apps.Count = 0 Then
|
||||
NoAppsLabel.Visible = True
|
||||
Else
|
||||
NoAppsLabel.Visible = False
|
||||
End If
|
||||
|
||||
EditButton.Enabled = False
|
||||
DeleteButton.Enabled = False
|
||||
CreateClientConnection.Enabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub AppList_DoubleClick(sender As Object, e As EventArgs) Handles AppList.DoubleClick
|
||||
If Me.AppList.SelectedItems.Count = 1 Then
|
||||
EditRemoteApp(Me.AppList.SelectedItems(0).Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AppList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles AppList.SelectedIndexChanged
|
||||
If AppList.SelectedItems.Count = 1 Then
|
||||
Me.EditButton.Enabled = True
|
||||
Me.DeleteButton.Enabled = True
|
||||
CreateClientConnection.Enabled = True
|
||||
Else
|
||||
Me.EditButton.Enabled = False
|
||||
Me.DeleteButton.Enabled = False
|
||||
Me.CreateClientConnection.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EditButton_Click(sender As Object, e As EventArgs) Handles EditButton.Click
|
||||
If Me.AppList.SelectedItems.Count = 1 Then
|
||||
EditRemoteApp(Me.AppList.SelectedItems(0).Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub EditRemoteApp(AppName As String)
|
||||
Dim sra As New SystemRemoteApps
|
||||
RemoteAppEditWindow.EditRemoteApp(sra.GetApp(AppName))
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteButton_Click(sender As Object, e As EventArgs) Handles DeleteButton.Click
|
||||
DeleteRemoteApp(AppList.SelectedItems(0).Text)
|
||||
ReloadApps()
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteRemoteApp(ByVal AppName As String)
|
||||
If MessageBox.Show("Are you sure you want to remove " & AppName & "?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
|
||||
Dim sra As New SystemRemoteApps
|
||||
sra.DeleteApp(AppName)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateButton_Click(sender As Object, e As EventArgs) Handles CreateButton.Click
|
||||
RemoteAppEditWindow.CreateRemoteApp()
|
||||
ReloadApps()
|
||||
End Sub
|
||||
|
||||
'System Menu Code (for about box)
|
||||
Private Declare Function AppendMenu Lib "user32.dll" Alias "AppendMenuA" (ByVal hMenu As IntPtr, ByVal uFlags As Int32, ByVal uIDNewItem As IntPtr, ByVal lpNewItem As String) As Boolean
|
||||
Private Declare Function GetSystemMenu Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
|
||||
Private Const MF_STRING As Integer = &H0
|
||||
Private Const MF_SEPARATOR As Integer = &H800
|
||||
Private Const WM_SYSCOMMAND = &H112
|
||||
|
||||
Private Sub AddSysMenuItems()
|
||||
'Get the System Menus Handle.
|
||||
Dim hSysMenu As IntPtr = GetSystemMenu(Me.Handle, False)
|
||||
'Add a standard Separator Item.
|
||||
AppendMenu(hSysMenu, MF_SEPARATOR, 1000, Nothing)
|
||||
'Add an About Menu Item.
|
||||
AppendMenu(hSysMenu, MF_STRING, 1001, "About...")
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
|
||||
MyBase.WndProc(m)
|
||||
If (m.Msg = WM_SYSCOMMAND) Then
|
||||
Select Case m.WParam.ToInt32
|
||||
Case 1001
|
||||
RemoteAppAboutWindow.ShowDialog()
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateClientConnection_Click(sender As Object, e As EventArgs) Handles CreateClientConnection.Click
|
||||
Dim sra As New SystemRemoteApps
|
||||
RemoteAppCreateClientConnection.CreateClientConnection(sra.GetApp(Me.AppList.SelectedItems(0).Text))
|
||||
End Sub
|
||||
|
||||
Private Sub HostOptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HostOptionsToolStripMenuItem.Click
|
||||
RemoteAppHostOptions.SetValues()
|
||||
RemoteAppHostOptions.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click
|
||||
RemoteAppAboutWindow.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
|
||||
End
|
||||
End Sub
|
||||
|
||||
Private Sub WebsiteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles WebsiteToolStripMenuItem.Click
|
||||
System.Diagnostics.Process.Start("http://www.kimknight.net/remoteapptool")
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveUnusedFileTypeAssociationsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RemoveUnusedFileTypeAssociationsToolStripMenuItem.Click
|
||||
LocalFtaModule.RemoveUnusedFTAs()
|
||||
End Sub
|
||||
|
||||
Private Sub NewRemoteAppadvancedToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewRemoteAppadvancedToolStripMenuItem.Click
|
||||
RemoteAppEditWindow.CreateRemoteApp(True)
|
||||
ReloadApps()
|
||||
End Sub
|
||||
End Class
|
BIN
remoteapp-tool/add-window.ico
Normal file
BIN
remoteapp-tool/add-window.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 364 KiB |
52
remoteapp-tool/app.manifest
Normal file
52
remoteapp-tool/app.manifest
Normal file
@ -0,0 +1,52 @@
|
||||
<?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 Manifest Options
|
||||
If you want to change the Windows User Account Control level replace the
|
||||
requestedExecutionLevel node with one of the following.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
||||
If you want to utilize File and Registry Virtualization for backward
|
||||
compatibility then delete the requestedExecutionLevel node.
|
||||
-->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
<applicationRequestMinimum>
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
|
||||
</applicationRequestMinimum>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- A list of all Windows versions that this application is designed to work with.
|
||||
Windows will automatically select the most compatible environment.-->
|
||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
||||
</application>
|
||||
</compatibility>
|
||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||
<!-- <dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
</asmv1:assembly>
|
2
remoteapplib/.gitignore
vendored
Normal file
2
remoteapplib/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bin/
|
||||
obj/
|
6
remoteapplib/App.config
Normal file
6
remoteapplib/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
|
||||
</startup>
|
||||
</configuration>
|
34
remoteapplib/My Project/AssemblyInfo.vb
Normal file
34
remoteapplib/My Project/AssemblyInfo.vb
Normal file
@ -0,0 +1,34 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("936d6a70-fabd-4205-a2bb-4232560e468a")>
|
||||
|
||||
' 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.0.1")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.1")>
|
183
remoteapplib/RemoteAppLib.vb
Normal file
183
remoteapplib/RemoteAppLib.vb
Normal file
@ -0,0 +1,183 @@
|
||||
Imports System.Reflection.Assembly
|
||||
|
||||
Public Class RemoteAppCollection
|
||||
Inherits System.Collections.CollectionBase
|
||||
|
||||
Public Sub Add(RemoteApp As RemoteApp)
|
||||
List.Add(RemoteApp)
|
||||
End Sub
|
||||
|
||||
Public Sub Remove(RemoteApp As RemoteApp)
|
||||
List.Remove(RemoteApp)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class RemoteApp
|
||||
|
||||
Public Name As String
|
||||
Public FullName As String
|
||||
Public Path As String
|
||||
Public VPath As String
|
||||
Public IconPath As String
|
||||
Public IconIndex As Integer = 0
|
||||
Public CommandLine As String = ""
|
||||
Public CommandLineOption As Integer = 1
|
||||
Public TSWA As Boolean = False
|
||||
Public FileTypeAssociations As FileTypeAssociationCollection
|
||||
|
||||
End Class
|
||||
|
||||
Public Class FileTypeAssociation
|
||||
Public Extension As String
|
||||
Public IconPath As String
|
||||
Public IconIndex As String
|
||||
End Class
|
||||
|
||||
Public Class FileTypeAssociationCollection
|
||||
Inherits System.Collections.CollectionBase
|
||||
|
||||
Public Sub Add(FileTypeAssociation As FileTypeAssociation)
|
||||
List.Add(FileTypeAssociation)
|
||||
End Sub
|
||||
|
||||
Public Sub Remove(FileTypeAssociation As FileTypeAssociation)
|
||||
List.Remove(FileTypeAssociation)
|
||||
End Sub
|
||||
|
||||
Public Function GetFlatFileTypes() As String
|
||||
GetFlatFileTypes = ""
|
||||
If List.Count > 0 Then
|
||||
For Each listItem As FileTypeAssociation In List
|
||||
GetFlatFileTypes += ",." & listItem.Extension
|
||||
Next
|
||||
GetFlatFileTypes = GetFlatFileTypes.Substring(1)
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Public Class IconSelection
|
||||
Public IconPath As String
|
||||
Public IconIndex As String
|
||||
End Class
|
||||
|
||||
|
||||
Public Class SystemRemoteApps
|
||||
Private Legacy32bit As Boolean = False
|
||||
Private RegistryPath As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications"
|
||||
Private BaseKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(RegistryPath)
|
||||
Private BaseKeyWrite As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(RegistryPath, True)
|
||||
|
||||
Public Sub Init()
|
||||
Dim RegistryPathCV As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
|
||||
Dim cvKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(RegistryPathCV, True)
|
||||
Dim tsKey As Microsoft.Win32.RegistryKey = cvKey.CreateSubKey("Terminal Server")
|
||||
Dim tsaaKey As Microsoft.Win32.RegistryKey = tsKey.CreateSubKey("TSAppAllowList")
|
||||
Dim appKey As Microsoft.Win32.RegistryKey = tsaaKey.CreateSubKey("Applications")
|
||||
End Sub
|
||||
|
||||
Public Function GetAll() As RemoteAppCollection
|
||||
|
||||
Dim SystemAppCollection As New RemoteAppCollection
|
||||
|
||||
For Each App As String In BaseKey.GetSubKeyNames
|
||||
Dim RemoteApp As New RemoteApp
|
||||
RemoteApp = GetApp(App)
|
||||
SystemAppCollection.Add(RemoteApp)
|
||||
Next
|
||||
|
||||
BaseKey.Close()
|
||||
|
||||
Return SystemAppCollection
|
||||
|
||||
End Function
|
||||
|
||||
Function GetApp(Name As String) As RemoteApp
|
||||
Dim App As New RemoteApp
|
||||
|
||||
Dim AppKey As Microsoft.Win32.RegistryKey = BaseKey.OpenSubKey(Name)
|
||||
|
||||
App.Name = Name
|
||||
App.FullName = AppKey.GetValue("Name", "")
|
||||
App.Path = AppKey.GetValue("Path", "")
|
||||
App.VPath = AppKey.GetValue("VPath", "")
|
||||
App.CommandLine = AppKey.GetValue("RequiredCommandLine", "")
|
||||
App.CommandLineOption = AppKey.GetValue("CommandLineSetting", "1")
|
||||
App.IconPath = AppKey.GetValue("IconPath", "")
|
||||
App.IconIndex = AppKey.GetValue("IconIndex", 0)
|
||||
App.TSWA = AppKey.GetValue("ShowInTSWA", 0)
|
||||
|
||||
Dim FTAKey As Microsoft.Win32.RegistryKey = AppKey.OpenSubKey("Filetypes")
|
||||
If Not FTAKey Is Nothing Then
|
||||
Dim FTACol As New FileTypeAssociationCollection
|
||||
|
||||
For Each FTAValueName As String In FTAKey.GetValueNames
|
||||
Dim FTA As New FileTypeAssociation
|
||||
Dim FTAValue = FTAKey.GetValue(FTAValueName).ToString.Split(",")
|
||||
FTA.Extension = FTAValueName
|
||||
FTA.IconPath = FTAValue(0)
|
||||
FTA.IconIndex = Val(FTAValue(1))
|
||||
|
||||
FTACol.Add(FTA)
|
||||
|
||||
Next
|
||||
|
||||
App.FileTypeAssociations = FTACol
|
||||
End If
|
||||
|
||||
Return App
|
||||
|
||||
End Function
|
||||
|
||||
Public Sub SaveApp(RemoteApp As RemoteApp)
|
||||
BaseKeyWrite.CreateSubKey(RemoteApp.Name)
|
||||
|
||||
Dim AppKey As Microsoft.Win32.RegistryKey = BaseKey.OpenSubKey(RemoteApp.Name, True)
|
||||
|
||||
AppKey.SetValue("Name", RemoteApp.FullName, Microsoft.Win32.RegistryValueKind.String)
|
||||
|
||||
AppKey.SetValue("Path", RemoteApp.Path, Microsoft.Win32.RegistryValueKind.String)
|
||||
AppKey.SetValue("VPath", RemoteApp.VPath, Microsoft.Win32.RegistryValueKind.String)
|
||||
AppKey.SetValue("RequiredCommandLine", RemoteApp.CommandLine, Microsoft.Win32.RegistryValueKind.String)
|
||||
AppKey.SetValue("CommandLineSetting", RemoteApp.CommandLineOption, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
AppKey.SetValue("IconPath", RemoteApp.IconPath, Microsoft.Win32.RegistryValueKind.String)
|
||||
AppKey.SetValue("IconIndex", RemoteApp.IconIndex, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
AppKey.SetValue("ShowInTSWA", RemoteApp.TSWA, Microsoft.Win32.RegistryValueKind.DWord)
|
||||
|
||||
If Not RemoteApp.FileTypeAssociations Is Nothing Then
|
||||
If Not AppKey.OpenSubKey("Filetypes") Is Nothing Then AppKey.DeleteSubKeyTree("Filetypes")
|
||||
AppKey.CreateSubKey("Filetypes")
|
||||
Dim FTAKey = AppKey.OpenSubKey("Filetypes", True)
|
||||
For Each fta As FileTypeAssociation In RemoteApp.FileTypeAssociations
|
||||
FTAKey.SetValue(fta.Extension, fta.IconPath & "," & fta.IconIndex.ToString, Microsoft.Win32.RegistryValueKind.String)
|
||||
Next
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub RenameApp(RemoteAppOldName As String, RemoteAppNewName As String)
|
||||
Dim App As New RemoteApp
|
||||
Dim SystemApps As New SystemRemoteApps
|
||||
|
||||
App = SystemApps.GetApp(RemoteAppOldName)
|
||||
DeleteApp(RemoteAppOldName)
|
||||
App.Name = RemoteAppNewName
|
||||
SaveApp(App)
|
||||
End Sub
|
||||
|
||||
Public Sub DeleteApp(Name As String)
|
||||
BaseKeyWrite.DeleteSubKeyTree(Name)
|
||||
End Sub
|
||||
|
||||
Public Property WoW6432Node As Boolean
|
||||
Get
|
||||
Return Legacy32bit
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
Legacy32bit = value
|
||||
Dim PathStart As String = "SOFTWARE"
|
||||
If Legacy32bit = True Then PathStart = "SOFTWARE\Wow6432Node"
|
||||
RegistryPath = PathStart & "\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
80
remoteapplib/RemoteAppLib.vbproj
Normal file
80
remoteapplib/RemoteAppLib.vbproj
Normal file
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.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>{785B6808-B2FE-4C18-9D63-6DAB46482374}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>RemoteAppLib</RootNamespace>
|
||||
<AssemblyName>RemoteAppLib</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Empty</MyType>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<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>
|
||||
</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</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>
|
||||
</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="RemoteAppLib.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</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>
|
Loading…
Reference in New Issue
Block a user