Jump to content

Clearification on RunOnceEx Instructions


Chazz76

Recommended Posts

For the RunOnceEx Getting Started instructions, does"First of all, remove the [GuiRunOnce] entries in winnt.sif, as RunOnceEx can be used to replace [GuiRunOnce] completely." simple instructing to replace [GuiRunOnce] with [RunOnceEx] along with the path to the application files in the winnt.sif file?

Also, in the "RunOnceEx From CD" section, does "FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:" still needed in the file when using the alternative "SetLocal enableextensions

SET CDROM=%~d0/EndLocal method?

Any assistance is providing some clearification is greatly appreciate.

The verbage is a bit confusing with english being my second language

Link to comment
Share on other sites


Hi Chazz76 :)

It just means that you should delete the '[GuiRunOnce]' section from 'winnt.sif' and then you instead call the batchfile that imports the RunOnceEx reg-entries from 'cmdlines.txt'.

Yes, you don't need the 'for' loop if you use the 'enableextensions' method instead.

Here's how i personally preffer to do the RunOnceEx method :

Place your batchfile that imports the RunOnceEx reg-entries(mine's called 'setup.cmd') + all your programs(or even better, your silent switchless 7z SFX installers) into a folder placed into the root and which you name 'setup'. Then download 'hidcon.exe' from the attached file at the bottom of this post and also place it in the 'setup' folder(used to hide the command-prompt completely, unlike 'cmdow.exe' and it works perfectly from T-12 i.e. 'cmdlines.txt'). Then you make another folder in the root named '$OEM$' and in there you make a text file named 'cmdlines.txt' and in which you add the following :

[Commands]
"..\setup\hidcon.exe ..\setup\setup.cmd"

It isn't possible to use environment variables in 'cmdlines.txt'(e.g. %systemdrive% etc) and hence, you need to do as i did above, if you want to get away with not having the RunOnceEx batchfile in the '$OEM$' folder(unless of course a direct path is used).

I personally find it most convenient to just have one single folder(setup) in the root, which contains all my silent switchless 7z SFX installers, batch and reg-files and then just have the single 'cmdlines.txt' file in the '$OEM$' folder. This means that when something needs to be edited in a batchfile, or some installers needs to be updated, then i always just need to go into the 'setup' folder and make the changes, instead of having to e.g. first go into '$OEM$' and edit the batch-file there which imports the RunOnceEx reg-entries and then afterwards go into the 'setup' folder and replace some outdated installers...

Here follows a snip of my batch file(setup.cmd) that imports the RunOnceEx reg-entries at T-12(cmdlines.txt) :

setlocal enableextensions
set setup=%~d0\setup
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
reg add %key% /v title /d "Installing Applications" /f
reg add %key%\001 /ve /d "Acronis True Image Home v9.0" /f
reg add %key%\001 /v 1 /d "%setup%\Acronis_True_Image_Home_v9.0.3677.exe" /f
[...]
reg add %key%\009 /ve /d "Importing Registry Tweaks" /f
reg add %key%\009 /v 1 /d "regedit /s %setup%\setup.reg" /f
reg add %key%\010 /ve /d "Restarting Windows" /f
reg add %key%\010 /v 1 /d "%setup%\hidcon.exe shutdown.exe -r -f -t 60" /f
endlocal

I use nLite to integrate Xable's Light Post-SP2 UpdatePack, enable tweaks and unattended settings, add users and of course to remove unwanted components(my ISO without the added installers is only 115MB big and works perfectly for my purposses ;)).

hidcon.exe

Edited by Martin H
Link to comment
Share on other sites

Yeahh, sorry about that, i should of course have mentioned that only 'hidcon.exe' should be used from the 7z archive, but thank you Arie for your help :)

Anyway, i have edited my previous post to include Oleg Scherbakov's great little 2KB utility 'hidcon.exe' as an attached file, and i apologise for previously having directly linked to it...

CU, Martin.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...