Archive: Compatibility mode


Compatibility mode
Hello, I need my installer to create a shorcut in compatibility mode in Windows 7, x64, and I found some strange behavior. If I include the following line in the installer script, the shortcut does not get created in compatibilty mode, whereas If I run it from a console window, It does:

ExecShell 'reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "$INSTDIR\MyTest.exe" /d "WINXPSP3" /f' SHOWNORMAL

I've also tried to include the commad line in a cmd file and ExceShell' it from the installer, but no luck. Again, If I run the .cmd file from a system console, the shortcut gets modified correctly.

Bottom line: Does anybody know how to create a shortcut with compatibility mode set to WINXPSP3 from within an installer script?

Best regards,

Miguel


NSIS already has registry instructions so using reg.exe like this is pretty retarded IMHO, either way, to write to HKLM you need to be admin.

Personally, I don't really feel that it is OK to write to AppCompatFlags\Layers, it belongs to the user/machine owner. You should try to fix your app instead.

When you say shortcut do you mean a .lnk file? I don't think you can store compatibility flags in the .lnk file itself...