[solved] Updates wont Configure on 64bit Windows 7 and Vista

[solved] Updates wont Configure on 64bit Windows 7 and Vista

Postby sherndo » 09.04.2013, 22:04

I have written a vb program to perform some actions and then call the WSUS Office and Windows updater silently through calling the DoUpdate.cmd file. The program seems to be working fine; however, when i shut the computer down the updates are never configured. When i restart the computer and run the updates again it then reinstalls the same updates. The odd thing is when i call the UpdateInstaller.EXE and run it through the GUI, the updates install correctly and windows configures them on shutdown. Also, this issue only occurs when i run the program on 64 bit windows 7 and vista. The 32 bit OS will run the program seemlessly. Any suggestions or reasons to why this is occuring would be fantastic. The vb code I am running is posted below.

Code: Select all
Dim myProcess as New System.Diagnostics.Process
myProcess.StartInfo.FileName = ProcessPath
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = False
myProcess.StartInfo.Arguments = myArgs
myProcess.Start()


I have also made sure to always use the "Run as Administrator" option when beginning my program. Also, I have tried starting the process as an administrator the vb way by setting the verb to "runas".
Last edited by harry on 30.04.2013, 12:44, edited 1 time in total.
Reason: marked as solved
sherndo
 

Re: Updates wont Configure on 64 bit Windows 7 and Vista

Postby aker » 10.04.2013, 06:04

Use the C:\Windows\system32\cmd.exe as program path and as Arguments:
Code: Select all
"/k " & Chr(34) & "<path_to_cmd_folder>\DoUpdate.cmd" & chr(34) & " <your_parameters>"

And set myprocess.startinfo.verb = "runas", then it will be ran as admin automatically.
Wer Rechtschreibfehler findet, darf sie behalten oder an den Meistbietenden versteigern. / Everybody finding a misspelling is allowed to keep or sell it.
aker

WSUS Offline Update „Community Edition“
https://gitlab.com/wsusoffline/wsusoffline/-/releases
aker
 
Posts: 3999
Joined: 02.03.2011, 15:32

Re: Updates wont Configure on 64 bit Windows 7 and Vista

Postby sherndo » 10.04.2013, 14:46

I just tried running it that way (and tested it it on a couple different computers), and unfortunately it did not fix the issue.
sherndo
 

Re: Updates wont Configure on 64 bit Windows 7 and Vista

Postby WSUSUpdateAdmin » 15.04.2013, 09:38

Hi!

Could be the "FsRedirection" problem, maybe.

Pls. see UpdateInstaller.au3 (line 1200++):
Code: Select all
      If (@OSArch <> "X86") Then
        DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
      EndIf

Regards
Torsten Wittrock
WSUSUpdateAdmin
Administrator
 
Posts: 2245
Joined: 07.07.2009, 14:38

Re: Updates wont Configure on 64 bit Windows 7 and Vista

Postby sherndo » 17.04.2013, 13:52

Okay, I have tried to implement that into my own VB code, since that code is run as part of the UpdateInstaller.exe correct? Im not totally sure if im doing it correctly because I have not done much work with DLL's, but here is how I have implemented it.

Code: Select all
<Runtime.InteropServices.DllImport("kernel32.dll", EntryPoint:="Wow64DisableWow64FsRedirection")> _
Public Shared Function DisableWow64Redirection(ByRef handle as Integer) as Boolean
End Function

Dim handle as Integer = 1
DisableWow64Redirection(handle)


When I was running it like this, it still did not fix the issue.
sherndo
 

[SOLVED] Updates wont Configure on 64 bit Windows 7 and Vist

Postby sherndo » 30.04.2013, 12:39

The issue has now been solved. Essientially the issue was with the FsRedirection problem; however, instead of it redirecting the files it was opening all processes as 32 bit processes. When my VB program would call the DoUpdate.cmd, the cmd would be opened as a 32 bit process, which then confused the rest of the update installations. I had to go into the Visual Studio editor and recompile my program as a 64 bit program. Once my program was compiled as a 64 bit program, all child processes created were also 64 bit. Thanks for the help with the issue.
sherndo
 


Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 245 guests

cron