Patching without write access to TEMP

Patching without write access to TEMP

Postby rmorrow815 » 23.12.2019, 20:49

Hello everyone. New person on the forum but long time user. I ran into an issue where I was unable to install OS patches because the temp directory was limited to read only permissions. I was able to set temp to the wsus directory using the following code in WSUSOS_DIR\cmd\custom\InitializationHook.cmd

Code: Select all
cd "%~dp0"
rmorrow815
 
Posts: 3
Joined: 23.12.2019, 19:28

Patching without access to TEMP

Postby rmorrow815 » 23.12.2019, 21:04

Hello Everyone, New user on forum longtime user. I have been running into issue installing patches using WSUS offline. I found the following code which I am using in wsusou_dir\cmd\custom\InitializationHook.cmd

https://forums.wsusoffline.net/viewtopic.php?f=2&t=6876

Code: Select all
cd "%~dp0..\.."
set WSUSOU_DIR=%cd%
cd "%~dp0"
if not exist "%WSUSOU_DIR%\tmp" (
     exit /b 1
)
set TEMP=%WSUSOU_DIR%\tmp


The problem was that DISM was still trying to write to temp. I was able to make the following change to /ScratchDir wsusou_dir\cmd\InstallOSUpdate.cmd on lines 187 and 189

Code: Select all
if exist %systemRoot%\Sysnative\Dism.exe (
   %systemRoot%\Sysnative\Dism.exe /Online %DISM_QPARAM% /NoRestart /Add-Package /PackagePath:%1 /IgnoreCheck /ScratchDir:%TEMP%
)  else (
   %systemRoot%\System32\Dism.exe /Online %DISM_QPARAM% /NoRestart /Add-Package /PackagePath:%1 /IgnoreCheck /ScratchDir:%TEMP%
)


The question I had was how could this change get put into the main wsusoffline download.

Thanks
rmorrow815
 
Posts: 3
Joined: 23.12.2019, 19:28

Re: Patching without write access to TEMP

Postby Dalai » 23.12.2019, 22:11

Well, I'm not sure if that's the only change necessary. Other programs/commands used by WSUS Offline could also refer to the original %TEMP% directory instead of the changed one.

But, to answer your question: If the author sees your suggestion as valid and good, it will be added to the trunk (which will end up as WSUS Offline main package eventually).

Regards
Dalai
Dalai
 
Posts: 1041
Joined: 12.07.2016, 21:00

Re: Patching without write access to TEMP

Postby aker » 23.12.2019, 23:06

rmorrow815 wrote:I found the following code which I am using in wsusou_dir\cmd\custom\InitializationHook.cmd

https://forums.wsusoffline.net/viewtopic.php?f=2&t=6876

Code: Select all
cd "%~dp0..\.."
set WSUSOU_DIR=%cd%
cd "%~dp0"
if not exist "%WSUSOU_DIR%\tmp" (
     exit /b 1
)
set TEMP=%WSUSOU_DIR%\tmp



The script you use was created for Download only. It must NOT be used for the installation as I cannot tell you for sure, that it's working.
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: Patching without write access to TEMP

Postby rmorrow815 » 24.12.2019, 02:27

Hmm I did change both together but when I added the scratch space switch it would start to install. I'll test it some more without the code you created to see if I get a positive result. Any suggestions on getting installs to work with directing temp directory to a possible different directory.
Last edited by Gerby on 01.01.2020, 23:45, edited 1 time in total.
Reason: Removed full quote of preceding post.
rmorrow815
 
Posts: 3
Joined: 23.12.2019, 19:28

Re: Patching without write access to TEMP

Postby WSUSUpdateAdmin » 02.03.2020, 23:30

Hi.

--------------------------------
/ScratchDir:<Pfad zum Verzeichnis>

Gibt ein temporäres Verzeichnis für die Extrahierung zu wartender
Dateien an. Das Verzeichnis muss vorhanden sein.

Ohne Angabe wird das temporäre Verzeichnis verwendet.
--------------------------------

Doesn't make sense then to specify "/ScratchDir:%TEMP%", does it?

RTW
WSUSUpdateAdmin
Administrator
 
Posts: 2245
Joined: 07.07.2009, 14:38


Return to Installation / Updating

Who is online

Users browsing this forum: No registered users and 26 guests