Outbreaker Posted March 13, 2015 Share Posted March 13, 2015 (edited) 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, 2015 by Outbreaker Link to comment Share on other sites More sharing options...
Tripredacus Posted March 13, 2015 Share Posted March 13, 2015 You should post some of the things you have tried. Link to comment Share on other sites More sharing options...
Outbreaker Posted March 13, 2015 Author Share Posted March 13, 2015 (edited) 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, 2015 by Outbreaker Link to comment Share on other sites More sharing options...
MHz Posted March 14, 2015 Share Posted March 14, 2015 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 Link to comment Share on other sites More sharing options...
Outbreaker Posted March 14, 2015 Author Share Posted March 14, 2015 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. Link to comment Share on other sites More sharing options...
MHz Posted March 14, 2015 Share Posted March 14, 2015 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? Link to comment Share on other sites More sharing options...
Outbreaker Posted March 14, 2015 Author Share Posted March 14, 2015 (edited) 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, 2015 by Outbreaker Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2015 Share Posted March 14, 2015 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. Link to comment Share on other sites More sharing options...
Outbreaker Posted March 14, 2015 Author Share Posted March 14, 2015 (edited) 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, 2015 by Outbreaker Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2015 Share Posted March 14, 2015 user_hidden and I both use AdvPack in our update packs. Check the INFs. Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2015 Share Posted March 14, 2015 (edited) 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, 2015 by 5eraph Link to comment Share on other sites More sharing options...
Outbreaker Posted March 14, 2015 Author Share Posted March 14, 2015 (edited) 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, 2015 by Outbreaker Link to comment Share on other sites More sharing options...
DXRW4E Posted April 6, 2015 Share Posted April 6, 2015 (edited) 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, 2015 by DXRW4E Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now