I know there are a lot of similar questions, but they seem to be about AppData. However, my path is 'C:\Program Files (x86)\Project\My Product Name\Database\Project.exe'. I get an error message when trying to delete this saying System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\Project\My Product Name\Database\Project.exe' is denied.
Is this because you have to have Admin Privileges for changing things in Program Files? If so, could I create it so it installs it into Libraries/Documents or something? Extra info if needed -
I am using Install Shield and Visual Studio 2013.
Update-----------------------------------------------------
The way I am trying to delete it/replace the file is:
I have "Main Form" and "Updater Form". And what happens is, MainForm opens UpdaterForm and then closes itself. Like so...
Private Sub UpdateBtn_Click(sender As Object, e As EventArgs) Handles UpdateBtn.Click
Updater.Show()
Me.Close()
End Sub
Then in the UpdaterForm this happens...
Private Sub UpdateBtn_Click(sender As Object, e As EventArgs) Handles UpdateBtn.Click
Main_Menu.Close()
Dim Web As New WebClient
My.Computer.FileSystem.DeleteFile(Application.StartupPath & "/Project.exe")
My.Computer.Network.DownloadFile("MYLINK", Application.StartupPath & "/Project.exe")
End Sub
However on My.Computer.FileSystem.DeleteFile(Application.StartupPath & "/Project.exe")
it says I do not have the permission to edit the file path. I think it is is just the case of moving it somewhere else or making it so UpdaterForm has permissions.
Also, what I was wondering is would it be better for the UpdaterForm to be a different .exe? Or could I just keep it the same?
If you know a lot about Install Shield, could I just use an Upgrade Path, and select to old .msi file? But I am not to sure about how it goes about updating etc. If you know more about it could you please explain?