Old 20th February 2019, 13:01   #1
Ptitus37
Junior Member
 
Join Date: Sep 2018
Posts: 5
Writing unsupported AppCompatFlags value on 64-bit Windows

Hello, my dear,

I would like to know how to create the Layers directory via NSIS
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]

On a blank machine this directory does not exist and I put this in my script
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "C:\application,exe" "~ RUNASADMIN WIN7RTM"

and it does not create it.
You can come to my help.
Ptitus37 is offline   Reply With Quote
Old 20th February 2019, 13:10   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,013
Is the application you want to set the appcompat flag for 32-bit or 64-bit?

You are not really supposed to set these flags, the user is supposed to set them. You as a application author should just fix your application so it does not require hacks!

See also:

https://blogs.msdn.microsoft.com/old...1-00/?p=14643/

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 20th February 2019, 14:59   #3
Ptitus37
Junior Member
 
Join Date: Sep 2018
Posts: 5
Yes, our application is concerned with running Windows10 usually in 64bit.
And I wish to automate the registration of these rights on our executables when we install a new machine in our customers.
Just to avoid having to manually right click on the executable and run in Windows7 and admin compatibility
Ptitus37 is offline   Reply With Quote
Old 20th February 2019, 16:19   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,013
So you are choosing to ignore Microsoft's advice and set a value you are not really supposed to set instead of fixing your application?

To set a compatibility flag for a 64-bit application you must detect if you are on 64-bit Windows with the macro in x64.nsh and if that is the case you can call "SetRegView 64" to change to the 64-bit registry view.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump