使用vb.net使用产品密钥以静默方式安装norton [英] Install norton silently with product key using vb.net
本文介绍了使用vb.net使用产品密钥以静默方式安装norton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望尽可能使用产品密钥以静默方式安装Norton 360。我希望用户将他们的产品密钥输入到文本框中。这是我到目前为止的代码。它安装在诺顿,但产品密钥不起作用。
I'm looking to install Norton 360 silently with a product key if possible. I want the user to input their product key into a textbox. Here's the code I've got so far. It installs norton, but the product key doesn't work.
Dim InstallProcess As New Process()
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If IsNortonInstalled() Then
Button1.Enabled = False
Button1.Text = "Norton Antivirus is already installed"
Else
Button1.Enabled = False
Button1.Text = "Installing Norton Antivirus..."
TextBox1.Enabled = False
Dim ProductKey As String = TextBox1.Text
ProductKey.Replace("-", String.Empty)
Dim RegKeyFile As String = My.Resources.NortonRegistryKey
RegKeyFile.Replace("\\KEY//", ProductKey)
My.Computer.FileSystem.WriteAllText(Application.StartupPath & "\nortini.reg", RegKeyFile, False)
Process.Start("regedit", "/s " & Application.StartupPath & "\nortini.reg")
InstallProcess.StartInfo.FileName = Application.StartupPath & "\NortIni.exe"
InstallProcess.StartInfo.WorkingDirectory = Application.StartupPath
InstallProcess.Start()
InstallProcess.WaitForExit()
If IsNortonInstalled() = True Then
Button1.Text = "Norton Antivirus installed"
Else
Button1.Text = "Norton Antivirus installation failed"
End If
End If
End Sub
Private Function IsNortonInstalled() As Boolean
If My.Computer.FileSystem.DirectoryExists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & "\Norton 360\") = True Or My.Computer.FileSystem.DirectoryExists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) & "\Norton 360\") = True Then
Return True
Else
Return False
End If
End Function
这是我正在使用的注册表文件:
Here's the registry file that I'm using:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\CCPD-LC\KStore000008200046000b5]
"Key"="\\KEY//"
推荐答案
这是赛门铁克的一个问题,而不是我们。我们不知道他们的安装程序是否支持这个。只有赛门铁克的支持才会知道。
This is a question for Symantec, not us. We have no idea if their installer supports this or not. Only Symantec's support would know.
这篇关于使用vb.net使用产品密钥以静默方式安装norton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文