Fix it now
Windows Installer’s client half asked its service half to do something and the service had no transaction open to attach it to. Microsoft publishes 2503 as “Called RunScript when not marked in progress” and 2502 as “Called InstallFinalize when no install in progress”. Underneath, it is nearly always elevation or the ACLs on the two folders the installer writes into.
msiexec /i "C:\path\to\package.msi"
icacls C:\Windows\Temp /grant "SYSTEM:(OI)(CI)F" "Administrators:(OI)(CI)F"
icacls C:\Windows\Installer /grant "SYSTEM:(OI)(CI)F" "Administrators:(OI)(CI)F"
net stop msiserver
net start msiserver
- Close the failed installer and make sure no msiexec window is still open, then start an elevated Command Prompt and run the package from there. A large share of 2502 and 2503 reports end at that line.
- If it still fails, run the two
icaclslines, restart the service, and try the install again. - If it still fails, capture a log and read it:
msiexec /i package.msi /l*v %USERPROFILE%\Desktop\msi.log, then search for the firstReturn value 3.
Never empty C:\Windows\Installer to reclaim space. It holds the cached packages and patches used to repair, patch and remove everything already installed, and it cannot be rebuilt without the original media.
If the package installs from the elevated prompt you are finished. If not, the next section explains what the two halves of the installer are disagreeing about.
Why it happens
A Windows Installer package runs in two processes. The client sits in your logon session and owns the user interface. The service, msiserver, runs as SYSTEM and does the work: writing files, touching the registry and building the rollback script that lets the whole transaction be undone. Those scripts are written into the hidden folder C:\Windows\Installer, staged through the Temp folder.
The two codes report that disagreement at two different points, and the published wording is worth reading carefully because most accounts of this error swap them. 2503 is raised when the client calls RunScript and the service is not marked as having an install in progress. 2502 is raised when the client calls InstallFinalize – the action that commits the transaction – and the service has no install in progress at all. So 2503 comes first, at the hand-off, and 2502 follows at the commit.
Neither code names the underlying fault, which is why they are so unhelpful alone. What sits underneath is usually one of two things: the client was never elevated, so the service refused to open a per-machine transaction on its behalf; or the transaction could not be created because the identity doing the work could not write where it needed to.
The two companion codes say it in plainer language. 1632 is ERROR_INSTALL_TEMP_UNWRITABLE, published as the Temp folder being full or inaccessible. 1336 reports an error creating a temporary file, and its message carries the folder and the system error code. If either appears next to 2502 and 2503, stop guessing: it is a folder problem and the message tells you which folder.
The package was launched without elevation
You have this one if Double-clicking the MSI fails immediately, and the identical file installs cleanly from an administrative Command Prompt.
- Open an elevated Command Prompt and run
msiexec /i "full\path\to\package.msi". - To remove a product, use the same approach:
msiexec /x {ProductCode}. - For a wrapper setup that needs an elevated shell around it, start the wrapper from that same elevated prompt rather than from Explorer.
Do not enable AlwaysInstallElevated to work around this. It lets any standard user install a package with system rights and is a well-known privilege-escalation route.
SYSTEM or Administrators lost rights on the hidden Installer folder
You have this one if Every MSI on the machine fails the same way, including packages that install without trouble on an identical build.
- From an elevated prompt confirm the folder is there:
dir /a C:\Windows\Installer. - Restore rights:
icacls C:\Windows\Installer /grant "SYSTEM:(OI)(CI)F" "Administrators:(OI)(CI)F". - If the ACL is badly mangled, take ownership first with
takeown /f C:\Windows\Installer /r /d y, then reapply the grant. - Restart the service with
net stop msiserverandnet start msiserver, and retry.
The Temp path is broken, redirected or out of space
You have this one if 1632 or 1336 appears next to the two codes, or the failure follows one user around the estate rather than one machine.
- Compare what the account is actually using: run
echo %TEMP%in a normal prompt and again in an elevated one. - Confirm the folder exists and is writable, and create it if it is missing.
- Check free space with
fsutil volume diskfree C:. Windows Installer stages the payload before it commits. - If a profile tool or policy has redirected TEMP to a share, point it at a local path for the duration of the install.
The Windows Installer service is stopped, disabled or wedged
You have this one if Nothing installs at all, and msiexec /i returns immediately with no progress dialog.
- Check it from an elevated Command Prompt:
sc.exe query msiserver. - If it is disabled, set it back:
sc.exe config msiserver start= demand, thennet start msiserver. - If an earlier install left it stuck, reboot once – a pending transaction can hold the service until the machine restarts.
Write these as sc.exe rather than sc. In PowerShell, sc is an alias for Set-Content, so sc query msiserver does not query anything.
Full reference
The published wording, side by side
| Number | Published message | What it tells you |
|---|---|---|
| 2503 | Called RunScript when not marked in progress | The client tried to hand a script to the service and the service had no install running |
| 2502 | Called InstallFinalize when no install in progress | The client tried to commit and the service had no install running at all |
| 1632 | The Temp folder is either full or inaccessible. Verify that the Temp folder exists and that you can write to it | A folder problem, named |
| 1336 | There was an error creating a temporary file that is needed to complete this installation. Folder: [3]. System error code: [2] | A folder problem, with the folder and the system error |
The system error code inside 1336 is the useful part. 5 is access denied and puts you on the permissions cause. 3 and 2 are path and file not found, which point at a TEMP variable aimed somewhere that no longer exists. 112 is out of space.
Reading the symptom back to the fault
| What you observe | Where to look |
|---|---|
| Both codes appear, then setup rolls back | The rollback script could not be created in C:\Windows\Installer |
| Only one user account is affected | That profile’s TEMP path is missing, redirected or denied |
| Every MSI on the machine fails the same way | ACLs on C:\Windows\Temp or C:\Windows\Installer |
| 1632 also appears | The temp target is full, offline or on a drive that is not connected |
| It works from an elevated prompt but not from Explorer | Elevation, not permissions |
Commands worth keeping to hand
| Command | What it does |
|---|---|
msiexec /i package.msi |
Installs in the current, elevated context |
msiexec /x {ProductCode} |
Removes a product without needing the original file |
msiexec /i package.msi /l*v log.txt |
Writes the verbose log that names the failing action |
icacls <folder> |
Prints the current access control list |
takeown /f <folder> /r /d y |
Takes ownership of a folder and everything below it |
sc.exe query msiserver |
Shows the state of the Windows Installer service |
Why the folder must not be emptied
C:\Windows\Installer is regularly described online as a cache you can clear. It is not. It holds the cached copy of every installed package and patch, and Windows Installer reads those copies to repair, patch and uninstall products. Deleting them leaves applications that cannot be removed or serviced, and the only way back is the original media for each one. If the folder is genuinely consuming an unreasonable amount of space, the answer is to remove products you no longer need through the normal uninstall route, which lets the installer clean up its own cache entries.
When it fails from an elevated prompt too
- Take the verbose log and find the first
Return value 3. The action named immediately above it is the one that failed. - Read the lines just before it for a path or a registry key. Those are the concrete thing to check.
- Confirm the account really is elevated with
whoami /groupsrather than assuming the shortcut worked. - Try a second, unrelated MSI. If that also fails, the machine is the problem; if it installs, the package is.
- If the machine has a pending restart from an earlier install, take it before drawing any conclusions.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
2502 |
InstallFinalize was called when the installer service had no install in progress | Microsoft Learn |
2503 |
RunScript was called when the installer service was not marked as having an install in progress | Microsoft Learn |
1632 |
The Temp folder is full or inaccessible | Microsoft Learn |
1336 |
A temporary file needed to complete the installation could not be created; the message names the folder and the system error code | Microsoft Learn |
Confirm the fix worked
- Run the installer again the ordinary way and confirm it either completes or prompts for elevation and then completes.
- Check the product appears in Settings, Apps, Installed apps and that its uninstall entry works.
- Run
icacls C:\Windows\Installerand confirm SYSTEM and Administrators both hold full control. - Install a second, unrelated MSI to confirm the machine is generally healthy rather than one package being special.
- Run
sc.exe query msiserverand confirm the service starts on demand rather than being disabled.
Questions people ask about this
Does fixing this cost anything?
No. There is no licence, key or paid tool involved in 2502 or 2503. Every step uses commands that ship with Windows, and the fix is an elevation or permission change on folders you already own.
Which of the two codes comes first?
2503, at the point the client hands a script to the service. 2502 follows when the client calls InstallFinalize to commit and the service still has no install in progress. Plenty of write-ups have this the other way round; Microsoft’s published messages settle it.
Is it safe to run icacls against Windows folders?
Granting SYSTEM and Administrators full control on the Temp and Installer folders restores what Windows sets by default, so the risk is low. What is not safe is a sweeping reset across the whole drive, or removing entries instead of adding them.
The installer still fails from an elevated prompt. What now?
Take the verbose log and search for the first occurrence of Return value 3. The action named just above it is the one that failed, and it usually points at a specific path or registry key you can check directly.
Can I stop this happening across the estate?
Deploy in the system context through your management tool rather than relying on users to elevate, and keep the default ACLs on the Temp and Installer folders in whatever hardening baseline you apply. Those two things remove nearly all of these reports.
