March 13, 201511 yr HI,I try for hours to find a way to run taskkill in an .inf file before CopyFiles i tried so many different thinks but none have worked. Edited March 13, 201511 yr by Outbreaker
March 13, 201511 yr Author Here is the best i could come up with (Trimmed down). The "wuauclt.exe" process needs to be terminated so that the "DataStor.edb" file can be overwritten.But this does not works because the CopyFiles is executed before the UnregisterDlls so i'm trying to find a way around this problem.[Version] signature="$Windows NT$" ClassGUID={00000000-0000-0000-0000-000000000000} SetupClass=Base LayoutFile=layout.inf DriverVer=07/01/2001,5.1.2600.5512[Optional Components] MicrosoftUpdate[MicrosoftUpdate] UnregisterDlls = Stop.MicrosoftUpdate CopyFiles = DataStore.Files[Stop.MicrosoftUpdate] 11,,taskkill.exe,,,"/IM ""wuauclt.exe"" /F"[DestinationDirs] DataStore.Files = 10, "SoftwareDistribution\DataStore" DataStore.Files] DataStore.edb, DataStor.edb, ,4 Edited March 13, 201511 yr by Outbreaker
March 14, 201511 yr Try stopping the Windows Update service. Commands likenet stop wuauservand to startnet start wuauservOr you could use sc.exe. Use sc /? at a cmd prompt for more information of use. This page below shows some commands used in a cmd script. Perhaps more then you need. You can convert to inf format.http://wuauclt.info/scripts.asp
March 14, 201511 yr Author True "net stop wuauserv" would be a more cleaner way to do this then "taskkill.exe /IM "wuauclt.exe" /F".But still have to find out how to execute this in a inf file before CopyFiles.
March 14, 201511 yr I have little knowledge with inf files though something like[Stop.MicrosoftUpdate]11,,sc.exe,,,"stop wuauserv"[Start.MicrosoftUpdate]11,,sc.exe,,,"start wuauserv"may do?
March 14, 201511 yr Author The thing is that the "DataStore.edb" file is used by the "wuauserv" service so it needs to be stoped before i can overwrite the "DataStore.edb" file.But no matter what i try the .inf file is always executing the CopyFiles ("DataStore.edb") before the UnregisterDlls (SC stop "wuauserv"). So i try to find a workaround for the .inf file to first execute a command before a copy process. Edited March 14, 201511 yr by Outbreaker
March 14, 201511 yr How are you calling your INF, Outbreaker? I found an interesting, if hard to follow, reference years ago. Look into RunPreSetupCommands. In order to use it, you must call your INF using AdvPack. For a usage example, tear apart an installer I built five years ago. Pull out the INF with 7-zip, or another file decompression tool.
March 14, 201511 yr Author I'm using "ocgen.dll" not sure if i could use "advpack.dll" for an UpdatePack without messing things up. This .inf part is being run from the "Add/Remove Windows Components". Edited March 14, 201511 yr by Outbreaker
March 14, 201511 yr I'm not familiar with making things work through the components wizard. A hybrid method may still work, but I don't know how. OnePiece should know. Edited March 14, 201511 yr by 5eraph
March 14, 201511 yr Author After looking into this a little more i think this will not work because the "Add/Remove Windows Components" is using "ocgen.dll" to execute the .inf files.Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OptionalComponents\MU]"INF"="WINXPUP.inf""Section"="MicrosoftUpdate""Installed"="1" Edited March 14, 201511 yr by Outbreaker
April 6, 201511 yr Hi all, all UpdatePack\AddOn use the SetupApi, because in Window setup ocgen.dll use (depends on) SetupApi, but also import the RunSetupCommand from AdvPack, so to give support to diretives as RunPreSetupCommands & RunPostSetupCommands and some other special directives, which only the AdvcPack supports (named as advanced INF options, SmartReboot for example), as already said import only some Not All, for example the directive of advpack such as Un\RegisterOCXs is not supported so SetupApi mod[Version] signature="$Windows NT$"[DefaultInstall] UnregisterDlls = Kill.Process CopyFiles = Copy.Files[Kill.Process] 11,,taskkill.exe,,,"/IM ""Name.exe"" /F";; Copy.Files etc etc[Copy.Files]advpack mod (rundll32.exe advpack.dll,LaunchINFSection %Path%\FileName.inf)[Version] signature="$Windows NT$"[DefaultInstall] RunPreSetupCommands = Kill_Process:1 CopyFiles = Copy.Files[Kill_Process] %11%\taskkill.exe /IM """Name.exe""" /F;; Copy.Files etc etc[Copy.Files]as already mentioned above ocgen supports both Un\RegisterDlls && Run(Pre\Post)SetupCommands Ciao. Edited April 6, 201511 yr by DXRW4E
Create an account or sign in to comment