MECM install script bug

*** Please report new bugs here! ***

Moderators: xnview, Dreamer

vibedebugger
Posts: 1
Joined: Mon Mar 02, 2026 5:42 pm

MECM install script bug

Post by vibedebugger »

When using MECM the installer throws an error:
failed to expand Shell Folder Constant "userdesktop" and "userstartmenu"'


This is a documented issue with innosetup installers and very easy to overcome by editing your script

https://www.reddit.com/r/SCCM/comments/ ... _constant/
In many INNOSETUP scripts the author of the script has incorrectly set the script to use the User desktop folder to create the desktop icon instead of using the system desktop folder. This works fine when the application installer is run directly by the user as the desktop folder exists in their user profile, however when running INNOSETUP scripts using Configuration Manager the script runs in the SYSTEM context which doesn't have a Desktop folder, so when the installer looks for that folder it fails giving the error above.
If you are fixing an INNOSETUP script then you should make sure that you use Auto Constants rather than the Shell Folder Constants in your script, eg replace the userdesktop constant with autodesktop. This allows your script to choose the appropriate folder depending on whether the script runs as a regular user or with elevated privileges.

eg. replace

Name: "{userdesktop}\My Program"
with

Name: "{autodesktop}\My Program"

Thank you for your attention to this matter.
User avatar
xnview
Author of XnView
Posts: 47521
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: MECM install script bug

Post by xnview »

ok it will be changed
Pierre.