Old 23rd March 2021, 13:49   #1
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
Association of files in windows 10

With the advent of Windows 10, it was not possible to associate the necessary files in advance when installing any program - due to the individual hash amount for each file associations ...
But the calculation algorithm for this hash amount was found.
https://github.com/DanysysTeam/PS-SFTA
A tool was created, and a script for association in Windows 10.

There is also an appropriate function.
https://pastebin.com/raw/GFUz3snK

This is great news !

Is it possible on the basis of this function to make a plugin for NSIS ? It would be just wonderful !
stass is offline   Reply With Quote
Old 24th March 2021, 06:57   #2
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 907
Is setting the association directly not enough?

Excerpt from makensis.nsi:

PHP Code:
  ReadRegStr $R0 HKCR ".nsh" ""
  
StrCmp $R0 "NSHFile" +2
    DeleteRegKey HKCR 
"NSHFile"

  
WriteRegStr HKCR ".nsh" "" "NSIS.Header"
  
WriteRegStr HKCR ".nsh" "PerceivedType" "text"
  
WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
  
WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,2"
  
ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
  
${If} $R0 == ""
    
WriteRegStr HKCR "NSIS.Header\shell" "" "open"
    
WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
  
${EndIf}

  ${
NotifyShell_AssocChanged

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 24th March 2021, 07:32   #3
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
If the association is already "busy" by the default program - then not enough...
Windows 10 now always calculates the hash sum for file associations.
stass is offline   Reply With Quote
Old 24th March 2021, 08:03   #4
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 528
Send a message via ICQ to Pawel
That is interesting!
However, I think Microsoft will change HASH alghoritm for ProgID.

There should not be possibility to associate file extansions without user manual action... Are we going to back to XP times, where all programs could make a mess in registry?

-Pawel
Pawel is offline   Reply With Quote
Old 24th March 2021, 08:34   #5
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
Quote:
Originally Posted by Pawel View Post
However, I think Microsoft will change HASH alghoritm for ProgID.
Maybe changes ... and maybe not, as not changes for years, many nonsense in Windows ...

As long as the algorithm has not changed, it would be nice to make a plugin for file associations. (And if it change, then the coding masters and it is calculated ...)
stass is offline   Reply With Quote
Old 5th April 2021, 21:42   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
This has been around for many years, see https://stackoverflow.com/questions/...explorer-filee

Part of the secret key is "User Choice" which is perhaps why people are not really spreading this everywhere and using it in installers...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th April 2021, 07:10   #7
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
But in the NSIS of this still no ! And today it is very necessary and relevant.
stass is offline   Reply With Quote
Old Yesterday, 06:36   #8
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
And yet - can anyone make a plugin to associate files in windows 10 ?
stass 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