Page 1 of 1

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

PostPosted: 09.04.2013, 22:04
by sherndo
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".

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

PostPosted: 10.04.2013, 06:04
by aker
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.

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

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

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

PostPosted: 15.04.2013, 09:38
by WSUSUpdateAdmin
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

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

PostPosted: 17.04.2013, 13:52
by sherndo
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.

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

PostPosted: 30.04.2013, 12:39
by sherndo
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.