mirror of
https://github.com/kimmknight/remoteapptool.git
synced 2024-11-24 06:27:22 +00:00
Merge pull request #31 from kimmknight/issue29
Added function to look for rdpsign.exe in multiple locations.
This commit is contained in:
commit
2c89dd8b1b
@ -120,8 +120,13 @@ Public Class RDPSign
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'If we get here, we should be good to run the command to sign the RDP file.
|
'If we get here, we should be good to run the command to sign the RDP file.
|
||||||
Dim Command As String = GetSysDir() & "\rdpsign.exe"
|
|
||||||
|
'Grab the rdpsign.exe location and then verify that it exists
|
||||||
|
|
||||||
|
Dim Command = GetRdpsignExeLocation()
|
||||||
|
|
||||||
If My.Computer.FileSystem.FileExists(Command) Then
|
If My.Computer.FileSystem.FileExists(Command) Then
|
||||||
|
|
||||||
Dim Arguments As String
|
Dim Arguments As String
|
||||||
Dim FileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(Command)
|
Dim FileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(Command)
|
||||||
' On my windows 10 computer, the argument is /sha256 instead of /sha1. /sha1 doesn't work.
|
' On my windows 10 computer, the argument is /sha256 instead of /sha1. /sha1 doesn't work.
|
||||||
@ -147,6 +152,31 @@ Public Class RDPSign
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Find the full path to rdpsign.exe from a list of possible locations
|
||||||
|
''' </summary>
|
||||||
|
''' <returns>A path to rdpsign.exe or an empty string</returns>
|
||||||
|
Function GetRdpsignExeLocation()
|
||||||
|
'Each path to check for rdpsign.exe is added to this array.
|
||||||
|
'If it is found in more than one location, the lowest in the list will be selected.
|
||||||
|
Dim PossibleRdpsignPaths() As String = {
|
||||||
|
GetSysDir(),
|
||||||
|
My.Application.Info.DirectoryPath
|
||||||
|
}
|
||||||
|
|
||||||
|
Dim FinalRdpSignPath As String = ""
|
||||||
|
|
||||||
|
For Each RdpsignPath In PossibleRdpsignPaths
|
||||||
|
If My.Computer.FileSystem.FileExists(RdpsignPath & "\rdpsign.exe") Then
|
||||||
|
FinalRdpSignPath = RdpsignPath & "\rdpsign.exe"
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Return FinalRdpSignPath
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
|
Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
|
||||||
|
|
||||||
Function GetSysDir() As String
|
Function GetSysDir() As String
|
||||||
|
@ -34,7 +34,7 @@ Public Class RemoteAppCreateClientConnection
|
|||||||
MSIRadioButton.Text = "MSI installer (requires WiX Toolset)"
|
MSIRadioButton.Text = "MSI installer (requires WiX Toolset)"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not My.Computer.FileSystem.FileExists(GetSysDir() & "\rdpsign.exe") Then
|
If Not My.Computer.FileSystem.FileExists(rdpSign.GetRdpsignExeLocation) Then
|
||||||
GroupBoxSignRDP.Enabled = False
|
GroupBoxSignRDP.Enabled = False
|
||||||
GroupBoxSignRDP.Text += " (requires rdpsign.exe)"
|
GroupBoxSignRDP.Text += " (requires rdpsign.exe)"
|
||||||
GroupBoxSignRDP.Tag = "noexe"
|
GroupBoxSignRDP.Tag = "noexe"
|
||||||
|
Loading…
Reference in New Issue
Block a user