Post-Setup programs not installing anymore

tired-it

Member
I have been researching how to make a customized ISO that streamlines resetting PCs. Thanks to the awesome people here, I have an ISO with all the necessary settings and policies...almost. A few tweaks were missed and I had to redo the ISO, but now the post-setup does not seem to be completing properly.

I had originally made an ISO before installing updates so I can just remake it with the latest updates when needed. When doing a test install, none of the added programs had installed. I've remade the ISO a couple of times trying different configurations, even starting completely fresh, going step by step and doing test installs in a VM and on a PC, but I can't seem to figure out what happened.

The commands are seemingly working, but the four MSI files are no longer installing and the Wifi profile is no longer being added. The first image was the original attempt using the post-setup page. It was working at some point. The second image is the second attempt. Still no success.

For some extra context, I started with a clean Windows 11 22H2 ISO file and did the following:
  1. Removed some components, mainly preinstalled apps
  2. Added some registry files that toggled settings
  3. Added drivers and latest Windows updates based on what NTLite found
  4. Only changed 2 settings within NTLite (Teams install and Start Menu folder)
  5. Added files and commands to the Post-Setup page as picture below
  6. Enabled the unattended file
postsetup1.png
postsetup2.png
Any ideas as to what went wrong?
 
Last edited:
This may be because of the ordering of your steps. Read the "Processing Order" section over here (link), which explains how the ordering can cause bugs like this. It may not be the problem, but it's the first place I would start.
 
This may be because of the ordering of your steps. Read the "Processing Order" section over here (link), which explains how your first steps can cause bugs like this. It may not be the problem, but it's the first place I would start.
Thanks for the heads up, I'll look into this. A quick skim confirms that I've been applying a similar methodology to the custom ISO. Though I was doing updates last rather than first. Perhaps I should take a clean ISO, add updates and use that as the base?

Either way, what's confusing me is that the programs from Post-Setup were installing just fine a few iterations ago and now they seemingly don't want to install. Windows will take a while to prepare after an install, as if it's going through the post-setup process, but then nothing appears when I sign into a user profile.
 
Last edited:
Why are there full pathnames for the MSI files?

While that is legitimate, you're putting some weird dependency on folder C:\Users\Admin\Desktop\ntlite\MSI. Normally NTLite adds a private copy of your MSI files to $OEM$\Setup\Files, and you don't need to specify the staging folder. If you do use an external folder, it's up to you manage how files get there.
 
Why are there full pathnames for the MSI files?

While that is legitimate, you're putting some weird dependency on folder C:\Users\Admin\Desktop\ntlite\MSI. Normally NTLite adds a private copy of your MSI files to $OEM$\Setup\Files, and you don't need to specify the staging folder. If you do use an external folder, it's up to you manage how files get there.
Oh that Post-Setup page was from a saved preset. After the files are added in, the page looks like the first picture without full pathnames.
 
Is the target system a PC with a Windows license in BIOS? Then it requires the OEM SetupComplete checkbox marked.
 
Well. I removed /install from all four MSI files. Only 1 installed. I also checked OEM SetupComplete and nothing changed. It's almost like the Post-Setup is just not working anymore on my system. Any ideas?

And the Wifi profile is no longer being added when that used to work just fine. I don't know what happened.
 
I would break it into 3 layers for troubleshooting efficiency. First, take an unmodified ISO and create a new image by doing it in the correct order, which in your case would require integrating Windows Updates first, process that, remove components, process that, integrate drivers, process that, install registry tweaks, process that. Leave out the unattend file and post-setup commands. Install Windows and see if it works right.

If all is well then we know that part of the equation is good, so now add unattend stuff and install that new image. Unattend is one of the places people very frequently run into problems, so we can't combine it with other steps when it could potentially be bugged.

If this still lets the install work right, then the last thing to do is now add the post-setup commands, which are also commonly responsible for this same problem and try that. It's possible things will just work without further tweaking, because the ordering was addressed in the base image. Either way, this will show us the bugged layer, making the specific culprit easier to identify.
 
This was a bit of a journey. So I started with a clean Windows 11 ISO. At each step I saved a preset, processed the image, copied it onto a flash drive with Rufus and then installed the OS onto a test PC. The newly processed image was then used as a foundation for the next step.
  1. Windows updates (Also used the DISM Compatible cleanup option to reduce the file size). Success.
  2. Removed components. Success.
  3. Drivers (with reuse driver cache). Success.
  4. Registry files and changed 2 settings. Success
  5. Unattended configuration. Success.
  6. Post-Setup. Fail. Nothing installed or added.
Once again the post-setup part just fails. I even have the OEM SetupComplete checked in from Step 5. Changing the ordering and the command parameters does not seem to alter the end result so far. Here's what the current Post-Setup page looks like after re-mounting the ISO:

postsetup3.png

I can verify the "student" profile command is working because that profile cannot access the Settings apps, which is intended. The updates, drivers, registry files and more all checked out from what I can tell. The OS installation completed without a hitch and I saw Windows enter a setup screen as if it was trying to initialize the Post-Setup configuration.

This used to work too. A couple iterations ago I was using the same commands and the MSI files were installing. Does Windows just abandon the rest of the commands if one of them causes an error?
 
Does Windows just abandon the rest of the commands if one of them causes an error?
It depends on the code, but yeah typically code will crash or bug out in obvious ways when it's asked to do something it doesn't know how to handle. You did a great job with this new testing setup, and I would suggest that you continue breaking it down from here and you'll find the culprit.

For example, take the image from #5 in your list above, then only add in the net and netsh commands, plus the Wi-Fi XML, install that and even if you successfully reach the desktop on this install, take a moment to specifically check these post-setup commands and make sure they are all working right before adding more, since Windows not hanging up doesn't automatically mean the tweaks are working.

If that's good, then make another image, and now this time add the VLC msi and it's related cmd.exe, install and test that. I suspect the cmd.exe may be one of the potential culprits because it might be running too fast and thus presents an error prompt of, "No file found."

After that, focus on adding 1 msi file at a time, and eliminate variables by only using /quiet /norestart for now.
 
Last edited:
I'm seeing now too that all of this is inside "Machine" post-setup. Some things in these situations have to go into "User" instead, so that's where this thread will eventually end up at--solved by fixing some parameters and/or moving things into different post-setup sections. I think the VLC cmd.exe would need to be in User for example, so that it has enough delay to actually delete a file.
 
Last edited:
I'm not sure why you're introducing new mistakes (it's not NTLite making them).
When you add a Post-Setup command, it's normally [Command] and [Parameters] (or everything which isn't the base command).

CommandParameters
netlocalgroup users student delete
netaccounts /pwage:unlimited
cmd/c del /f "C:\Users\Public\Desktop\VLC Media Player.lnk"
 
I'm not sure why you're introducing new mistakes (it's not NTLite making them).
When you add a Post-Setup command, it's normally [Command] and [Parameters] (or everything which isn't the base command).

CommandParameters
netlocalgroup users student delete
netaccounts /pwage:unlimited
cmd/c del /f "C:\Users\Public\Desktop\VLC Media Player.lnk"
I'm not well versed with commands, but I'm trying to learn. Funny enough, that particular command works just fine, but I'll remove the redundant information regardless.

I'm seeing now too that all of this is inside "Machine" post-setup. Some things in these situations have to go into "User" instead, so that's where this thread will eventually end up at--solved by fixing some parameters and/or moving things into different post-setup sections. I think the VLC cmd.exe would need to be in User for example, so that it has enough delay to actually delete a file.
I'll do some more testing to see where things are breaking. I wish there was a faster way than doing reinstalls on a test PC, but better safe than sorry. At one point, everything was working just fine in the Machine category. Would the VLC command need admin privileges to delete the shortcut?
 
If NTLite reports the line (from your screen capture) as: "net | net localgroup users student delete"

