それを行う間接的な方法を見つけました-cmdを介して。それは最善の方法ではありませんが、うまくいくかもしれません。
次のテキストをリソースに name.cmd として記述できます。
'sets the name of your app to display
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /v "DisplayName" /d "Yourapp" /f
'sets your app version to display
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "DisplayVersion" /D "1.0.0.0"
'sets your app icon to display location
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "DisplayIcon" /D "%PROGRAMFILES%\Yourapp\yourapp.ico"
'sets your name to display as publisher
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "Publisher" /D "Yourname"
'sets the uninstall path
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "UninstallString" /D "%PROGRAMFILES%\Yourapp\UNINSTALL.exe"
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "UninstallPath" /D "%PROGRAMFILES%\Yourapp\UNINSTALL.exe"
' sets the install directory
REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Yourapp" /V "InstallLocation" /D "%PROGRAMFILES%\Yourapp\"
次に、プログラムで cmd で開きます。
Dim procInfo As New ProcessStartInfo()
procInfo.UseShellExecute = True
'writes the file name.cmd to appdata
IO.File.WriteAllText(My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData + "/name.cmd", My.Resources.name)
'sets the path of the file to be opened to name.cmd
procInfo.FileName = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData + "/name.cmd"
procInfo.WorkingDirectory = ""
procInfo.Verb = "runas"
'running the file in cmd
Process.Start(procInfo)