Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

.inf Run taskkill before CopyFiles

Featured Replies

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. :crazy:

Edited by Outbreaker


  • 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 by Outbreaker

Try stopping the Windows Update service.

 

Commands like

net stop wuauserv

and to start

net start wuauserv

Or 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

  • 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. :(

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?
  • 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"). :crazy:

So i try to find a workaround for the .inf file to first execute a command before a copy process. :(

Edited by Outbreaker

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.

  • Author

I'm using "ocgen.dll" not sure if i could use "advpack.dll" for an UpdatePack without messing things up. :unsure:

This .inf part is being run from the "Add/Remove Windows Components".

Edited by Outbreaker

user_hidden and I both use AdvPack in our update packs. Check the INFs. :)

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 by 5eraph

  • 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 by Outbreaker

  • 4 weeks later...

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 by DXRW4E

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.