mirror of
https://github.com/PhoenixPE/PhoenixPE.git
synced 2025-09-16 18:18:04 +02:00
AddShortcut will now detect and remove invalid characters from shortcut names and folders.
This commit is contained in:
@@ -1037,6 +1037,16 @@ GetParam,9,%WindowState%
|
|||||||
GetParam,10,%Hotkey%
|
GetParam,10,%Hotkey%
|
||||||
GetParam,11,%Tooltip%
|
GetParam,11,%Tooltip%
|
||||||
|
|
||||||
|
// Space delimited list of illegal file name characters
|
||||||
|
Set,%IllegalFileNameChars%,"\ / : * ? #$q < > |"
|
||||||
|
// Strip illegal chars from Title
|
||||||
|
ForEach,%Char%,%IllegalFileNameChars%,Delim=#$s,StrFormat,Replace,%Title%,%Char%,"",%Title%
|
||||||
|
|
||||||
|
// Space delimited list of illegal directory name characters (\ is allowed here as we use it to signify a subdir)
|
||||||
|
Set,%IllegalDirNameChars%,"/ : * ? #$q < > |"
|
||||||
|
// Strip illegal chars from Folder
|
||||||
|
ForEach,%Char%,%IllegalDirNameChars%,Delim=#$s,StrFormat,Replace,%Folder%,%Char%,"",%Folder%
|
||||||
|
|
||||||
If,%_PhoenixAPI_ConfigMode%,Equal,PECMD,Begin
|
If,%_PhoenixAPI_ConfigMode%,Equal,PECMD,Begin
|
||||||
|
|
||||||
If,%Folder%,Equal,".",Set,%Folder%,""
|
If,%Folder%,Equal,".",Set,%Folder%,""
|
||||||
@@ -1072,7 +1082,6 @@ If,%_PhoenixAPI_ConfigMode%,Equal,PECMD,Begin
|
|||||||
|
|
||||||
// Final LINK command
|
// Final LINK command
|
||||||
TXTReplace,"%TargetSystem32%\pecmd.ini","_END Shortcuts","%Cmd%#$x#$x_END Shortcuts"
|
TXTReplace,"%TargetSystem32%\pecmd.ini","_END Shortcuts","%Cmd%#$x#$x_END Shortcuts"
|
||||||
|
|
||||||
End
|
End
|
||||||
Else,Begin
|
Else,Begin
|
||||||
// Shortcuts.exe
|
// Shortcuts.exe
|
||||||
|
Reference in New Issue
Block a user