Then the actual command to be executed is "net net", which errors out. NTLite wants to separate the Command to identify what type of executable (cmd, PS) because it calls them differently inside SetupComplete. You need admin privileges to delete C:\Users\Public files since those are provided by Windows for all users to inherit.
 
If NTLite reports the line (from your screen capture) as: "net | net localgroup users student delete"

Then the actual command to be executed is "net net", which errors out. NTLite wants to separate the Command to identify what type of executable (cmd, PS) because it calls them differently inside SetupComplete. You need admin privileges to delete C:\Users\Public files since those are provided by Windows for all users to inherit.
Oh I didn't catch that extra "net"! Thank for the explanation, that makes more sense. And I'll keep the VLC command under Machine then. I'm going to be testing a few of the Post-Setup lines at a time to find out where else I may have made a mistake.
 
So here's something odd I just found out.

postsetup4.png
Here's another attempt to get the Post-Setup to work. Once again, the Wifi profile was not added. I navigated to "C:\Windows\Setup\Files" and the xml file was there. I checked "C:\Windows\Setup\Scripts" and there was a "SetupComplete.cmd" file there. I took a look inside and saw the commands just like they were in the Post-Setup page. Manually running the file as admin worked immediately.

I did check in the OEM SetupComplete option in the unattended page. It seems like Windows is not executing the file, but I'm not sure how to confirm that. Any ideas as to what went wrong?

Edit: Redoing the Unattended section after adding those commands to the Post-Setup page seemed to work. Testing the other options now.
 
Last edited:
Alright, looks like things worked out this time.

postsetup5.png

Originally, a base image with the Unattended setting was created. The idea was to add Post-Setup commands a few at a time and export that for testing. I assumed the Unattended setup was working because installation completed as expected. This time I redid the Unattended settings, manually checking in the "OEM SetupComplete" and "Copy to boot image." I don't think the latter did anything to help though. Afterwards the Post-Setup commands were added and the image was exported. This worked.

I may test again using "/quiet /norestart" on the MSI files for the sake of being thorough.

During the "Preparing Windows" phase of installation, a command prompt appeared and displayed a few running commands. There was an error regarding not being able to find the user "student," but the system soon restarted and booted without issue. No VLC icon, all 4 programs installed and the Wifi profile added and connected.

The student profile was working fine too despite the aforementioned error. For context, I added a student profile in the Unattended page under the custom user group "guests." This restricts the account from opening the Settings app as well as a few other quirks. It functions similarly to the Guest account system from Windows 7. Various guides suggested the "net localgroup users student /delete" command; otherwise, the account would still have access to various settings.

A major thanks to everyone that helped me narrow this down. I'm still learning NTLite, but it has been a fun experiment thus far. I suppose next time I'm making an image, I'll redo the Unattended page just in case. I did save a preset of just the Unattended page changes to streamline the process.
 
I may test again using "/quiet /norestart" on the MSI files for the sake of being thorough.
A tip here, and for other miscellaneous troubleshooting, is that you can test various things like this on a live Windows, to get a head's up of what will happen before reformatting. Here's how I just tested all 4 of your MSI files with new parameters, without reinstalling Windows:

1) Create a TEST folder on the desktop. Download MSI installers for SecureBrowser, Edge, Chrome, and VLC. Put all these MSI files inside the newly created TEST folder, and exit out of all open windows and such.

2) Create a batch file inside the TEST folder, and save the code below into it. Run the .bat file as an administrator and it will test the installation of the Chrome MSI file. Be sure to uninstall these programs first, if they already exist on the live Windows. To test the other files, edit the batch and change the filename from chrome.msi into whichever file you want to test next. The reason a batch file is used, is so that we can test the actual silent parameters of MSI, and then also know when the install is finished, since the batch file informs us of this.
@ECHO OFF
ECHO Testing silent install parameters...
msiexec.exe /i "%UserProfile%\Desktop\TEST\chrome.msi" /quiet /norestart
ECHO.
ECHO Installer finished!
PAUSE
 
Last edited:
Back
Top