NTLite messes up setupcomplete.cmd under some circumstances

freMea

New Member
Hi,

Steps to reproduce :

1. Copy your $OEM$ folder in Windows source​
2. Load your image with NTLite​
3. Check Automate Post-Setup section.​
NTLite parsed my setupcomplete.cmd and divided in multiple commands

Result :

If you didn’t notice this and use a such image to install Windows, here is what happens.
NTLite deletes C:\Windows\Setup\Scripts\SetupComplete.cmd and replaces it with the commands above. As a result, after Windows installation, although C:\Windows\Panther\UnattendGC\Setupact.log reports setupcomplete.cmd has run, your script didn’t work as expected because it never ran as a batch.

Workaround:

Copy your $OEM$ folder in Windows source after NTlite processes the image but before your create an ISO.

Expectation:

Why NTLite just don’t leave all what is in $OEM$ folder alone?
 

nuhi

NTLite developer
Staff member
Hi,

NTLite uses the very same setupcomplety.cmd for post-setup commands, and to allow for easier setupcomplete management.
However, what you experienced is not expected and should be fixed once confirmed.

Are you saying that if I put any setupcomplete.cmd in $OEM$ it will be deleted?
But that is simply not so, can you please attach your setupcomplete if you confirm it with the latest version?
And the preset used would be best, so I have full environment for testing.

Thanks, and sorry for the inconvenience.
 

freMea

New Member
Tested now with NTLite 1.7.2.6717 without applying any presets.

Once image loaded and after saving image my original SetupComplete.cmd stays untouched. With 1.7.2.6650, I think the file was deleted. I suppose it should be ok with the last version now. But I haven’t tried to install ISO in a VM yet to confirm the SetupComplete.cmd is run properly but here is a sample that can be used for testing. If c:\custom Windows setup.log exists after setup, then it’s fine else same bug as my previous post.

Code:
:: ANY COMMENT HERE

@echo off
cls
cd /d "%~dp0"

 SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
:: =====================================================================
:: --- SET VARIABLES
:: =====================================================================
set log="c:\custom Windows setup.log"

:: ------------------------------
echo. > %log%
echo SUCCESS >> %log%

exit
 

e_web

Member
I am both drunk and confused after reading this so I should likely just mind my own business - but of course I won't!

NTLite deletes C:\Windows\Setup\Scripts\SetupComplete.cmd
Workaround:
Copy your $OEM$ folder in Windows source after NTlite processes the image
By default there is no "C:\Windows\Setup\Scripts\SetupComplete.cmd" for anything to delete. Windows Setup, itself, copies files TO "C:\Windows\Setup\Scripts" FROM "sources\$OEM$\$$\Setup\Scripts".
Is this a sysprep image (or perhaps a manual mount/change/save via dism or imagex) so that there is an existing "C:\Windows\Setup\Scripts\SetupComplete.cmd"? If so, why not copy that same SetupComplete.cmd over to $OEM$ prior to loading the image for alteration by NTLite so that they share the same exact instructions?

As for the workaround, "Copy your $OEM$ folder in Windows source after NTlite processes the image" has me even more confused as IF NTlite was at fault why do it AFTER? The only way I see that working is if you change it to something like "Copy your setupcomplete.cmd back TO the $OEM$ folder in Windows source after NTLite processes the image."

You say it DELETES the file but the only way I see NTLite possibly being at fault, in my drunken stooper, is if it is CORRUPTING the setupcomplete.cmd in the $OEM$ source directory but that doesn't seem to be close to what I just read.

Sorry in advance for the backward thoughts and failures to make sense of my own above!

If it's any consolation I stopped actually using the setupcomlete.cmd via NTLite for anything other then launching a different bat because it kept removing my formatting (grr, that spacing between lines was there for a reason) but it never actually broke any of my commands and certainly never has deleted it outright (not to say a bug doesn't exist that could do so in certain scenarios)... =(
 
Last edited:

Clanger

Well-Known Member
I am both drunk and confused
Business as usual then, least you aint been on the mushrooms :p
SetupComplete.cmd and answer files, once you have them known working then back them up so you dont loosem, dvd, just drag them out of storage when needed and replace whatever NTLite puts in $OEM$, silly creating a new one everytime.
 

Kasual

Active Member
I don't have that issue, the setupcomplete.cmd file could be edited in some scenarios but isn't edited/deleted as it is.
 

freMea

New Member
After installing the ISO in a VM, I couldn't reproduce the bug in NTLite 1.7.2.6717. The script is run and create the log file. I guess it’s fixed now. I will post if I find out it is related with preset.
 

ege914

Member
ı was having exact issue for 2 straight years.

I place my own oem folder at last step and never open post-setup section in ntlite. this way ntlite doesnt touch my setupcomplete file.


(also freMea if you integrate updates to iso, setupcomplete will be broken too. so don't)
 

ege914

Member
Interesting. Did you post a bug report about that ? If is still reproductible in last release, you should.
yes i did post a bug about that via threads and private messages.

i think this is the reason: ntlite will use setupcomplete.cmd if you integrate updates just like it uses setupcomplete.cmd if you use post setup.
So when you put a setupcomplete.cmd file that you made manually to oem folder or directly iso's setup folder. and use postsetup or integratingupdates part. ntlite will try to edit or create setupcomplete which will not directly copy and paste your codes, and will not add its own codec to the end of the script, it will just edit and break your codes.

so thats why i never enter postsetup part after i place my own setupcomplete.cmd and never integrate updates.
 
Top