NickeManarin / ScreenToGif

🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
http://www.screentogif.com
Microsoft Public License
23.04k stars 2.15k forks source link

Silent Install not creating shortcuts #1258

Open Asinin3 opened 6 months ago

Asinin3 commented 6 months ago

Describe the bug Version 2.39 using full .msi Installer. Running msiexec /i "ScreenToGif 2.19.3 Setup.msi" /quiet /norestart INSTALLDESKTOPSHORTCUT=yes INSTALLSHORTCUT=yes doesn't create any shortcuts. Running without the shortcut parameters doesn't create any in start menu or desktop either. Has something changed?

These are the commands from #549 which were advised to work and the issue was closed.

DW-42 commented 2 months ago

I am able to reproduce this issue with the latest version of ScreenToGif (version 2.41.0) when installed as the built-in Windows user 'NT AUTHORITY\SYSTEM'. The logs suggest that the installer is coming up with the wrong values for the ProgramMenuFolder and DesktopFolder properties:

ProgramMenuFolder = C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\
DesktopFolder = C:\WINDOWS\system32\config\systemprofile\Desktop\

These values should be:

DesktopFolder = C:\Users\Public\Desktop\
ProgramMenuFolder = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\

My guess is that the MSI installer incorrectly retrieving the 'NT AUTHORITY\SYSTEM' user profile paths instead of the expected public folders, resulting in the shortcuts not being created in the correct locations. Alternatively, the installer may not be properly handling the ALLUSERS or MSIINSTALLPERUSER properties when installed by the 'NT AUTHORITY\SYSTEM' user. These properties determine whether the application is installed for all users or only the current user, and they affect the locations where shortcuts and other user-specific files are created. If the installer is not setting ALLUSERS=1 correctly, it may be falling back to the 'NT AUTHORITY\SYSTEM' user profile paths instead of the public folders. Similarly, if the MSIINSTALLPERUSER property is not being handled properly, it could lead to the same issue.

In summary, the root cause is likely related to the installer incorrectly retrieving the folder paths or not properly handling the ALLUSERS or MSIINSTALLPERUSER properties when installed by the 'NT AUTHORITY\SYSTEM' user, resulting in the shortcuts not being created in the expected public folders.