diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 6a2a6ea..0945871 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -1,4 +1,4 @@ -name: Build artifacts from main branch with MSBuild +name: MSBuild on: push: diff --git a/README.md b/README.md index ed704db..31545c9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ [![Ceasefire Now](https://badge.techforpalestine.org/default)](https://techforpalestine.org/learn-more) -[![Build artifacts from main branch with MSBuild](../../actions/workflows/msbuild.yml/badge.svg)](../../actions/workflows/msbuild.yml) - -[![Latest nightly build](https://img.shields.io/badge/download%20latest%20nightly%20build-nightly.link-purple)](https://nightly.link/moudey/Shell/workflows/msbuild/main) +[![Build](../../actions/workflows/msbuild.yml/badge.svg)](../../actions/workflows/msbuild.yml) +[![Nightly](https://img.shields.io/badge/download%20latest%20nightly%20build-nightly.link-purple)](https://nightly.link/moudey/Shell/workflows/msbuild/main) # [Shell](https://nilesoft.org) Powerful manager for Windows File Explorer context menu. @@ -13,16 +12,12 @@ Powerful manager for Windows File Explorer context menu.

-This repository is used to [report issues](https://nilesoft.org/forum/issues).
-You're also welcome to join [the Nilesoft forum](https://nilesoft.org/forum) for a discussion. - ## Details

Shell is a context menu extender that lets you handpick the items to integrate into the Windows File Explorer context menu, create custom commands to access all your favorite web pages, files, and folders, and launch any application directly from the context menu.
It also provides you a convenient solution to modify or remove any context menu item added by the system or third-party software.

- Features ------------------ * Lightweight, portable, and relatively easy to use. @@ -55,7 +50,6 @@ Download Download the latest version: https://nilesoft.org/download - Screenshots ------------------

@@ -76,6 +70,3 @@ If you really love Shell and would like to see it continue to improve. [![Paypal](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.me/nilesoft) [![BuyMeACoffee](https://img.shields.io/badge/Donate-BuyMeACoffee-yellow.svg)](https://www.buymeacoffee.com/moudey) -Sponsors ------------------- -[RubicBG](https://github.com/RubicBG), [hiranokite](https://github.com/hiranokite), [SteffanDonal](https://github.com/SteffanDonal), Ousseynou SANKHARE diff --git a/config/de/imports/develop.nss b/config/de/imports/develop.nss deleted file mode 100644 index 360bb07..0000000 --- a/config/de/imports/develop.nss +++ /dev/null @@ -1,36 +0,0 @@ -menu(mode="multiple" title='&Entwickler' vis=key.shift() sep=sep.bottom image=\uE26E) -{ - menu(mode="single" title='Editoren' image=\uE17A) - { - item(title='Visual Studio Code' image=[\uE272, #22A7F2] cmd='code' args='"@sel.path"') - separator - item(type='file' mode="single" title='Windows Notepad' image cmd='@sys.bin\notepad.exe' args='"@sel.path"') - } - - menu(mode="multiple" title='dotnet' image=\uE143) - { - item(title='Ausführen' cmd-line='/K dotnet run' image=\uE149) - item(title='Dateiüberwachung' cmd-line='/K dotnet watch') - item(title='Bereinigen' image=\uE0CE cmd-line='/K dotnet clean') - separator - item(title='Debug erstellen' cmd-line='/K dotnet build') - item(title='Release erstellen' cmd-line='/K dotnet build -c release /p:DebugType=None') - - menu(mode="multiple" sep="both" title='Veröffentlichen' image=\ue11f) - { - $publish='dotnet publish -r win-x64 -c release --output publish /*/p:CopyOutputSymbolsToPublishDirectory=false*/' - item(title='Einzelne Datei veröffentlichen' sep="after" cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') - item(title='Veröffentlichen' cmd-line='/K @publish') - item(title='Veröffentlichen ohne .NET-Runtime' cmd-line='/K @publish --self-contained false') - item(title='Veröffentlichen mit .NET-Runtime' cmd-line='/K @publish --self-contained true') - item(title='Einzelne Datei' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=false') - item(title='Einzelne Datei kürzen' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=true') - } - - item(title='ef migrations add InitialCreate' cmd-line='/K dotnet ef migrations add InitialCreate') - item(title='ef database update' cmd-line='/K dotnet ef database update') - separator - item(title='Hilfe' image=\uE136 cmd-line='/k dotnet -h') - item(title='Version' cmd-line='/k dotnet --info') - } -} diff --git a/config/de/imports/file-manage.nss b/config/de/imports/file-manage.nss deleted file mode 100644 index c6aa843..0000000 --- a/config/de/imports/file-manage.nss +++ /dev/null @@ -1,80 +0,0 @@ -menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title='Datei bearbeiten' image=\uE253) -{ - menu(separator="after" title=title.copy_path image=icon.copy_path) - { - item(where=sel.count > 1 title='Ausgewählte (@sel.count) Elemente kopieren' cmd=command.copy(sel(false, "\n"))) - item(mode="single" title=@sel.path tip=sel.path cmd=command.copy(sel.path)) - item(mode="single" type='file' separator="before" find='.lnk' title='Dateipfad öffnen') - separator - item(mode="single" where=@sel.parent.len>3 title=sel.parent cmd=@command.copy(sel.parent)) - separator - item(mode="single" type='file|dir|back.dir' title=sel.file.name cmd=command.copy(sel.file.name)) - item(mode="single" type='file' where=sel.file.len != sel.file.title.len title=@sel.file.title cmd=command.copy(sel.file.title)) - item(mode="single" type='file' where=sel.file.ext.len>0 title=sel.file.ext cmd=command.copy(sel.file.ext)) - } - - item(mode="single" type="file" title="Erweiterung bearbeiten" image=\uE0B5 cmd=if(input("Erweiterung bearbeiten", "Erweiterung eingeben"), - io.rename(sel.path, path.join(sel.dir, sel.file.title + "." + input.result)))) - - menu(separator="after" image=\uE290 title=title.select) - { - item(title="Alle" image=icon.select_all cmd=command.select_all) - item(title="Invertieren" image=icon.invert_selection cmd=command.invert_selection) - item(title="Keine" image=icon.select_none cmd=command.select_none) - } - - item(type='file|dir|back.dir|drive' title='Eigentümer werden' image=[\uE194,#f00] admin - cmd args='/K takeown /f "@sel.path" @if(sel.type==1,null,"/r /d y") && icacls "@sel.path" /grant *S-1-5-32-544:F @if(sel.type==1,"/c /l","/t /c /l /q")') - separator - menu(title="Anzeigen" image=icon.show_hidden_files) - { - item(title="Systemdateien" image=inherit cmd='@command.togglehidden') - item(title="Dateinamenerweiterung" image=icon.show_file_extensions cmd='@command.toggleext') - } - - menu(type='file|dir|back.dir' mode="single" title='Eigenschaften' image=icon.properties) - { - $atrr = io.attributes(sel.path) - item(title='Unsichtbar' checked=io.attribute.hidden(atrr) - cmd args='/c ATTRIB @if(io.attribute.hidden(atrr),"-","+")H "@sel.path"' window=hidden) - - item(title='System' checked=io.attribute.system(atrr) - cmd args='/c ATTRIB @if(io.attribute.system(atrr),"-","+")S "@sel.path"' window=hidden) - - item(title='Schreibgeschützt' checked=io.attribute.readonly(atrr) - cmd args='/c ATTRIB @if(io.attribute.readonly(atrr),"-","+")R "@sel.path"' window=hidden) - - item(title='Archiv' checked=io.attribute.archive(atrr) - cmd args='/c ATTRIB @if(io.attribute.archive(atrr),"-","+")A "@sel.path"' window=hidden) - separator - item(title="Erstellt" keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1) vis=label) - item(title="Geändert" keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1) vis=label) - item(title="Zugriff" keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1) vis=label) - } - - menu(mode="single" type='file' find='.dll|.ocx' separator="before" title='Registrierung' image=\uea86) - { - item(title='Registrieren' admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") - item(title='Deregistrieren' admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") - } - - menu(mode="single" type='back' expanded=true) - { - menu(separator="before" title='Neuer Ordner' image=icon.new_folder) - { - item(title='Datum' cmd=io.dir.create(sys.datetime("ymdHMSs"))) - item(title='Guid' cmd=io.dir.create(str.guid)) - } - - menu(title='Neue Datei' image=icon.new_file) - { - $dt = sys.datetime("ymdHMSs") - item(title='TXT' cmd=io.file.create('@(dt).txt', 'Hello World!')) - item(title='XML' cmd=io.file.create('@(dt).xml', 'Hello World!')) - item(title='JSON' cmd=io.file.create('@(dt).json', '[]')) - item(title='HTML' cmd=io.file.create('@(dt).html', "\n\t\n\t\n\tHello World!\n\t\n")) - } - } - - item(where=!wnd.is_desktop title=title.folder_options image=icon.folder_options cmd=command.folder_options) -} \ No newline at end of file diff --git a/config/de/imports/goto.nss b/config/de/imports/goto.nss deleted file mode 100644 index 5e306c6..0000000 --- a/config/de/imports/goto.nss +++ /dev/null @@ -1,61 +0,0 @@ -menu(type='*' where=window.is_taskbar||sel.count mode=mode.multiple title=title.go_to sep=sep.both image=\uE14A) -{ - menu(title='Ordner' image=\uE1F4) - { - item(title='Windows' image=inherit cmd=sys.dir) - item(title='System' image=inherit cmd=sys.bin) - item(title='Programme' image=inherit cmd=sys.prog) - item(title='Programme x86' image=inherit cmd=sys.prog32) - item(title='ProgramData' image=inherit cmd=sys.programdata) - item(title='Applikationen' image=inherit cmd='shell:appsfolder') - item(title='Benutzer' image=inherit cmd=sys.users) - separator - //item(title='@user.name@@@sys.name' vis=label) - item(title='Desktop' image=inherit cmd=user.desktop) - item(title='Downloads' image=inherit cmd=user.downloads) - item(title='Bilder' image=inherit cmd=user.pictures) - item(title='Dokumente' image=inherit cmd=user.documents) - item(title='Startmenu' image=inherit cmd=user.startmenu) - item(title='Profile' image=inherit cmd=user.dir) - item(title='AppData' image=inherit cmd=user.appdata) - item(title='Temp' image=inherit cmd=user.temp) - } - item(title=title.control_panel image=\uE0F3 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}') - item(title='Alle Systemsteuerungen' image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') - item(title=title.run image=\uE14B cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}') - menu(where=sys.ver.major >= 10 title=title.settings sep=sep.before image=\uE0F3) - { - // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app - item(title='System' image=inherit cmd='ms-settings:') - item(title='Über' image=inherit cmd='ms-settings:about') - item(title='Ihre Infos' image=inherit cmd='ms-settings:yourinfo') - item(title='Systeminformationen' image=inherit cmd-line='/K systeminfo') - item(title='Suche' cmd='search-ms:' image=inherit) - item(title='USB' image=inherit cmd='ms-settings:usb') - item(title='Windows Updates' image=inherit cmd='ms-settings:windowsupdate') - item(title='Windows Sicherheit' image=inherit cmd='ms-settings:windowsdefender') - menu(title='Apps' image=inherit) - { - item(title='Installierete Apps' image=inherit cmd='ms-settings:appsfeatures') - item(title='Standard-Apps' image=inherit cmd='ms-settings:defaultapps') - item(title='Optionale Features' image=inherit cmd='ms-settings:optionalfeatures') - item(title='Autostart' image=inherit cmd='ms-settings:startupapps') - } - menu(title='Personalisierung' image=inherit) - { - item(title='Personalisierung' image=inherit cmd='ms-settings:personalization') - item(title='Sperrbildschirm' image=inherit cmd='ms-settings:lockscreen') - item(title='Hintergrund' image=inherit cmd='ms-settings:personalization-background') - item(title='Farben' image=inherit cmd='ms-settings:colors') - item(title='Designs' image=inherit cmd='ms-settings:themes') - item(title='Start' image=inherit cmd='ms-settings:personalization-start') - item(title='Taskleiste' image=inherit cmd='ms-settings:taskbar') - } - menu(title='Netzwerk' image=inherit) - { - item(title='Status' image=inherit cmd='ms-settings:network-status') - item(title='Ethernet' image=inherit cmd='ms-settings:network-ethernet') - item(title='Verbindungen' image=inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}') - } - } -} \ No newline at end of file diff --git a/config/de/imports/images.nss b/config/de/imports/images.nss deleted file mode 100644 index 70854b0..0000000 --- a/config/de/imports/images.nss +++ /dev/null @@ -1,682 +0,0 @@ -$color3 = @if(theme.islight,image.color3,'none') -$color_islight_WB = @if(theme.islight,'#fff','#000') -$clipPath='' -$svg_window_template2='' -$svg_window_template='' - -@copy,copy_to_clipboard=' - - - - -' - -@cut=' - - - - - - @clipPath -' - -@paste=' - - - - - -' - -@paste_shortcut=' - - - - - -' - -@move_to, move_here=' - - - - - -' - -@copy_as_path, copy_path=' - - - - - -' - -@settings, options, folder_options, taskbar_settings=' - - - - - @clipPath -' - -@task_manager=' - - -' - -@run_as_administrator=' - - - - - - @clipPath -' - -@run_as_different_user=' - - - -' - -@personalize=' - - - - - - - @clipPath -' - -@display_settings=' - - - -' - -// pin -@pin, pin_to_start, pin_to_taskbar, pin_to_quick_access, pin_current_folder_to_quick_access, pin_to_start_menu=' - - - -' - -// unpin -@unpin, unpin_from_start, unpin_from_taskbar, unpin_from_quick_access, remove_from_quick_access, remove_from_recent, unpin_from_start_menu=' - - - - - - - - - @clipPath -' - -@add_to_favorites=' - - -' - -@remove_from_favorites=' - - - - - - - - @clipPath -' - -@delete, permanently_delete, empty_recycle_bin=' - - - -' - -@sort_by=' - - - - - - - @clipPath -' - -@group_by=' - - -' - -@view=' - - - - - - - - -' - -@view2=' - - -' - -@align_icons_to_grid=' - - - -' - -@auto_arrange_icons=' - - -' - -@close, cancel=' - -' - -@expand=' - - - -' - -@expand_all, expand_group, expand_all_groups=' - - - - - - - @clipPath -' - -@collapse=' - - - -' - -@collapse_all, collapse_group, collapse_all_groups=' - - - - - - - @clipPath -' - -@format=' - - - - - - - - - - - -' - -@eject=' - - - - - @clipPath -' - -@content=' - - - - - - -' - -@details=' - -' - -@extra_large_icons=' - - -' - -@large_icons=' - - -' - -@list=' - -' - -@medium_icons=' - - -' - -@small_icons=' - - - - - - - - -' - -@tiles=' - - - - -' -@install=' - -' - -@select_all, 'Выбрать все'=' - - - -' - -@invert_selection=' - - - - -' - -@select_none=' - - -' - -@share, share_with=' - - - -' - -@mount=' - - - - - - - - - @clipPath -' - -@new, new_item=' - - - -' - -@new_folder=' - - - - -' - -@new_file=' - - -' - -@open_folder,open_folder_location, open_file_location, open_as_portable=' - - -' - -@open_new_window, open_in_new_window, open_in_new_process=' - - -' - -@open_new_tab, open_in_new_tab=' - - - -' - -@open_spot_light=' - - -' - -@open_with=' - - - - - - - @clipPath -' - -@run_with_powershell, open_windows_powershell, open_powershell_window_here,windows_powershell,windows_powershell_admin=' - - - -' - -@properties=' - - - - - @clipPath -' - -@restore=' - - - - @clipPath -' - -@undo, undo_copy,undo_delete, undo_rename, undo_new, undo_move=' - - - - - @clipPath -' - -@redo, redo_delete, redo_rename, redo_new, redo_move=' - - - - - @clipPath -' - -@refresh=' - - -' - -@rename=' - - - - -' - -@rotate_left=' - - - -' - -@rotate_right=' - - - -' - -@set_as_desktop_wallpaper, set_as_desktop_background=' - - - - -' - -@next_desktop_background=' - - - - - - -' - -@desktop, show_desktop, show_desktop_icons,show_the_desktop=' - - - - - - - @clipPath -' - -@restore_previous_versions=' - - -' - -@create_shortcut, create_shortcuts_here=' - - - -' - -@turn_on_bitlocker, turn_off_bitlocker=' - - - - - - - - @clipPath -' - -@show_file_extensions=' - - - - -' - -@show_hidden_files=' - - - -' - -@compressed=' - - - -' - -@more_options=' - - - -' - -@burn_disc_image=' - - - - -' - -@cleanup=' - - - - - - - - @clipPath -' - -@move_to, move_here,move_to_folder, extract_all, extract_to=' - - - - - -' - -@copy_to,copy_to_folder,copy_here=' - - - - -' - -@pc,this_pc=' - - - - -' - -@command_prompt,command_prompt_admin,open_command_prompt,open_command_window_here=' - @svg_window_template - -' - -@manage=' - - -' - -@edit=' - -' - -@troubleshoot_compatibility=' - @svg_window_template2 - - -' - -@customize_this_folder=' - -' - -@give_access_to=' - - -' - -@send_to=' - -' - -@include_in_library=' - -' - -@add_a_network_location=' - - - - - -' - -@disconnect_network_drive=' - - - - - - - - - @clipPath -' - -@map_network_drive=' - - - - - - -' - -@make_available_offline=' - - - - - -' - -@make_available_online=' - - -' - -@file_explorer=' - - -' - -@file_explorer_options=' - - -' - -@print=' - -' - -@device_manager=' - - -' - -@disk_management=' - - -' - -@filter=' - -' - -@window =' - @svg_window_template -' - -@code=' - - - -' - -@reddit=' - -' - -@cortana,show_cortana_button=' - - -' - -@nvidia=' - - -' \ No newline at end of file diff --git a/config/de/imports/taskbar.nss b/config/de/imports/taskbar.nss deleted file mode 100644 index 4e912d7..0000000 --- a/config/de/imports/taskbar.nss +++ /dev/null @@ -1,33 +0,0 @@ -menu(type="taskbar" vis=key.shift() or key.lbutton() pos=0 title=app.name image=\uE249) -{ - item(title="Konfiguration" image=\uE10A cmd='"@app.cfg"') - item(title="Manager" image=\uE0F3 admin cmd='"@app.exe"') - item(title="Ordner" image=\uE0E8 cmd='"@app.dir"') - item(title="Version\t"+@app.ver vis=label col=1) - item(title="Docs" image=\uE1C4 cmd='https://nilesoft.org/docs') - item(title="Spenden" image=\uE1A7 cmd='https://nilesoft.org/donate') -} -menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) -{ - menu(title="Apps" image=\uE254) - { - item(title='Paint' image=\uE116 cmd='mspaint') - item(title='Edge' image cmd='@sys.prog32\Microsoft\Edge\Application\msedge.exe') - item(title='Rechner' image=\ue1e7 cmd='calc.exe') - item(title=str.res('regedit.exe,-16') image cmd='regedit.exe') - } - menu(title=title.windows image=\uE1FB) - { - item(title=title.cascade_windows cmd=command.cascade_windows) - item(title=title.Show_windows_stacked cmd=command.Show_windows_stacked) - item(title=title.Show_windows_side_by_side cmd=command.Show_windows_side_by_side) - sep - item(title=title.minimize_all_windows cmd=command.minimize_all_windows) - item(title=title.restore_all_windows cmd=command.restore_all_windows) - } - item(title=title.desktop image=icon.desktop cmd=command.toggle_desktop) - item(title=title.settings image=icon.settings(auto, image.color1) cmd='ms-settings:') - item(title=title.task_manager sep=both image=icon.task_manager cmd='taskmgr.exe') - item(title=title.taskbar_Settings sep=both image=inherit cmd='ms-settings:taskbar') - item(vis=key.shift() title=title.exit_explorer cmd=command.restart_explorer) -} \ No newline at end of file diff --git a/config/de/imports/terminal.nss b/config/de/imports/terminal.nss deleted file mode 100644 index 956abf5..0000000 --- a/config/de/imports/terminal.nss +++ /dev/null @@ -1,9 +0,0 @@ -menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep='top' image=icon.run_with_powershell) -{ - $tip_run_admin=["\xE1A7 Halte SHIFT um " + this.title + " als Administrator auszuführen", tip.warning, 1.0] - $has_admin=key.shift() or key.rbutton() - - item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE Command Prompt &ver& PUSHD "@sel.dir"') - item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd='powershell.exe' args='-noexit -command Set-Location -Path "@sel.dir\."') - item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd='wt.exe' arg='-d "@sel.path\."') -} \ No newline at end of file diff --git a/config/de/shell.nss b/config/de/shell.nss deleted file mode 100644 index d7ec077..0000000 --- a/config/de/shell.nss +++ /dev/null @@ -1,28 +0,0 @@ -settings -{ - priority=1 - exclude.where = !process.is_explorer - showdelay = 200 - // Options to allow modification of system items - modify.remove.duplicate=1 - tip.enabled=true -} - -import 'imports/theme.nss' -import 'imports/images.nss' - -import 'imports/modify.nss' - -menu(mode="multiple" title="Pin/Unpin" image=icon.pin) -{ -} - -menu(mode="multiple" title=title.more_options image=icon.more_options) -{ -} - -import 'imports/terminal.nss' -import 'imports/file-manage.nss' -import 'imports/develop.nss' -import 'imports/goto.nss' -import 'imports/taskbar.nss' diff --git a/config/en/imports/modify.nss b/config/en/imports/modify.nss deleted file mode 100644 index a8976b5..0000000 --- a/config/en/imports/modify.nss +++ /dev/null @@ -1,34 +0,0 @@ -// modify items -// Remove items by identifiers -modify(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - -modify(type="recyclebin" where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - -modify(find="unpin*" pos="bottom" menu="Pin/Unpin") -modify(find="pin*" pos="top" menu="Pin/Unpin") - -modify(where=this.id==id.copy_as_path menu="file manage") -modify(type="dir.back|drive.back" where=this.id==id.customize_this_folder pos=1 sep="top" menu="file manage") - -modify(where=str.equals(this.name, ["open in terminal", "open linux shell here"]) || this.id==id.open_powershell_window_here - pos="bottom" menu="Terminal") - -modify(mode=mode.multiple - where=this.id( - id.send_to, - id.share, - id.create_shortcut, - id.set_as_desktop_background, - id.rotate_left, - id.rotate_right, - id.map_network_drive, - id.disconnect_network_drive, - id.format, - id.eject, - id.give_access_to, - id.include_in_library, - id.print - ) - pos=1 menu=title.more_options) diff --git a/config/en/imports/terminal.nss b/config/en/imports/terminal.nss deleted file mode 100644 index b7c2623..0000000 --- a/config/en/imports/terminal.nss +++ /dev/null @@ -1,9 +0,0 @@ -menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep='top' image=icon.run_with_powershell) -{ - $tip_run_admin=["\xE1A7 Press SHIFT key to run " + this.title + " as administrator", tip.warning, 1.0] - $has_admin=key.shift() or key.rbutton() - - item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE Command Prompt &ver& PUSHD "@sel.dir"') - item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd='powershell.exe' args='-noexit -command Set-Location -Path "@sel.dir\."') - item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd='wt.exe' arg='-d "@sel.path\."') -} \ No newline at end of file diff --git a/config/en/imports/theme.nss b/config/en/imports/theme.nss deleted file mode 100644 index acb675b..0000000 --- a/config/en/imports/theme.nss +++ /dev/null @@ -1,12 +0,0 @@ -theme -{ - name="modern" - dark=auto - background - { - color=auto - opacity=auto - effect=auto - } - image.align=2 -} \ No newline at end of file diff --git a/config/ko/imports/develop.nss b/config/ko/imports/develop.nss deleted file mode 100644 index 3d99431..0000000 --- a/config/ko/imports/develop.nss +++ /dev/null @@ -1,36 +0,0 @@ -menu(mode="multiple" title='개발(&D)' vis=key.shift() sep=sep.bottom image=\uE26E) -{ - menu(mode="single" title='편집기' image=\uE17A) - { - item(title='Visual Studio Code' image=[\uE272, #22A7F2] cmd='code' args='"@sel.path"') - separator - item(type='file' mode="single" title='Windows 메모장' image cmd='@sys.bin\notepad.exe' args='"@sel.path"') - } - - menu(mode="multiple" title='닷넷' image=\uE143) - { - item(title='실행' cmd-line='/K dotnet run' image=\uE149) - item(title='감시' cmd-line='/K dotnet watch') - item(title='지우기' image=\uE0CE cmd-line='/K dotnet clean') - separator - item(title='빌드 디버그' cmd-line='/K dotnet build') - item(title='빌드 릴리즈' cmd-line='/K dotnet build -c release /p:DebugType=None') - - menu(mode="multiple" sep=sep.both title='publish' image=\ue11f) - { - $publish='dotnet publish -r win-x64 -c release --output publish /*/p:CopyOutputSymbolsToPublishDirectory=false*/' - item(title='단일 파일 게시' sep=sep.bottom cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') - item(title='프레임워크 종속 배포' cmd-line='/K @publish') - item(title='프레임워크 종속 실행 파일' cmd-line='/K @publish --self-contained false') - item(title='독립형 배포' cmd-line='/K @publish --self-contained true') - item(title='단일 파일' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=false') - item(title='단일 파일 트리밍' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=true') - } - - item(title='ef migrations add InitialCreate' cmd-line='/K dotnet ef migrations add InitialCreate') - item(title='ef database update' cmd-line='/K dotnet ef database update') - separator - item(title='도움말' image=\uE136 cmd-line='/k dotnet -h') - item(title='버전' cmd-line='/k dotnet --info') - } -} diff --git a/config/ko/imports/file-manage.nss b/config/ko/imports/file-manage.nss deleted file mode 100644 index d69e006..0000000 --- a/config/ko/imports/file-manage.nss +++ /dev/null @@ -1,80 +0,0 @@ -menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title='파일 관리' image=\uE253) -{ - menu(separator="after" title=title.copy_path image=icon.copy_path) - { - item(where=sel.count > 1 title='선택한 항목 복사(@sel.count)' cmd=command.copy(sel(false, "\n"))) - item(mode="single" title=@sel.path tip=sel.path cmd=command.copy(sel.path)) - item(mode="single" type='file' separator="before" find='.lnk' title='파일 위치 열기') - separator - item(mode="single" where=@sel.parent.len>3 title=sel.parent cmd=@command.copy(sel.parent)) - separator - item(mode="single" type='file|dir|back.dir' title=sel.file.name cmd=command.copy(sel.file.name)) - item(mode="single" type='file' where=sel.file.len != sel.file.title.len title=@sel.file.title cmd=command.copy(sel.file.title)) - item(mode="single" type='file' where=sel.file.ext.len>0 title=sel.file.ext cmd=command.copy(sel.file.ext)) - } - - item(mode="single" type="file" title="확장자 변경" image=\uE0B5 cmd=if(input("Change extension", "Type extension"), - io.rename(sel.path, path.join(sel.dir, sel.file.title + "." + input.result)))) - - menu(separator="after" image=\uE290 title=title.select) - { - item(title="모두" image=icon.select_all cmd=command.select_all) - item(title="반전" image=icon.invert_selection cmd=command.invert_selection) - item(title="없음" image=icon.select_none cmd=command.select_none) - } - - item(type='file|dir|back.dir|drive' title='소유권 획득' image=[\uE194,#f00] admin - cmd args='/K takeown /f "@sel.path" @if(sel.type==1,null,"/r /d y") && icacls "@sel.path" /grant *S-1-5-32-544:F @if(sel.type==1,"/c /l","/t /c /l /q")') - separator - menu(title="표시/숨김" image=icon.show_hidden_files) - { - item(title="시스템 파일" image=inherit cmd='@command.togglehidden') - item(title="파일 이름 확장자" image=icon.show_file_extensions cmd='@command.toggleext') - } - - menu(type='file|dir|back.dir' mode="single" title='속성') - { - $atrr = io.attributes(sel.path) - item(title='숨김' checked=io.attribute.hidden(atrr) - cmd args='/c ATTRIB @if(io.attribute.hidden(atrr),"-","+")H "@sel.path"' window=hidden) - - item(title='시스템' checked=io.attribute.system(atrr) - cmd args='/c ATTRIB @if(io.attribute.system(atrr),"-","+")S "@sel.path"' window=hidden) - - item(title='읽기 전용' checked=io.attribute.readonly(atrr) - cmd args='/c ATTRIB @if(io.attribute.readonly(atrr),"-","+")R "@sel.path"' window=hidden) - - item(title='보관 가능' checked=io.attribute.archive(atrr) - cmd args='/c ATTRIB @if(io.attribute.archive(atrr),"-","+")A "@sel.path"' window=hidden) - separator - item(title="만든 날짜" keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1)) - item(title="수정 날짜" keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1)) - item(title="접근 날짜" keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1)) - } - - menu(mode="single" type='file' find='.dll|.ocx' separator="before" title='서버 등록' image=\uea86) - { - item(title='등록' admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") - item(title='등록 해제' admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") - } - - menu(mode="single" type='back' expanded=true) - { - menu(separator="before" title='새 폴더' image=icon.new_folder) - { - item(title='날짜 시간' cmd=io.dir.create(sys.datetime("ymdHMSs"))) - item(title='Guid' cmd=io.dir.create(str.guid)) - } - - menu(title='새 파일' image=icon.new_file) - { - $dt = sys.datetime("ymdHMSs") - item(title='TXT' cmd=io.file.create('@(dt).txt', 'Hello World!')) - item(title='XML' cmd=io.file.create('@(dt).xml', 'Hello World!')) - item(title='JSON' cmd=io.file.create('@(dt).json', '[]')) - item(title='HTML' cmd=io.file.create('@(dt).html', "\n\t\n\t\n\tHello World!\n\t\n")) - } - } - - item(where=!wnd.is_desktop title=title.folder_options image=icon.folder_options cmd=command.folder_options) -} diff --git a/config/ko/imports/goto.nss b/config/ko/imports/goto.nss deleted file mode 100644 index a8d9f33..0000000 --- a/config/ko/imports/goto.nss +++ /dev/null @@ -1,61 +0,0 @@ -menu(type='*' where=window.is_taskbar||sel.count mode=mode.multiple title=title.go_to sep=sep.both image=\uE14A) -{ - menu(title='폴더' image=\uE1F4) - { - item(title='Windows' image=inherit cmd=sys.dir) - item(title='System' image=inherit cmd=sys.bin) - item(title='Program Files' image=inherit cmd=sys.prog) - item(title='Program Files x86' image=inherit cmd=sys.prog32) - item(title='ProgramData' image=inherit cmd=sys.programdata) - item(title='Applications' image=inherit cmd='shell:appsfolder') - item(title='Users' image=inherit cmd=sys.users) - separator - //item(title='@user.name@@@sys.name' vis=label) - item(title='바탕 화면' image=inherit cmd=user.desktop) - item(title='다운로드' image=inherit cmd=user.downloads) - item(title='사진' image=inherit cmd=user.pictures) - item(title='문서' image=inherit cmd=user.documents) - item(title='시작 메뉴' image=inherit cmd=user.startmenu) - item(title='프로필' image=inherit cmd=user.dir) - item(title='AppData' image=inherit cmd=user.appdata) - item(title='Temp' image=inherit cmd=user.temp) - } - item(title=title.control_panel image=\uE0F3 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}') - item(title='모든 제어판 항목' image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') - item(title=title.run image=\uE14B cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}') - menu(where=sys.ver.major >= 10 title=title.settings sep=sep.before image=\uE0F3) - { - // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app - item(title='시스템' image=inherit cmd='ms-settings:') - item(title='정보' image=inherit cmd='ms-settings:about') - item(title='내 정보' image=inherit cmd='ms-settings:yourinfo') - item(title='시스템 정보' image=inherit cmd-line='/K systeminfo') - item(title='검색' cmd='search-ms:' image=inherit) - item(title='usb' image=inherit cmd='ms-settings:usb') - item(title='windows 업데이트' image=inherit cmd='ms-settings:windowsupdate') - item(title='windows-defender' image=inherit cmd='ms-settings:windowsdefender') - menu(title='앱' image=inherit) - { - item(title='앱 기능' image=inherit cmd='ms-settings:appsfeatures') - item(title='기본 앱' image=inherit cmd='ms-settings:defaultapps') - item(title='선택 기능' image=inherit cmd='ms-settings:optionalfeatures') - item(title='시작' image=inherit cmd='ms-settings:startup') - } - menu(title='개인 설정' image=inherit) - { - item(title='개인 설정' image=inherit cmd='ms-settings:personalization') - item(title='잠금 화면' image=inherit cmd='ms-settings:lockscreen') - item(title='배경' image=inherit cmd='ms-settings:personalization-background') - item(title='색상' image=inherit cmd='ms-settings:colors') - item(title='테마' image=inherit cmd='ms-settings:themes') - item(title='시작' image=inherit cmd='ms-settings:personalization-start') - item(title='작업 표시줄' image=inherit cmd='ms-settings:taskbar') - } - menu(title='네트워크' image=inherit) - { - item(title='상태' image=inherit cmd='ms-settings:network-status') - item(title='이더넷' image=inherit cmd='ms-settings:network-ethernet') - item(title='연결' image=inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}') - } - } -} \ No newline at end of file diff --git a/config/ko/imports/images.nss b/config/ko/imports/images.nss deleted file mode 100644 index a3b36ba..0000000 --- a/config/ko/imports/images.nss +++ /dev/null @@ -1,682 +0,0 @@ -$color3 = @if(theme.islight,image.color3,'none') -$color_islight_WB = @if(theme.islight,'#fff','#000') -$clipPath='' -$svg_window_template2='' -$svg_window_template='' - -@copy,copy_to_clipboard=' - - - - -' - -@cut=' - - - - - - @clipPath -' - -@paste=' - - - - - -' - -@paste_shortcut=' - - - - - -' - -@move_to, move_here=' - - - - - -' - -@copy_as_path, copy_path=' - - - - - -' - -@settings, options, folder_options, taskbar_settings=' - - - - - @clipPath -' - -@task_manager=' - - -' - -@run_as_administrator=' - - - - - - @clipPath -' - -@run_as_different_user=' - - - -' - -@personalize=' - - - - - - - @clipPath -' - -@display_settings=' - - - -' - -// pin -@pin, pin_to_start, pin_to_taskbar, pin_to_quick_access, pin_current_folder_to_quick_access, pin_to_start_menu=' - - - -' - -// unpin -@unpin, unpin_from_start, unpin_from_taskbar, unpin_from_quick_access, remove_from_quick_access, remove_from_recent, unpin_from_start_menu=' - - - - - - - - - @clipPath -' - -@add_to_favorites=' - - -' - -@remove_from_favorites=' - - - - - - - - @clipPath -' - -@delete, permanently_delete, empty_recycle_bin=' - - - -' - -@sort_by=' - - - - - - - @clipPath -' - -@group_by=' - - -' - -@view=' - - - - - - - - -' - -@view2=' - - -' - -@align_icons_to_grid=' - - - -' - -@auto_arrange_icons=' - - -' - -@close, cancel=' - -' - -@expand=' - - - -' - -@expand_all, expand_group, expand_all_groups=' - - - - - - - @clipPath -' - -@collapse=' - - - -' - -@collapse_all, collapse_group, collapse_all_groups=' - - - - - - - @clipPath -' - -@format=' - - - - - - - - - - - -' - -@eject=' - - - - - @clipPath -' - -@content=' - - - - - - -' - -@details=' - -' - -@extra_large_icons=' - - -' - -@large_icons=' - - -' - -@list=' - -' - -@medium_icons=' - - -' - -@small_icons=' - - - - - - - - -' - -@tiles=' - - - - -' -@install=' - -' - -@select_all, 'Выбрать все'=' - - - -' - -@invert_selection=' - - - - -' - -@select_none=' - - -' - -@share, share_with=' - - - -' - -@mount=' - - - - - - - - - @clipPath -' - -@new, new_item=' - - - -' - -@new_folder=' - - - - -' - -@new_file=' - - -' - -@open_folder,open_folder_location, open_file_location, open_as_portable=' - - -' - -@open_new_window, open_in_new_window, open_in_new_process=' - - -' - -@open_new_tab, open_in_new_tab=' - - - -' - -@open_spot_light=' - - -' - -@open_with=' - - - - - - - @clipPath -' - -@run_with_powershell, open_windows_powershell, open_powershell_window_here,windows_powershell,windows_powershell_admin=' - - - -' - -@properties=' - - - - - @clipPath -' - -@restore=' - - - - @clipPath -' - -@undo, undo_copy,undo_delete, undo_rename, undo_new, undo_move=' - - - - - @clipPath -' - -@redo, redo_delete, redo_rename, redo_new, redo_move=' - - - - - @clipPath -' - -@refresh=' - - -' - -@rename=' - - - - -' - -@rotate_left=' - - - -' - -@rotate_right=' - - - -' - -@set_as_desktop_wallpaper, set_as_desktop_background=' - - - - -' - -@next_desktop_background=' - - - - - - -' - -@desktop, show_desktop, show_desktop_icons,show_the_desktop=' - - - - - - - @clipPath -' - -@restore_previous_versions=' - - -' - -@create_shortcut, create_shortcuts_here=' - - - -' - -@turn_on_bitlocker, turn_off_bitlocker=' - - - - - - - - @clipPath -' - -@show_file_extensions=' - - - - -' - -@show_hidden_files=' - - - -' - -@compressed=' - - - -' - -@more_options=' - - - -' - -@burn_disc_image=' - - - - -' - -@cleanup=' - - - - - - - - @clipPath -' - -@move_to, move_here,move_to_folder, extract_all, extract_to=' - - - - - -' - -@copy_to,copy_to_folder,copy_here=' - - - - -' - -@pc,this_pc=' - - - - -' - -@command_prompt,command_prompt_admin,open_command_prompt,open_command_window_here=' - @svg_window_template - -' - -@manage=' - - -' - -@edit=' - -' - -@troubleshoot_compatibility=' - @svg_window_template2 - - -' - -@customize_this_folder=' - -' - -@give_access_to=' - - -' - -@send_to=' - -' - -@include_in_library=' - -' - -@add_a_network_location=' - - - - - -' - -@disconnect_network_drive=' - - - - - - - - - @clipPath -' - -@map_network_drive=' - - - - - - -' - -@make_available_offline=' - - - - - -' - -@make_available_online=' - - -' - -@file_explorer=' - - -' - -@file_explorer_options=' - - -' - -@print=' - -' - -@device_manager=' - - -' - -@disk_management=' - - -' - -@filter=' - -' - -@window =' - @svg_window_template -' - -@code=' - - - -' - -@reddit=' - -' - -@cortana,show_cortana_button=' - - -' - -@nvidia=' - - -' \ No newline at end of file diff --git a/config/ko/imports/modify.nss b/config/ko/imports/modify.nss deleted file mode 100644 index c27720b..0000000 --- a/config/ko/imports/modify.nss +++ /dev/null @@ -1,34 +0,0 @@ -// modify items -// Remove items by identifiers -modify(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - -modify(type="recyclebin" where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - -modify(find="unpin*" pos="bottom" menu="고정/고정 해제") -modify(find="pin*" pos="top" menu="고정/고정 해제") - -modify(where=this.id==id.copy_as_path menu="파일 관리") -modify(type="dir.back|drive.back" where=this.id==id.customize_this_folder pos=1 sep="top" menu="파일 관리") - -modify(where=str.equals(this.name, ["터미널에서 열기", "여기서 리눅스 셸 열기"]) || this.id==id.open_powershell_window_here - pos="bottom" menu="터미널") - -modify(mode=mode.multiple - where=this.id( - id.send_to, - id.share, - id.create_shortcut, - id.set_as_desktop_background, - id.rotate_left, - id.rotate_right, - id.map_network_drive, - id.disconnect_network_drive, - id.format, - id.eject, - id.give_access_to, - id.include_in_library, - id.print - ) - pos=1 menu=title.more_options) diff --git a/config/ko/imports/static.nss b/config/ko/imports/static.nss deleted file mode 100644 index 8f91fb8..0000000 --- a/config/ko/imports/static.nss +++ /dev/null @@ -1,25 +0,0 @@ -shell -{ - // static items - - // Delete items by identifiers - item(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - - item(type='recyclebin' where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - item(type='back' find=['shortcut', '/new'] vis=vis.remove) - item(find='unpin' pos=pos.bottom menu="Pin//Unpin") - item(find='pin' pos=pos.top menu="Pin//Unpin") - item(where=this.id==id.copy_as_path menu='file manage') - item(type='dir.back|drive.back' where=this.id==id.customize_this_folder pos=1 sep='top' menu='file manage') - item(find='open in terminal*' pos=pos.bottom sep menu='Terminal') - item(find='open with visual studio' pos=1 menu='develop/editors') - //Move and organize - //item(mode=mode.multiple find='scan with' menu=title.more_options) - item(mode=mode.multiple - where=this.id(id.send_to,id.share,id.create_shortcut,id.set_as_desktop_background,id.rotate_left, - id.rotate_right, id.map_network_drive,id.disconnect_network_drive,id.format, id.eject, - id.give_access_to,id.include_in_library,id.print) - pos=1 menu=title.more_options) -} \ No newline at end of file diff --git a/config/ko/imports/taskbar.nss b/config/ko/imports/taskbar.nss deleted file mode 100644 index 5746444..0000000 --- a/config/ko/imports/taskbar.nss +++ /dev/null @@ -1,33 +0,0 @@ -menu(type="taskbar" vis=key.shift() or key.lbutton() pos=0 title=app.name image=\uE249) -{ - item(title="구성" image=\uE10A cmd='"@app.cfg"') - item(title="관리" image=\uE0F3 admin cmd='"@app.exe"') - item(title="디렉터리" image=\uE0E8 cmd='"@app.dir"') - item(title="버전\t"+@app.ver vis=label col=1) - item(title="문서" image=\uE1C4 cmd='https://nilesoft.org/docs') - item(title="기부하기" image=\uE1A7 cmd='https://nilesoft.org/donate') -} -menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) -{ - menu(title="앱" image=\uE254) - { - item(title='그림판' image=\uE116 cmd='mspaint') - item(title='Edge' image cmd='@sys.prog32\Microsoft\Edge\Application\msedge.exe') - item(title='계산기' image=\ue1e7 cmd='calc.exe') - item(title=str.res('regedit.exe,-16') image cmd='regedit.exe') - } - menu(title=title.windows image=\uE1FB) - { - item(title=title.cascade_windows cmd=command.cascade_windows) - item(title=title.Show_windows_stacked cmd=command.Show_windows_stacked) - item(title=title.Show_windows_side_by_side cmd=command.Show_windows_side_by_side) - sep - item(title=title.minimize_all_windows cmd=command.minimize_all_windows) - item(title=title.restore_all_windows cmd=command.restore_all_windows) - } - item(title=title.desktop image=icon.desktop cmd=command.toggle_desktop) - item(title=title.settings image=icon.settings(auto, image.color1) cmd='ms-settings:') - item(title=title.task_manager sep=both image=icon.task_manager cmd='taskmgr.exe') - item(title=title.taskbar_Settings sep=both image=inherit cmd='ms-settings:taskbar') - item(vis=key.shift() title=title.exit_explorer cmd=command.restart_explorer) -} diff --git a/config/ko/imports/theme.nss b/config/ko/imports/theme.nss deleted file mode 100644 index b5168f4..0000000 --- a/config/ko/imports/theme.nss +++ /dev/null @@ -1,12 +0,0 @@ -theme -{ - name="modern" - dark=auto - background - { - color=auto - opacity=auto - effect=auto - } - image.align=2 -} \ No newline at end of file diff --git a/config/ko/shell.nss b/config/ko/shell.nss deleted file mode 100644 index d7ec077..0000000 --- a/config/ko/shell.nss +++ /dev/null @@ -1,28 +0,0 @@ -settings -{ - priority=1 - exclude.where = !process.is_explorer - showdelay = 200 - // Options to allow modification of system items - modify.remove.duplicate=1 - tip.enabled=true -} - -import 'imports/theme.nss' -import 'imports/images.nss' - -import 'imports/modify.nss' - -menu(mode="multiple" title="Pin/Unpin" image=icon.pin) -{ -} - -menu(mode="multiple" title=title.more_options image=icon.more_options) -{ -} - -import 'imports/terminal.nss' -import 'imports/file-manage.nss' -import 'imports/develop.nss' -import 'imports/goto.nss' -import 'imports/taskbar.nss' diff --git a/config/pt-br/imports/develop.nss b/config/pt-br/imports/develop.nss deleted file mode 100644 index d3453d7..0000000 --- a/config/pt-br/imports/develop.nss +++ /dev/null @@ -1,36 +0,0 @@ -menu(mode="multiple" title='&Desenvolvedor' vis=key.shift() sep=sep.bottom image=\uE26E) -{ - menu(mode="single" title='Editores' image=\uE17A) - { - item(title='Visual Studio Code' image=[\uE272, #22A7F2] cmd='code' args='"@sel.path"') - separator - item(type='file' mode="single" title='Bloco de Notas' image cmd='@sys.bin\notepad.exe' args='"@sel.path"') - } - - menu(mode="multiple" title='.Net' image=\uE143) - { - item(title='Executar' cmd-line='/K dotnet run' image=\uE149) - item(title='Visualizar' cmd-line='/K dotnet watch') - item(title='Limpar' image=\uE0CE cmd-line='/K dotnet clean') - separator - item(title='Depuração da compilação' cmd-line='/K dotnet build') - item(title='Versão da compilação' cmd-line='/K dotnet build -c release /p:DebugType=None') - - menu(mode="multiple" sep="both" title='Publicar' image=\ue11f) - { - $publish='dotnet publish -r win-x64 -c release --output publish /*/p:CopyOutputSymbolsToPublishDirectory=false*/' - item(title='Publicar arquivo único' sep="after" cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') - item(title='Implantação dependente da estrutura' cmd-line='/K @publish') - item(title='Executável dependente da estrutura' cmd-line='/K @publish --self-contained false') - item(title='Implantação independente' cmd-line='/K @publish --self-contained true') - item(title='Arquivo único' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=false') - item(title='Aparado em arquivo único' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=true') - } - - item(title='Migrações .Net EF adicionam InitialCreate' cmd-line='/K dotnet ef migrations add InitialCreate') - item(title='Atualização do banco de dados .Net EF' cmd-line='/K dotnet ef database update') - separator - item(title='Ajuda .Net' image=\uE136 cmd-line='/k dotnet -h') - item(title='Versão .Net' cmd-line='/k dotnet --info') - } -} diff --git a/config/pt-br/imports/file-manage.nss b/config/pt-br/imports/file-manage.nss deleted file mode 100644 index 4dba70e..0000000 --- a/config/pt-br/imports/file-manage.nss +++ /dev/null @@ -1,80 +0,0 @@ -menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title='Explorador de Arquivos' image=\uE253) -{ - menu(separator="after" title=title.copy_path image=icon.copy_path) - { - item(where=sel.count > 1 title='Copiar (@sel.count) items selected' cmd=command.copy(sel(false, "\n"))) - item(mode="single" title=@sel.path tip=sel.path cmd=command.copy(sel.path)) - item(mode="single" type='file' separator="before" find='.lnk' title='Abrir local do arquivo') - separator - item(mode="single" where=@sel.parent.len>3 title=sel.parent cmd=@command.copy(sel.parent)) - separator - item(mode="single" type='file|dir|back.dir' title=sel.file.name cmd=command.copy(sel.file.name)) - item(mode="single" type='file' where=sel.file.len != sel.file.title.len title=@sel.file.title cmd=command.copy(sel.file.title)) - item(mode="single" type='file' where=sel.file.ext.len>0 title=sel.file.ext cmd=command.copy(sel.file.ext)) - } - - item(mode="single" type="file" title="Alterar extensão" image=\uE0B5 cmd=if(input("Alterar extensão", "Tipo de extensão"), - io.rename(sel.path, path.join(sel.dir, sel.file.title + "." + input.result)))) - - menu(separator="after" image=\uE290 title=title.select) - { - item(title="Todos" image=icon.select_all cmd=command.select_all) - item(title="Invertido" image=icon.invert_selection cmd=command.invert_selection) - item(title="Nenhum" image=icon.select_none cmd=command.select_none) - } - - item(type='file|dir|back.dir|drive' title='Tornar-se proprietário' image=[\uE194,#f00] admin - cmd args='/K takeown /f "@sel.path" @if(sel.type==1,null,"/r /d y") && icacls "@sel.path" /grant *S-1-5-32-544:F @if(sel.type==1,"/c /l","/t /c /l /q")') - separator - menu(title="Mostrar/Ocultar" image=icon.show_hidden_files) - { - item(title="Arquivos de sistema" image=inherit cmd='@command.togglehidden') - item(title="Extensões de arquivos" image=icon.show_file_extensions cmd='@command.toggleext') - } - - menu(type='file|dir|back.dir' mode="single" title='Atributos' image=icon.properties) - { - $atrr = io.attributes(sel.path) - item(title='Oculto' checked=io.attribute.hidden(atrr) - cmd args='/c ATTRIB @if(io.attribute.hidden(atrr),"-","+")H "@sel.path"' window=hidden) - - item(title='Sistema' checked=io.attribute.system(atrr) - cmd args='/c ATTRIB @if(io.attribute.system(atrr),"-","+")S "@sel.path"' window=hidden) - - item(title='Somente leitura' checked=io.attribute.readonly(atrr) - cmd args='/c ATTRIB @if(io.attribute.readonly(atrr),"-","+")R "@sel.path"' window=hidden) - - item(title='Arquivar' checked=io.attribute.archive(atrr) - cmd args='/c ATTRIB @if(io.attribute.archive(atrr),"-","+")A "@sel.path"' window=hidden) - separator - item(title="Criado" keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1) vis=label) - item(title="Modificado" keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1) vis=label) - item(title="Acessado" keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1) vis=label) - } - - menu(mode="single" type='file' find='.dll|.ocx' separator="before" title='Servidor de Registro' image=\uea86) - { - item(title='Registrar' admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") - item(title='Remover Registro' admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") - } - - menu(mode="single" type='back' expanded=true) - { - menu(separator="before" title='Nova Pasta' image=icon.new_folder) - { - item(title='Data Hora' cmd=io.dir.create(sys.datetime("dmyHMSs"))) - item(title='Guid' cmd=io.dir.create(str.guid)) - } - - menu(title='Novo Arquivo' image=icon.new_file) - { - $dt = sys.datetime("ymdHMSs") - item(title='TXT' cmd=io.file.create('@(dt).txt', 'Olá Mundo!')) - item(title='XML' cmd=io.file.create('@(dt).xml', 'Olá Mundo!')) - item(title='JSON' cmd=io.file.create('@(dt).json', '[]')) - item(title='HTML' cmd=io.file.create('@(dt).html', "\n\t\n\t\n\tOlá Mundo!\n\t\n")) - } - } - - item(where=!wnd.is_desktop title=title.folder_options image=icon.folder_options cmd=command.folder_options) -} \ No newline at end of file diff --git a/config/pt-br/imports/goto.nss b/config/pt-br/imports/goto.nss deleted file mode 100644 index 284d85f..0000000 --- a/config/pt-br/imports/goto.nss +++ /dev/null @@ -1,61 +0,0 @@ -menu(type='*' where=window.is_taskbar||sel.count mode=mode.multiple title=title.go_to sep=sep.both image=\uE14A) -{ - menu(title='Pasta' image=\uE1F4) - { - item(title='Windows' image=inherit cmd=sys.dir) - item(title='System32' image=inherit cmd=sys.bin) - item(title='Arquivos de Programas' image=inherit cmd=sys.prog) - item(title='Arquivos de Programas x86' image=inherit cmd=sys.prog32) - item(title='ProgramData' image=inherit cmd=sys.programdata) - item(title='Aplicativos' image=inherit cmd='shell:appsfolder') - item(title='Usuários' image=inherit cmd=sys.users) - separator - //item(title='@user.name@@@sys.name' vis=label) - item(title='Área de Trabalho' image=inherit cmd=user.desktop) - item(title='Downloads' image=inherit cmd=user.downloads) - item(title='Imagens' image=inherit cmd=user.pictures) - item(title='Documentos' image=inherit cmd=user.documents) - item(title='Menu Iniciar' image=inherit cmd=user.startmenu) - item(title='Perfil' image=inherit cmd=user.dir) - item(title='AppData' image=inherit cmd=user.appdata) - item(title='Temp' image=inherit cmd=user.temp) - } - item(title=title.control_panel image=\uE0F3 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}') - item(title='Todas as Tarefas' image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') - item(title=title.run image=\uE14B cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}') - menu(where=sys.ver.major >= 10 title=title.settings sep=sep.before image=\uE0F3) - { - // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app - item(title='Sistema' image=inherit cmd='ms-settings:') - item(title='Sobre' image=inherit cmd='ms-settings:about') - item(title='Suas informações' image=inherit cmd='ms-settings:yourinfo') - item(title='Informações do sistema' image=inherit cmd-line='/K systeminfo') - item(title='Pesquisa' cmd='search-ms:' image=inherit) - item(title='USB' image=inherit cmd='ms-settings:usb') - item(title='Windows Update' image=inherit cmd='ms-settings:windowsupdate') - item(title='Segurança do Windows' image=inherit cmd='ms-settings:windowsdefender') - menu(title='Aplicativos' image=inherit) - { - item(title='Aplicativos instalados' image=inherit cmd='ms-settings:appsfeatures') - item(title='Aplicativos padrão' image=inherit cmd='ms-settings:defaultapps') - item(title='Recursos opcionais' image=inherit cmd='ms-settings:optionalfeatures') - item(title='Inicialização' image=inherit cmd='ms-settings:startupapps') - } - menu(title='Personalização' image=inherit) - { - item(title='Personalização' image=inherit cmd='ms-settings:personalization') - item(title='Tela de bloqueio' image=inherit cmd='ms-settings:lockscreen') - item(title='Tela de fundo' image=inherit cmd='ms-settings:personalization-background') - item(title='Cores' image=inherit cmd='ms-settings:colors') - item(title='Temas' image=inherit cmd='ms-settings:themes') - item(title='Iniciar' image=inherit cmd='ms-settings:personalization-start') - item(title='Barra de Tarefas' image=inherit cmd='ms-settings:taskbar') - } - menu(title='Rede e Internet' image=inherit) - { - item(title='Status' image=inherit cmd='ms-settings:network-status') - item(title='Ethernet' image=inherit cmd='ms-settings:network-ethernet') - item(title='Conexões de Rede' image=inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}') - } - } -} \ No newline at end of file diff --git a/config/pt-br/imports/images.nss b/config/pt-br/imports/images.nss deleted file mode 100644 index 70854b0..0000000 --- a/config/pt-br/imports/images.nss +++ /dev/null @@ -1,682 +0,0 @@ -$color3 = @if(theme.islight,image.color3,'none') -$color_islight_WB = @if(theme.islight,'#fff','#000') -$clipPath='' -$svg_window_template2='' -$svg_window_template='' - -@copy,copy_to_clipboard=' - - - - -' - -@cut=' - - - - - - @clipPath -' - -@paste=' - - - - - -' - -@paste_shortcut=' - - - - - -' - -@move_to, move_here=' - - - - - -' - -@copy_as_path, copy_path=' - - - - - -' - -@settings, options, folder_options, taskbar_settings=' - - - - - @clipPath -' - -@task_manager=' - - -' - -@run_as_administrator=' - - - - - - @clipPath -' - -@run_as_different_user=' - - - -' - -@personalize=' - - - - - - - @clipPath -' - -@display_settings=' - - - -' - -// pin -@pin, pin_to_start, pin_to_taskbar, pin_to_quick_access, pin_current_folder_to_quick_access, pin_to_start_menu=' - - - -' - -// unpin -@unpin, unpin_from_start, unpin_from_taskbar, unpin_from_quick_access, remove_from_quick_access, remove_from_recent, unpin_from_start_menu=' - - - - - - - - - @clipPath -' - -@add_to_favorites=' - - -' - -@remove_from_favorites=' - - - - - - - - @clipPath -' - -@delete, permanently_delete, empty_recycle_bin=' - - - -' - -@sort_by=' - - - - - - - @clipPath -' - -@group_by=' - - -' - -@view=' - - - - - - - - -' - -@view2=' - - -' - -@align_icons_to_grid=' - - - -' - -@auto_arrange_icons=' - - -' - -@close, cancel=' - -' - -@expand=' - - - -' - -@expand_all, expand_group, expand_all_groups=' - - - - - - - @clipPath -' - -@collapse=' - - - -' - -@collapse_all, collapse_group, collapse_all_groups=' - - - - - - - @clipPath -' - -@format=' - - - - - - - - - - - -' - -@eject=' - - - - - @clipPath -' - -@content=' - - - - - - -' - -@details=' - -' - -@extra_large_icons=' - - -' - -@large_icons=' - - -' - -@list=' - -' - -@medium_icons=' - - -' - -@small_icons=' - - - - - - - - -' - -@tiles=' - - - - -' -@install=' - -' - -@select_all, 'Выбрать все'=' - - - -' - -@invert_selection=' - - - - -' - -@select_none=' - - -' - -@share, share_with=' - - - -' - -@mount=' - - - - - - - - - @clipPath -' - -@new, new_item=' - - - -' - -@new_folder=' - - - - -' - -@new_file=' - - -' - -@open_folder,open_folder_location, open_file_location, open_as_portable=' - - -' - -@open_new_window, open_in_new_window, open_in_new_process=' - - -' - -@open_new_tab, open_in_new_tab=' - - - -' - -@open_spot_light=' - - -' - -@open_with=' - - - - - - - @clipPath -' - -@run_with_powershell, open_windows_powershell, open_powershell_window_here,windows_powershell,windows_powershell_admin=' - - - -' - -@properties=' - - - - - @clipPath -' - -@restore=' - - - - @clipPath -' - -@undo, undo_copy,undo_delete, undo_rename, undo_new, undo_move=' - - - - - @clipPath -' - -@redo, redo_delete, redo_rename, redo_new, redo_move=' - - - - - @clipPath -' - -@refresh=' - - -' - -@rename=' - - - - -' - -@rotate_left=' - - - -' - -@rotate_right=' - - - -' - -@set_as_desktop_wallpaper, set_as_desktop_background=' - - - - -' - -@next_desktop_background=' - - - - - - -' - -@desktop, show_desktop, show_desktop_icons,show_the_desktop=' - - - - - - - @clipPath -' - -@restore_previous_versions=' - - -' - -@create_shortcut, create_shortcuts_here=' - - - -' - -@turn_on_bitlocker, turn_off_bitlocker=' - - - - - - - - @clipPath -' - -@show_file_extensions=' - - - - -' - -@show_hidden_files=' - - - -' - -@compressed=' - - - -' - -@more_options=' - - - -' - -@burn_disc_image=' - - - - -' - -@cleanup=' - - - - - - - - @clipPath -' - -@move_to, move_here,move_to_folder, extract_all, extract_to=' - - - - - -' - -@copy_to,copy_to_folder,copy_here=' - - - - -' - -@pc,this_pc=' - - - - -' - -@command_prompt,command_prompt_admin,open_command_prompt,open_command_window_here=' - @svg_window_template - -' - -@manage=' - - -' - -@edit=' - -' - -@troubleshoot_compatibility=' - @svg_window_template2 - - -' - -@customize_this_folder=' - -' - -@give_access_to=' - - -' - -@send_to=' - -' - -@include_in_library=' - -' - -@add_a_network_location=' - - - - - -' - -@disconnect_network_drive=' - - - - - - - - - @clipPath -' - -@map_network_drive=' - - - - - - -' - -@make_available_offline=' - - - - - -' - -@make_available_online=' - - -' - -@file_explorer=' - - -' - -@file_explorer_options=' - - -' - -@print=' - -' - -@device_manager=' - - -' - -@disk_management=' - - -' - -@filter=' - -' - -@window =' - @svg_window_template -' - -@code=' - - - -' - -@reddit=' - -' - -@cortana,show_cortana_button=' - - -' - -@nvidia=' - - -' \ No newline at end of file diff --git a/config/pt-br/imports/modify.nss b/config/pt-br/imports/modify.nss deleted file mode 100644 index a8976b5..0000000 --- a/config/pt-br/imports/modify.nss +++ /dev/null @@ -1,34 +0,0 @@ -// modify items -// Remove items by identifiers -modify(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - -modify(type="recyclebin" where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - -modify(find="unpin*" pos="bottom" menu="Pin/Unpin") -modify(find="pin*" pos="top" menu="Pin/Unpin") - -modify(where=this.id==id.copy_as_path menu="file manage") -modify(type="dir.back|drive.back" where=this.id==id.customize_this_folder pos=1 sep="top" menu="file manage") - -modify(where=str.equals(this.name, ["open in terminal", "open linux shell here"]) || this.id==id.open_powershell_window_here - pos="bottom" menu="Terminal") - -modify(mode=mode.multiple - where=this.id( - id.send_to, - id.share, - id.create_shortcut, - id.set_as_desktop_background, - id.rotate_left, - id.rotate_right, - id.map_network_drive, - id.disconnect_network_drive, - id.format, - id.eject, - id.give_access_to, - id.include_in_library, - id.print - ) - pos=1 menu=title.more_options) diff --git a/config/pt-br/imports/taskbar.nss b/config/pt-br/imports/taskbar.nss deleted file mode 100644 index 5f14ab0..0000000 --- a/config/pt-br/imports/taskbar.nss +++ /dev/null @@ -1,33 +0,0 @@ -menu(type="taskbar" vis=key.shift() or key.lbutton() pos=0 title=app.name image=\uE249) -{ - item(title="config" image=\uE10A cmd='"@app.cfg"') - item(title="manager" image=\uE0F3 admin cmd='"@app.exe"') - item(title="directory" image=\uE0E8 cmd='"@app.dir"') - item(title="version\t"+@app.ver vis=label col=1) - item(title="docs" image=\uE1C4 cmd='https://nilesoft.org/docs') - item(title="donate" image=\uE1A7 cmd='https://nilesoft.org/donate') -} -menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) -{ - menu(title="Apps" image=\uE254) - { - item(title='Paint' image=\uE116 cmd='mspaint') - item(title='Edge' image cmd='@sys.prog32\Microsoft\Edge\Application\msedge.exe') - item(title='Calculator' image=\ue1e7 cmd='calc.exe') - item(title=str.res('regedit.exe,-16') image cmd='regedit.exe') - } - menu(title=title.windows image=\uE1FB) - { - item(title=title.cascade_windows cmd=command.cascade_windows) - item(title=title.Show_windows_stacked cmd=command.Show_windows_stacked) - item(title=title.Show_windows_side_by_side cmd=command.Show_windows_side_by_side) - sep - item(title=title.minimize_all_windows cmd=command.minimize_all_windows) - item(title=title.restore_all_windows cmd=command.restore_all_windows) - } - item(title=title.desktop image=icon.desktop cmd=command.toggle_desktop) - item(title=title.settings image=icon.settings(auto, image.color1) cmd='ms-settings:') - item(title=title.task_manager sep=both image=icon.task_manager cmd='taskmgr.exe') - item(title=title.taskbar_Settings sep=both image=inherit cmd='ms-settings:taskbar') - item(vis=key.shift() title=title.exit_explorer cmd=command.restart_explorer) -} \ No newline at end of file diff --git a/config/pt-br/imports/terminal.nss b/config/pt-br/imports/terminal.nss deleted file mode 100644 index 391e1d2..0000000 --- a/config/pt-br/imports/terminal.nss +++ /dev/null @@ -1,9 +0,0 @@ -menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep='top' image=icon.run_with_powershell) -{ - $tip_run_admin=["\xE1A7 Pressione SHIFT para executar " + this.title + " como administrador", tip.warning, 1.0] - $has_admin=key.shift() or key.rbutton() - - item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE Prompt de Comando &ver& PUSHD "@sel.dir"') - item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd='powershell.exe' args='-noexit -command Set-Location -Path "@sel.dir\."') - item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd='wt.exe' arg='-d "@sel.path\."') -} \ No newline at end of file diff --git a/config/pt-br/imports/theme.nss b/config/pt-br/imports/theme.nss deleted file mode 100644 index acb675b..0000000 --- a/config/pt-br/imports/theme.nss +++ /dev/null @@ -1,12 +0,0 @@ -theme -{ - name="modern" - dark=auto - background - { - color=auto - opacity=auto - effect=auto - } - image.align=2 -} \ No newline at end of file diff --git a/config/pt-br/shell.nss b/config/pt-br/shell.nss deleted file mode 100644 index 937aa2e..0000000 --- a/config/pt-br/shell.nss +++ /dev/null @@ -1,28 +0,0 @@ -settings -{ - priority=1 - exclude.where = !process.is_explorer - showdelay = 200 - // Options to allow modification of system items - modify.remove.duplicate=1 - tip.enabled=true -} - -import 'imports/theme.nss' -import 'imports/images.nss' - -import 'imports/modify.nss' - -menu(mode="multiple" title="Fixar/Desafixar" image=icon.pin) -{ -} - -menu(mode="multiple" title=title.more_options image=icon.more_options) -{ -} - -import 'imports/terminal.nss' -import 'imports/file-manage.nss' -import 'imports/develop.nss' -import 'imports/goto.nss' -import 'imports/taskbar.nss' diff --git a/config/zh/imports/develop.nss b/config/zh/imports/develop.nss deleted file mode 100644 index f04d5de..0000000 --- a/config/zh/imports/develop.nss +++ /dev/null @@ -1,36 +0,0 @@ -menu(mode="multiple" title='&开发人员菜单' vis=key.shift() sep=sep.bottom image=\uE26E) -{ - menu(mode="single" title='编辑器' image=\uE17A) - { - item(title='Visual Studio Code' image=[\uE272, #22A7F2] cmd='code' args='"@sel.path"') - separator - item(type='file' mode="single" title='Windows notepad' image cmd='@sys.bin\notepad.exe' args='"@sel.path"') - } - - menu(mode="multiple" title='.NET' image=\uE143) - { - item(title='run' cmd-line='/K dotnet run' image=\uE149) - item(title='watch' cmd-line='/K dotnet watch') - item(title='clean' image=\uE0CE cmd-line='/K dotnet clean') - separator - item(title='build debug' cmd-line='/K dotnet build') - item(title='build release' cmd-line='/K dotnet build -c release /p:DebugType=None') - - menu(mode="multiple" sep="both" title='publish' image=\ue11f) - { - $publish='dotnet publish -r win-x64 -c release --output publish /*/p:CopyOutputSymbolsToPublishDirectory=false*/' - item(title='publish single file' sep="after" cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') - item(title='framework-dependent deployment' cmd-line='/K @publish') - item(title='framework-dependent executable' cmd-line='/K @publish --self-contained false') - item(title='self-contained deployment' cmd-line='/K @publish --self-contained true') - item(title='single-file' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=false') - item(title='single-file-trimmed' cmd-line='/K @publish /p:PublishSingleFile=true /p:PublishTrimmed=true') - } - - item(title='ef migrations add InitialCreate' cmd-line='/K dotnet ef migrations add InitialCreate') - item(title='ef database update' cmd-line='/K dotnet ef database update') - separator - item(title='help' image=\uE136 cmd-line='/k dotnet -h') - item(title='version' cmd-line='/k dotnet --info') - } -} diff --git a/config/zh/imports/file-manage.nss b/config/zh/imports/file-manage.nss deleted file mode 100644 index cdcbf37..0000000 --- a/config/zh/imports/file-manage.nss +++ /dev/null @@ -1,80 +0,0 @@ -menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title='文件资源管理器' image=\uE253) -{ - menu(separator="after" title=title.copy_path image=icon.copy_path) - { - item(where=sel.count > 1 title='复制已选的 @sel.count 个文件' cmd=command.copy(sel(false, "\n"))) - item(mode="single" title=@sel.path tip=sel.path cmd=command.copy(sel.path)) - item(mode="single" type='file' separator="before" find='.lnk' title='打开文件所在路径') - separator - item(mode="single" where=@sel.parent.len>3 title=sel.parent cmd=@command.copy(sel.parent)) - separator - item(mode="single" type='file|dir|back.dir' title=sel.file.name cmd=command.copy(sel.file.name)) - item(mode="single" type='file' where=sel.file.len != sel.file.title.len title=@sel.file.title cmd=command.copy(sel.file.title)) - item(mode="single" type='file' where=sel.file.ext.len>0 title=sel.file.ext cmd=command.copy(sel.file.ext)) - } - - item(mode="single" type="file" title="修改扩展名" image=\uE0B5 cmd=if(input("修改扩展名", "请输入新扩展名"), - io.rename(sel.path, path.join(sel.dir, sel.file.title + "." + input.result)))) - - menu(separator="after" image=\uE290 title=title.select) - { - item(title="全选" image=icon.select_all cmd=command.select_all) - item(title="反选" image=icon.invert_selection cmd=command.invert_selection) - item(title="取消" image=icon.select_none cmd=command.select_none) - } - - item(type='file|dir|back.dir|drive' title='取得所有权' image=[\uE194,#f00] admin - cmd args='/K takeown /f "@sel.path" @if(sel.type==1,null,"/r /d y") && icacls "@sel.path" /grant *S-1-5-32-544:F @if(sel.type==1,"/c /l","/t /c /l /q")') - separator - menu(title="显示/隐藏" image=icon.show_hidden_files) - { - item(title="系统文件" image=inherit cmd='@command.togglehidden') - item(title="文件扩展名" image=icon.show_file_extensions cmd='@command.toggleext') - } - - menu(type='file|dir|back.dir' mode="single" title='属性' image=icon.properties) - { - $atrr = io.attributes(sel.path) - item(title='隐藏' checked=io.attribute.hidden(atrr) - cmd args='/c ATTRIB @if(io.attribute.hidden(atrr),"-","+")H "@sel.path"' window=hidden) - - item(title='系统文件' checked=io.attribute.system(atrr) - cmd args='/c ATTRIB @if(io.attribute.system(atrr),"-","+")S "@sel.path"' window=hidden) - - item(title='只读' checked=io.attribute.readonly(atrr) - cmd args='/c ATTRIB @if(io.attribute.readonly(atrr),"-","+")R "@sel.path"' window=hidden) - - item(title='存档' checked=io.attribute.archive(atrr) - cmd args='/c ATTRIB @if(io.attribute.archive(atrr),"-","+")A "@sel.path"' window=hidden) - separator - item(title="创建日期" keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1) vis=label) - item(title="修改日期" keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1) vis=label) - item(title="上次访问日期" keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1) vis=label) - } - - menu(mode="single" type='file' find='.dll|.ocx' separator="before" title='注册到系统' image=\uea86) - { - item(title='注册' admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") - item(title='注销' admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") - } - - menu(mode="single" type='back' expanded=true) - { - menu(separator="before" title='新建文件夹' image=icon.new_folder) - { - item(title='当前日期' cmd=io.dir.create(sys.datetime("ymdHMSs"))) - item(title='GUID' cmd=io.dir.create(str.guid)) - } - - menu(title='新建文件' image=icon.new_file) - { - $dt = sys.datetime("ymdHMSs") - item(title='TXT' cmd=io.file.create('@(dt).txt', 'Hello World!')) - item(title='XML' cmd=io.file.create('@(dt).xml', 'Hello World!')) - item(title='JSON' cmd=io.file.create('@(dt).json', '[]')) - item(title='HTML' cmd=io.file.create('@(dt).html', "\n\t\n\t\n\tHello World!\n\t\n")) - } - } - - item(where=!wnd.is_desktop title=title.folder_options image=icon.folder_options cmd=command.folder_options) -} \ No newline at end of file diff --git a/config/zh/imports/goto.nss b/config/zh/imports/goto.nss deleted file mode 100644 index 0d3cf70..0000000 --- a/config/zh/imports/goto.nss +++ /dev/null @@ -1,61 +0,0 @@ -menu(type='*' where=window.is_taskbar||sel.count mode=mode.multiple title=title.go_to sep=sep.both image=\uE14A) -{ - menu(title='文件夹' image=\uE1F4) - { - item(title='Windows' image=inherit cmd=sys.dir) - item(title='System32' image=inherit cmd=sys.bin) - item(title='Program Files' image=inherit cmd=sys.prog) - item(title='Program Files (x86)' image=inherit cmd=sys.prog32) - item(title='ProgramData' image=inherit cmd=sys.programdata) - item(title='Applications' image=inherit cmd='shell:appsfolder') - item(title='用户' image=inherit cmd=sys.users) - separator - //item(title='@user.name@@@sys.name' vis=label) - item(title='桌面' image=inherit cmd=user.desktop) - item(title='下载' image=inherit cmd=user.downloads) - item(title='图片' image=inherit cmd=user.pictures) - item(title='文档' image=inherit cmd=user.documents) - item(title='「开始」菜单' image=inherit cmd=user.startmenu) - item(title='主文件夹' image=inherit cmd=user.dir) - item(title='AppData' image=inherit cmd=user.appdata) - item(title='临时文件夹' image=inherit cmd=user.temp) - } - item(title=title.control_panel image=\uE0F3 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}') - item(title='所有任务' image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') - item(title=title.run image=\uE14B cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}') - menu(where=sys.ver.major >= 10 title=title.settings sep=sep.before image=\uE0F3) - { - // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app - item(title='主页' image=inherit cmd='ms-settings:') - item(title='系统信息' image=inherit cmd='ms-settings:about') - item(title='账户信息' image=inherit cmd='ms-settings:yourinfo') - item(title='详细系统信息' image=inherit cmd-line='/K systeminfo') - item(title='搜索' cmd='search-ms:' image=inherit) - item(title='USB' image=inherit cmd='ms-settings:usb') - item(title='Windows 更新' image=inherit cmd='ms-settings:windowsupdate') - item(title='Windows 安全中心' image=inherit cmd='ms-settings:windowsdefender') - menu(title='应用' image=inherit) - { - item(title='安装的应用' image=inherit cmd='ms-settings:appsfeatures') - item(title='默认应用' image=inherit cmd='ms-settings:defaultapps') - item(title='可选功能' image=inherit cmd='ms-settings:optionalfeatures') - item(title='启动' image=inherit cmd='ms-settings:startupapps') - } - menu(title='个性化' image=inherit) - { - item(title='个性化首页' image=inherit cmd='ms-settings:personalization') - item(title='锁屏界面' image=inherit cmd='ms-settings:lockscreen') - item(title='背景' image=inherit cmd='ms-settings:personalization-background') - item(title='颜色' image=inherit cmd='ms-settings:colors') - item(title='主题' image=inherit cmd='ms-settings:themes') - item(title='开始' image=inherit cmd='ms-settings:personalization-start') - item(title='任务栏' image=inherit cmd='ms-settings:taskbar') - } - menu(title='网络' image=inherit) - { - item(title='网络和 Internet' image=inherit cmd='ms-settings:network-status') - item(title='以太网' image=inherit cmd='ms-settings:network-ethernet') - item(title='网络连接' image=inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}') - } - } -} \ No newline at end of file diff --git a/config/zh/imports/images.nss b/config/zh/imports/images.nss deleted file mode 100644 index a48e37d..0000000 --- a/config/zh/imports/images.nss +++ /dev/null @@ -1,682 +0,0 @@ -$color3 = @if(theme.islight,image.color3,'none') -$color_islight_WB = @if(theme.islight,'#fff','#000') -$clipPath='' -$svg_window_template2='' -$svg_window_template='' - -@copy,copy_to_clipboard=' - - - - -' - -@cut=' - - - - - - @clipPath -' - -@paste=' - - - - - -' - -@paste_shortcut=' - - - - - -' - -@move_to, move_here=' - - - - - -' - -@copy_as_path, copy_path=' - - - - - -' - -@settings, options, folder_options, taskbar_settings=' - - - - - @clipPath -' - -@task_manager=' - - -' - -@run_as_administrator=' - - - - - - @clipPath -' - -@run_as_different_user, run_as_another_user=' - - - -' - -@personalize=' - - - - - - - @clipPath -' - -@display_settings=' - - - -' - -// pin -@pin, pin_to_start, pin_to_taskbar, pin_to_quick_access, pin_current_folder_to_quick_access, pin_to_start_menu=' - - - -' - -// unpin -@unpin, unpin_from_start, unpin_from_taskbar, unpin_from_quick_access, remove_from_quick_access, remove_from_recent, unpin_from_start_menu=' - - - - - - - - - @clipPath -' - -@add_to_favorites=' - - -' - -@remove_from_favorites=' - - - - - - - - @clipPath -' - -@delete, permanently_delete, empty_recycle_bin=' - - - -' - -@sort_by=' - - - - - - - @clipPath -' - -@group_by=' - - -' - -@view=' - - - - - - - - -' - -@view2=' - - -' - -@align_icons_to_grid=' - - - -' - -@auto_arrange_icons=' - - -' - -@close, cancel=' - -' - -@expand=' - - - -' - -@expand_all, expand_group, expand_all_groups=' - - - - - - - @clipPath -' - -@collapse=' - - - -' - -@collapse_all, collapse_group, collapse_all_groups=' - - - - - - - @clipPath -' - -@format=' - - - - - - - - - - - -' - -@eject=' - - - - - @clipPath -' - -@content=' - - - - - - -' - -@details=' - -' - -@extra_large_icons=' - - -' - -@large_icons=' - - -' - -@list=' - -' - -@medium_icons=' - - -' - -@small_icons=' - - - - - - - - -' - -@tiles=' - - - - -' -@install=' - -' - -@select_all, 'Выбрать все'=' - - - -' - -@invert_selection=' - - - - -' - -@select_none=' - - -' - -@share, share_with=' - - - -' - -@mount=' - - - - - - - - - @clipPath -' - -@new, new_item=' - - - -' - -@new_folder=' - - - - -' - -@new_file=' - - -' - -@open_folder,open_folder_location, open_file_location, open_as_portable=' - - -' - -@open_new_window, open_in_new_window, open_in_new_process=' - - -' - -@open_new_tab, open_in_new_tab=' - - - -' - -@open_spot_light=' - - -' - -@open_with=' - - - - - - - @clipPath -' - -@run_with_powershell, open_windows_powershell, open_powershell_window_here,windows_powershell,windows_powershell_admin=' - - - -' - -@properties=' - - - - - @clipPath -' - -@restore=' - - - - @clipPath -' - -@undo, undo_copy, undo_move, undo_delete, undo_rename, undo_new, undo_apply_properties=' - - - - - @clipPath -' - -@redo, redo_copy, redo_move, redo_delete, redo_rename, redo_new, redo_apply_properties=' - - - - - @clipPath -' - -@refresh=' - - -' - -@rename=' - - - - -' - -@rotate_left=' - - - -' - -@rotate_right=' - - - -' - -@set_as_desktop_wallpaper, set_as_desktop_background=' - - - - -' - -@next_desktop_background=' - - - - - - -' - -@desktop, show_desktop, show_desktop_icons,show_the_desktop=' - - - - - - - @clipPath -' - -@restore_previous_versions=' - - -' - -@create_shortcut, create_shortcuts_here=' - - - -' - -@turn_on_bitlocker, turn_off_bitlocker=' - - - - - - - - @clipPath -' - -@show_file_extensions=' - - - - -' - -@show_hidden_files=' - - - -' - -@compressed=' - - - -' - -@more_options=' - - - -' - -@burn_disc_image=' - - - - -' - -@cleanup=' - - - - - - - - @clipPath -' - -@move, move_to, move_here,move_to_folder, extract_all, extract_to=' - - - - - -' - -@copy_to,copy_to_folder,copy_here=' - - - - -' - -@pc,this_pc=' - - - - -' - -@command_prompt,command_prompt_admin,open_command_prompt,open_command_window_here=' - @svg_window_template - -' - -@manage=' - - -' - -@edit=' - -' - -@troubleshoot_compatibility=' - @svg_window_template2 - - -' - -@customize_this_folder=' - -' - -@give_access_to=' - - -' - -@send_to=' - -' - -@include_in_library=' - -' - -@add_a_network_location=' - - - - - -' - -@disconnect_network_drive=' - - - - - - - - - @clipPath -' - -@map_network_drive=' - - - - - - -' - -@make_available_offline=' - - - - - -' - -@make_available_online=' - - -' - -@file_explorer=' - - -' - -@file_explorer_options=' - - -' - -@print=' - -' - -@device_manager=' - - -' - -@disk_management=' - - -' - -@filter=' - -' - -@window =' - @svg_window_template -' - -@code=' - - - -' - -@reddit=' - -' - -@cortana,show_cortana_button=' - - -' - -@nvidia=' - - -' \ No newline at end of file diff --git a/config/zh/imports/modify.nss b/config/zh/imports/modify.nss deleted file mode 100644 index a8976b5..0000000 --- a/config/zh/imports/modify.nss +++ /dev/null @@ -1,34 +0,0 @@ -// modify items -// Remove items by identifiers -modify(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - -modify(type="recyclebin" where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - -modify(find="unpin*" pos="bottom" menu="Pin/Unpin") -modify(find="pin*" pos="top" menu="Pin/Unpin") - -modify(where=this.id==id.copy_as_path menu="file manage") -modify(type="dir.back|drive.back" where=this.id==id.customize_this_folder pos=1 sep="top" menu="file manage") - -modify(where=str.equals(this.name, ["open in terminal", "open linux shell here"]) || this.id==id.open_powershell_window_here - pos="bottom" menu="Terminal") - -modify(mode=mode.multiple - where=this.id( - id.send_to, - id.share, - id.create_shortcut, - id.set_as_desktop_background, - id.rotate_left, - id.rotate_right, - id.map_network_drive, - id.disconnect_network_drive, - id.format, - id.eject, - id.give_access_to, - id.include_in_library, - id.print - ) - pos=1 menu=title.more_options) diff --git a/config/zh/imports/static.nss b/config/zh/imports/static.nss deleted file mode 100644 index 8f91fb8..0000000 --- a/config/zh/imports/static.nss +++ /dev/null @@ -1,25 +0,0 @@ -shell -{ - // static items - - // Delete items by identifiers - item(mode=mode.multiple - where=this.id(id.restore_previous_versions,id.cast_to_device) - vis=vis.remove) - - item(type='recyclebin' where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep) - item(type='back' find=['shortcut', '/new'] vis=vis.remove) - item(find='unpin' pos=pos.bottom menu="Pin//Unpin") - item(find='pin' pos=pos.top menu="Pin//Unpin") - item(where=this.id==id.copy_as_path menu='file manage') - item(type='dir.back|drive.back' where=this.id==id.customize_this_folder pos=1 sep='top' menu='file manage') - item(find='open in terminal*' pos=pos.bottom sep menu='Terminal') - item(find='open with visual studio' pos=1 menu='develop/editors') - //Move and organize - //item(mode=mode.multiple find='scan with' menu=title.more_options) - item(mode=mode.multiple - where=this.id(id.send_to,id.share,id.create_shortcut,id.set_as_desktop_background,id.rotate_left, - id.rotate_right, id.map_network_drive,id.disconnect_network_drive,id.format, id.eject, - id.give_access_to,id.include_in_library,id.print) - pos=1 menu=title.more_options) -} \ No newline at end of file diff --git a/config/zh/imports/taskbar.nss b/config/zh/imports/taskbar.nss deleted file mode 100644 index d83c77a..0000000 --- a/config/zh/imports/taskbar.nss +++ /dev/null @@ -1,33 +0,0 @@ -menu(type="taskbar" vis=key.shift() or key.lbutton() pos=0 title=app.name image=\uE249) -{ - item(title="设置" image=\uE10A cmd='"@app.cfg"') - item(title="管理器" image=\uE0F3 admin cmd='"@app.exe"') - item(title="文件夹" image=\uE0E8 cmd='"@app.dir"') - item(title="版本\t"+@app.ver vis=label col=1) - item(title="文档" image=\uE1C4 cmd='https://nilesoft.org/docs') - item(title="赞赏" image=\uE1A7 cmd='https://nilesoft.org/donate') -} -menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) -{ - menu(title="快捷应用" image=\uE254) - { - item(title='画图' image=\uE116 cmd='mspaint') - item(title='Edge' image cmd='@sys.prog32\Microsoft\Edge\Application\msedge.exe') - item(title='计算器' image=\ue1e7 cmd='calc.exe') - item(title=str.res('regedit.exe,-16') image cmd='regedit.exe') - } - menu(title=title.windows image=\uE1FB) - { - item(title=title.cascade_windows cmd=command.cascade_windows) - item(title=title.Show_windows_stacked cmd=command.Show_windows_stacked) - item(title=title.Show_windows_side_by_side cmd=command.Show_windows_side_by_side) - sep - item(title=title.minimize_all_windows cmd=command.minimize_all_windows) - item(title=title.restore_all_windows cmd=command.restore_all_windows) - } - item(title=title.desktop image=icon.desktop cmd=command.toggle_desktop) - item(title=title.settings image=icon.settings(auto, image.color1) cmd='ms-settings:') - item(title=title.task_manager sep=both image=icon.task_manager cmd='taskmgr.exe') - item(title=title.taskbar_Settings sep=both image=inherit cmd='ms-settings:taskbar') - item(vis=key.shift() title=title.exit_explorer cmd=command.restart_explorer) -} \ No newline at end of file diff --git a/config/zh/imports/terminal.nss b/config/zh/imports/terminal.nss deleted file mode 100644 index b7c2623..0000000 --- a/config/zh/imports/terminal.nss +++ /dev/null @@ -1,9 +0,0 @@ -menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep='top' image=icon.run_with_powershell) -{ - $tip_run_admin=["\xE1A7 Press SHIFT key to run " + this.title + " as administrator", tip.warning, 1.0] - $has_admin=key.shift() or key.rbutton() - - item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd='cmd.exe' args='/K TITLE Command Prompt &ver& PUSHD "@sel.dir"') - item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd='powershell.exe' args='-noexit -command Set-Location -Path "@sel.dir\."') - item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd='wt.exe' arg='-d "@sel.path\."') -} \ No newline at end of file diff --git a/config/zh/imports/theme.nss b/config/zh/imports/theme.nss deleted file mode 100644 index acb675b..0000000 --- a/config/zh/imports/theme.nss +++ /dev/null @@ -1,12 +0,0 @@ -theme -{ - name="modern" - dark=auto - background - { - color=auto - opacity=auto - effect=auto - } - image.align=2 -} \ No newline at end of file diff --git a/config/zh/shell.nss b/config/zh/shell.nss deleted file mode 100644 index d7ec077..0000000 --- a/config/zh/shell.nss +++ /dev/null @@ -1,28 +0,0 @@ -settings -{ - priority=1 - exclude.where = !process.is_explorer - showdelay = 200 - // Options to allow modification of system items - modify.remove.duplicate=1 - tip.enabled=true -} - -import 'imports/theme.nss' -import 'imports/images.nss' - -import 'imports/modify.nss' - -menu(mode="multiple" title="Pin/Unpin" image=icon.pin) -{ -} - -menu(mode="multiple" title=title.more_options image=icon.more_options) -{ -} - -import 'imports/terminal.nss' -import 'imports/file-manage.nss' -import 'imports/develop.nss' -import 'imports/goto.nss' -import 'imports/taskbar.nss' diff --git a/src/Shell.sln b/src/Shell.sln index 4966a1c..7f38231 100644 --- a/src/Shell.sln +++ b/src/Shell.sln @@ -9,40 +9,33 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll\Shell.vcxproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exe", "exe\exe.vcxproj", "{FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "setup-ca", "setup\ca\ca.vcxproj", "{F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - debug|ARM64 = debug|ARM64 - debug|x64 = debug|x64 - debug|x86 = debug|x86 release|ARM64 = release|ARM64 release|x64 = release|x64 release|x86 = release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|ARM64.ActiveCfg = debug|ARM64 - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|ARM64.Build.0 = debug|ARM64 - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|x64.ActiveCfg = debug|x64 - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|x64.Build.0 = debug|x64 - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|x86.ActiveCfg = debug|Win32 - {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.debug|x86.Build.0 = debug|Win32 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|ARM64.ActiveCfg = release|ARM64 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|ARM64.Build.0 = release|ARM64 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|x64.ActiveCfg = release|x64 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|x64.Build.0 = release|x64 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|x86.ActiveCfg = release|Win32 {BAF011AC-D5E9-42C5-BA26-BA6115A45DAC}.release|x86.Build.0 = release|Win32 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|ARM64.ActiveCfg = debug|ARM64 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|ARM64.Build.0 = debug|ARM64 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|x64.ActiveCfg = debug|x64 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|x64.Build.0 = debug|x64 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|x86.ActiveCfg = debug|Win32 - {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.debug|x86.Build.0 = debug|Win32 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|ARM64.ActiveCfg = release|ARM64 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|ARM64.Build.0 = release|ARM64 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|x64.ActiveCfg = release|x64 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|x64.Build.0 = release|x64 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|x86.ActiveCfg = release|Win32 {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98}.release|x86.Build.0 = release|Win32 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|ARM64.ActiveCfg = release|ARM64 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|ARM64.Build.0 = release|ARM64 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|x64.ActiveCfg = release|x64 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|x64.Build.0 = release|x64 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|x86.ActiveCfg = release|Win32 + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981}.release|x86.Build.0 = release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/bin/debug.cmd b/src/bin/debug.cmd index f42398b..3dac5f1 100644 --- a/src/bin/debug.cmd +++ b/src/bin/debug.cmd @@ -20,7 +20,7 @@ set build=%YYYY%%MM%%DD% :: Unregistering the Shell Extension. ::echo Proceeding with the Shell Extension unregistration. echo. -echo Shell version 1.9 build 13 %date% %time% +echo Shell version 1.9 build 18 %date% %time% echo. cd /d %~dp0 diff --git a/config/en/imports/develop.nss b/src/bin/imports/develop.nss similarity index 68% rename from config/en/imports/develop.nss rename to src/bin/imports/develop.nss index db23f9a..bc63402 100644 --- a/config/en/imports/develop.nss +++ b/src/bin/imports/develop.nss @@ -1,10 +1,10 @@ -menu(mode="multiple" title='&Develop' vis=key.shift() sep=sep.bottom image=\uE26E) +menu(mode="multiple" title=loc.develop sep=sep.bottom image=\uE26E) { - menu(mode="single" title='editors' image=\uE17A) + menu(mode="single" title=loc.editors image=\uE17A) { item(title='Visual Studio Code' image=[\uE272, #22A7F2] cmd='code' args='"@sel.path"') separator - item(type='file' mode="single" title='Windows notepad' image cmd='@sys.bin\notepad.exe' args='"@sel.path"') + item(type='file' mode="single" title=loc.windows_notepad image cmd='@sys.bin\notepad.exe' args='"@sel.path"') } menu(mode="multiple" title='dotnet' image=\uE143) @@ -19,7 +19,7 @@ menu(mode="multiple" sep="both" title='publish' image=\ue11f) { $publish='dotnet publish -r win-x64 -c release --output publish /*/p:CopyOutputSymbolsToPublishDirectory=false*/' - item(title='publish single file' sep="after" cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') + item(title='publish sinale file' sep="after" cmd-line='/K @publish --no-self-contained /p:PublishSingleFile=true') item(title='framework-dependent deployment' cmd-line='/K @publish') item(title='framework-dependent executable' cmd-line='/K @publish --self-contained false') item(title='self-contained deployment' cmd-line='/K @publish --self-contained true') @@ -33,4 +33,9 @@ item(title='help' image=\uE136 cmd-line='/k dotnet -h') item(title='version' cmd-line='/k dotnet --info') } -} + + item(type="file" title="reshack" sep="top" image cmd='D:\config\Programs\dev\petools\resource\reshack\reshack.exe' args=sel(1)) + item(type="file" title="peview" image cmd='D:\config\Programs\dev\petools\peview.exe' args=sel(1)) + + item(type="dir|dir.back" title="Web server" vis=key.shift() cmd='D:\config\Programs\dev\web\HTTPServer\WebServer.exe' args='-open -path:"@sel.path"') +} \ No newline at end of file diff --git a/config/en/imports/file-manage.nss b/src/bin/imports/file-manage.nss similarity index 60% rename from config/en/imports/file-manage.nss rename to src/bin/imports/file-manage.nss index 6d4a9df..56abe14 100644 --- a/config/en/imports/file-manage.nss +++ b/src/bin/imports/file-manage.nss @@ -1,4 +1,4 @@ -menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title='File manage' image=\uE253) +menu(where=sel.count>0 type='file|dir|drive|namespace|back' mode="multiple" title=loc.file_manage image=\uE253) { menu(separator="after" title=title.copy_path image=icon.copy_path) { @@ -13,7 +13,7 @@ item(mode="single" type='file' where=sel.file.ext.len>0 title=sel.file.ext cmd=command.copy(sel.file.ext)) } - item(mode="single" type="file" title="Change extension" image=\uE0B5 cmd=if(input("Change extension", "Type extension"), + item(mode="single" type="file" title=loc.change_extension image=\uE0B5 cmd=if(input(loc.change_extension, "Type extension"), io.rename(sel.path, path.join(sel.dir, sel.file.title + "." + input.result)))) menu(separator="after" image=\uE290 title=title.select) @@ -23,50 +23,50 @@ item(title="None" image=icon.select_none cmd=command.select_none) } - item(type='file|dir|back.dir|drive' title='Take ownership' image=[\uE194,#f00] admin + item(type='file|dir|back.dir|drive' title=loc.take_ownership image=[\uE194,#f00] admin cmd args='/K takeown /f "@sel.path" @if(sel.type==1,null,"/r /d y") && icacls "@sel.path" /grant *S-1-5-32-544:F @if(sel.type==1,"/c /l","/t /c /l /q")') separator - menu(title="Show/Hide" image=icon.show_hidden_files) + menu(title=loc.show_hide image=icon.show_hidden_files) { - item(title="System files" image=inherit cmd='@command.togglehidden') - item(title="File name extensions" image=icon.show_file_extensions cmd='@command.toggleext') + item(title=loc.system_files image=inherit cmd='@command.togglehidden') + item(title=loc.file_name_extensions image=icon.show_file_extensions cmd='@command.toggleext') } - menu(type='file|dir|back.dir' mode="single" title='Attributes' image=icon.properties) + menu(type='file|dir|back.dir' mode="single" title=loc.attributes image=icon.properties) { $atrr = io.attributes(sel.path) - item(title='Hidden' checked=io.attribute.hidden(atrr) + item(title=loc.hidden checked=io.attribute.hidden(atrr) cmd args='/c ATTRIB @if(io.attribute.hidden(atrr),"-","+")H "@sel.path"' window=hidden) - item(title='System' checked=io.attribute.system(atrr) + item(title=loc.system checked=io.attribute.system(atrr) cmd args='/c ATTRIB @if(io.attribute.system(atrr),"-","+")S "@sel.path"' window=hidden) - item(title='Read-Only' checked=io.attribute.readonly(atrr) + item(title=loc.readonly checked=io.attribute.readonly(atrr) cmd args='/c ATTRIB @if(io.attribute.readonly(atrr),"-","+")R "@sel.path"' window=hidden) - item(title='Archive' checked=io.attribute.archive(atrr) + item(title=loc.archive checked=io.attribute.archive(atrr) cmd args='/c ATTRIB @if(io.attribute.archive(atrr),"-","+")A "@sel.path"' window=hidden) separator - item(title="Created" keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1) vis=label) - item(title="Modified" keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1) vis=label) - item(title="Accessed" keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1) vis=label) + item(title=loc.created keys=io.dt.created(sel.path, 'y/m/d') cmd=io.dt.created(sel.path,2000,1,1) vis=label) + item(title=loc.modified keys=io.dt.modified(sel.path, 'y/m/d') cmd=io.dt.modified(sel.path,2000,1,1) vis=label) + item(title=loc.accessed keys=io.dt.accessed(sel.path, 'y/m/d') cmd=io.dt.accessed(sel.path,2000,1,1) vis=label) } - menu(mode="single" type='file' find='.dll|.ocx' separator="before" title='Register Server' image=\uea86) + menu(mode="single" type='file' find='.dll|.ocx' separator="before" title=loc.register_erver image=\uea86) { - item(title='Register' admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") - item(title='Unregister' admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") + item(title=loc.register admin cmd='regsvr32.exe' args='@sel.path.quote' invoke="multiple") + item(title=loc.unregister admin cmd='regsvr32.exe' args='/u @sel.path.quote' invoke="multiple") } menu(mode="single" type='back' expanded=true) { - menu(separator="before" title='New Folder' image=icon.new_folder) + menu(separator="before" title=loc.new_folder image=icon.new_folder) { - item(title='DateTime' cmd=io.dir.create(sys.datetime("ymdHMSs"))) - item(title='Guid' cmd=io.dir.create(str.guid)) + item(title=loc.datetime cmd=io.dir.create(sys.datetime("ymdHMSs"))) + item(title=loc.guid cmd=io.dir.create(str.guid)) } - menu(title='New File' image=icon.new_file) + menu(title=loc.new_file image=icon.new_file) { $dt = sys.datetime("ymdHMSs") item(title='TXT' cmd=io.file.create('@(dt).txt', 'Hello World!')) diff --git a/config/en/imports/goto.nss b/src/bin/imports/goto.nss similarity index 96% rename from config/en/imports/goto.nss rename to src/bin/imports/goto.nss index 5711acb..8bc49b8 100644 --- a/config/en/imports/goto.nss +++ b/src/bin/imports/goto.nss @@ -21,7 +21,7 @@ menu(type='*' where=window.is_taskbar||sel.count mode=mode.multiple title=title. item(title='Temp' image=inherit cmd=user.temp) } item(title=title.control_panel image=\uE0F3 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}') - item(title='All Control Panel Items' image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') + item(title=loc.all_control_panel_items image=\uE0F3 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}') item(title=title.run image=\uE14B cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}') menu(where=sys.ver.major >= 10 title=title.settings sep=sep.before image=\uE0F3) { diff --git a/config/en/imports/images.nss b/src/bin/imports/images.nss similarity index 100% rename from config/en/imports/images.nss rename to src/bin/imports/images.nss diff --git a/src/bin/imports/lang/ar.nss b/src/bin/imports/lang/ar.nss new file mode 100644 index 0000000..190dbc8 --- /dev/null +++ b/src/bin/imports/lang/ar.nss @@ -0,0 +1,44 @@ +/* +Arabic +by: github.com/moudey +*/ + +// shell.nss +pin_unpin="Pin/Unpin" + +// develop.nss +develop="تطوير" +editors="محررات" +windows_notepad="مفكرة الويندوز" + +// file-manage.nss +file_manage="ادارة الملفات" +change_extension="تغير الملحقات" +take_ownership="Take ownership" +show_hide="اظهار/اخفاء" +system_files="ملفات النظام" +file_name_extensions="File name extensions" +attributes="السمات" +register_server="Register Server" +register="تسجيل" +unregister="الغاء التسجيل" +hidden="اخفاء" +system="النظام" +readonly="قراءة فقط" +archive="ارشيف" +created="Created" +modified="Modified" +accessed="Accessed" +new_folder="مجلد جديد" +new_file="ملف جديد" +datetime="تاريخ ووقت" +guid="Guid" + +// goto.nss +all_control_panel_items="جميع عناصر لوحة التحكم" + +// taskbar.nss +apps="تطبيقات" +paint="الرسام" +edge="Edge" +calculator="الحاسبة" diff --git a/src/bin/imports/lang/en.nss b/src/bin/imports/lang/en.nss new file mode 100644 index 0000000..d35d82d --- /dev/null +++ b/src/bin/imports/lang/en.nss @@ -0,0 +1,45 @@ +/* +English +by: github.com/moudey +*/ + +xxx="Welcome in english" +// shell.nss +pin_unpin="Pin/Unpin" + +// develop.nss +develop="&Develop" +editors="editors" +windows_notepad="Windows notepad" + +// file-manage.nss +file_manage="File manage" +change_extension="Change extension" +take_ownership="Take ownership" +show_hide="Show/Hide" +system_files="System files" +file_name_extensions="File name extensions" +attributes="Attributes" +register_server="Register Server" +register="Register" +unregister="Unregister" +hidden="Hidden" +system="System" +readonly="Read-Only" +archive="Archive" +created="Created" +modified="Modified" +accessed="Accessed" +new_folder="New Folder" +new_file="New File" +datetime="DateTime" +guid="Guid" + +// goto.nss +all_control_panel_items="All Control Panel Items" + +// taskbar.nss +apps="Apps" +paint="Paint" +edge="Edge" +calculator="Calculator" diff --git a/config/de/imports/modify.nss b/src/bin/imports/modify.nss similarity index 100% rename from config/de/imports/modify.nss rename to src/bin/imports/modify.nss diff --git a/config/en/imports/taskbar.nss b/src/bin/imports/taskbar.nss similarity index 86% rename from config/en/imports/taskbar.nss rename to src/bin/imports/taskbar.nss index 5f14ab0..1eb5938 100644 --- a/config/en/imports/taskbar.nss +++ b/src/bin/imports/taskbar.nss @@ -7,7 +7,7 @@ item(title="docs" image=\uE1C4 cmd='https://nilesoft.org/docs') item(title="donate" image=\uE1A7 cmd='https://nilesoft.org/donate') } -menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) +menu(where=@(this.count == 0) type="taskbar" image=icon.settings expanded=true) { menu(title="Apps" image=\uE254) { @@ -15,6 +15,9 @@ menu(where=@(this.count == 0) type='taskbar' image=icon.settings expanded=true) item(title='Edge' image cmd='@sys.prog32\Microsoft\Edge\Application\msedge.exe') item(title='Calculator' image=\ue1e7 cmd='calc.exe') item(title=str.res('regedit.exe,-16') image cmd='regedit.exe') + sep + item(title='WinSCP' image cmd='D:\config\Programs\network\WinSCP\WinSCP.exe') + item(title="GitHubDesktop" image cmd='D:\config\Programs\dev\github\GitHubDesktop.exe') } menu(title=title.windows image=\uE1FB) { diff --git a/config/ko/imports/terminal.nss b/src/bin/imports/terminal.nss similarity index 55% rename from config/ko/imports/terminal.nss rename to src/bin/imports/terminal.nss index 9052ec0..c3c199b 100644 --- a/config/ko/imports/terminal.nss +++ b/src/bin/imports/terminal.nss @@ -1,9 +1,15 @@ -menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep=sep.top image=icon.run_with_powershell) -{ - $tip_run_admin=["\xE1A7 SHIFT 키를 눌러 실행" + this.title + " 관리자로", tip.warning, 1.0] - $has_admin=key.shift() or key.rbutton() - - item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd-prompt=`/K TITLE Command Prompt &ver& PUSHD "@sel.dir"`) - item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd-ps=`-noexit -command Set-Location -Path '@sel.dir'`) - item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd="wt.exe" arg=`-d "@sel.path\."`) -} +menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep=sep.top image=icon.run_with_powershell) +{ + $tip_run_admin=["\xE1A7 Press [SHIFT key] or [RIGHT-CLICK] to run " + this.title + " as administrator", tip.warning, 1.0] + $has_admin=key.shift() or key.rbutton() + + item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd-prompt=`/K TITLE Command Prompt &ver& PUSHD "@sel.dir"`) + item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd-ps=`-noexit -command Set-Location -Path '@sel.dir'`) + item(where=package.exists("WindowsTerminal") + title=title.Windows_Terminal + tip=tip_run_admin + admin=has_admin + image='@package.path("WindowsTerminal")\WindowsTerminal.exe' + cmd="wt.exe" + arg=`-d "@sel.path\."`) +} \ No newline at end of file diff --git a/config/de/imports/theme.nss b/src/bin/imports/theme.nss similarity index 100% rename from config/de/imports/theme.nss rename to src/bin/imports/theme.nss diff --git a/src/bin/license.txt b/src/bin/license.txt new file mode 100644 index 0000000..bef9743 --- /dev/null +++ b/src/bin/license.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Nilesoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/bin/readme.txt b/src/bin/readme.txt new file mode 100644 index 0000000..705cbe3 --- /dev/null +++ b/src/bin/readme.txt @@ -0,0 +1,30 @@ +Nilesoft Shell + +[about] +Shell is a powerful, lightweight extension for Windows File Explorer that gives the user a high level of control over the context menu to improve its performance. +Compatible with Windows 7 or later. + +[update] +(*) If you are updating, please first uninstall/unregister previous version. + +[donate] +If you really love Shell and would like to see it continue to improve. +https://nilesoft.org/donate + +[support] +https://nilesoft.org +https://nilesoft.org/github +support@nilesoft.org + +[DISCLAIMER] +THE SOFTWARE IS DISTRIBUTED "AS IS". NO WARRANTY OF ANY KIND IS +EXPRESSED OR IMPLIED. YOU USE THE SOFTWARE AT YOUR OWN RISK. THE +AUTHORS WILL NOT BE LIABLE FOR DATA LOSS, DAMAGES, LOSS OF PROFITS OR +ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THE SOFTWARE. + +Copyright (C) 2024 Nilesoft Ltd. + +[plutovg] +Copyright (c) 2020 Nwutobo Samuel Ugochukwu +https://github.com/sammycage/plutovg + diff --git a/config/en/shell.nss b/src/bin/shell.nss similarity index 82% rename from config/en/shell.nss rename to src/bin/shell.nss index d7ec077..151415b 100644 --- a/config/en/shell.nss +++ b/src/bin/shell.nss @@ -8,12 +8,14 @@ tip.enabled=true } +// localization +import lang 'imports/lang/en.nss' + import 'imports/theme.nss' import 'imports/images.nss' - import 'imports/modify.nss' -menu(mode="multiple" title="Pin/Unpin" image=icon.pin) +menu(mode="multiple" title=loc.pin_unpin image=icon.pin) { } diff --git a/src/dll/Shell.vcxproj b/src/dll/Shell.vcxproj index 1ae826b..3149dd6 100644 --- a/src/dll/Shell.vcxproj +++ b/src/dll/Shell.vcxproj @@ -169,6 +169,7 @@ + diff --git a/src/dll/Shell.vcxproj.filters b/src/dll/Shell.vcxproj.filters index f436acb..1b86e14 100644 --- a/src/dll/Shell.vcxproj.filters +++ b/src/dll/Shell.vcxproj.filters @@ -30,6 +30,9 @@ + + Others Files + Others Files diff --git a/src/dll/src/Expression/ExpressionType.h b/src/dll/src/Expression/ExpressionType.h index 59c8730..1141230 100644 --- a/src/dll/src/Expression/ExpressionType.h +++ b/src/dll/src/Expression/ExpressionType.h @@ -25,7 +25,7 @@ namespace Nilesoft For, ForEach, Assign, //An assignment operation, such as (a = b). - StringExt, + StringExt /* Constant, //A constant value. Add, //An addition operation, such as a + b, without overflow checking, for numeric operands. diff --git a/src/dll/src/Expression/FuncExpression.cpp b/src/dll/src/Expression/FuncExpression.cpp index 904f080..d1af111 100644 --- a/src/dll/src/Expression/FuncExpression.cpp +++ b/src/dll/src/Expression/FuncExpression.cpp @@ -2100,6 +2100,12 @@ namespace Nilesoft case IDENT_INDEXOF: _result = Object(new Object[]{ IDENT_INDEXOF, (int)argc, eval_arg(0).move(), eval_arg(1).move(), eval_arg(2).move() }, true).move(); break; + case IDENT_LOC: + { + auto e = context->Cache->variables.loc[Id[1]]; + _result = context->Eval(e).move(); + break; + } default: { eval_var(_result); @@ -2351,10 +2357,10 @@ namespace Nilesoft _result = p->get_title(quote).move(); break; case IDENT_QUOTE: - _result = p->get(quote.empty() ? string(L"\"") : quote).move(); + _result = p->get(quote.empty() ? string(L"\"") : quote, argc == 1 ? sep.c_str() : nullptr).move(); break; default: - _result = p->get(quote).move(); + _result = p->get(quote, argc == 2 ? sep.c_str() : nullptr).move(); break; } } @@ -4239,34 +4245,34 @@ namespace Nilesoft break; } case IDENT_IS7ORGREATER: - _result = ver->Major > 6 || (ver->Major == 6 && ver->Minor >= 1); + _result = ver->Major >= 6 && ver->Minor >= 1; break; case IDENT_IS8ORGREATER: - _result = ver->Major > 6 || (ver->Major == 6 && ver->Minor >= 2); + _result = ver->Major >= 6 && ver->Minor >= 2; break; case IDENT_IS81ORGREATER: - _result = ver->Major > 6 || (ver->Major == 6 && ver->Minor >= 3); + _result = ver->Major >= 6 && ver->Minor >= 3; break; case IDENT_IS10ORGREATER: _result = ver->Major >= 10; break; case IDENT_S11ORGREATER: - _result = ver->Major >10 || (ver->Major == 10 && ver->Build >= 22000); + _result = ver->Major >= 10 && ver->Build >= 22000; break; case IDENT_IS7OREARLIER: - _result = ver->Major < 6 || (ver->Major == 6 && ver->Minor <= 1); + _result = ver->Major <= 6 && ver->Minor <= 1; break; case IDENT_IS8OREARLIER: - _result = ver->Major < 6 || (ver->Major == 6 && ver->Minor <= 2); + _result = ver->Major <= 6 && ver->Minor <= 2; break; case IDENT_IS81OREARLIER: - _result = ver->Major < 6 || (ver->Major == 6 && ver->Minor <= 3); + _result = ver->Major <= 6 && ver->Minor <= 3; break; case IDENT_IS10OREARLIER: - _result = ver->Major < 10 || (ver->Major == 10 && ver->Build < 22000); + _result = ver->Major <= 10 && ver->Build < 22000; break; case IDENT_IS11OREARLIER: - _result = ver->Major < 10 || (ver->Major == 10 && ver->Build <= 22000); + _result = ver->Major <= 10 && ver->Build <= 22000; break; case IDENT_IS_PRIMARY_MONITOR: _result = context->helper.is_primary_monitor; @@ -4357,9 +4363,74 @@ namespace Nilesoft case IDENT_TEMPLATES: _result = Path::GetKnownFolder(FOLDERID_CommonTemplates).trim_end(trim).move(); break; - case IDENT_LANGID: - _result = ::GetThreadUILanguage(); //context->helper.languageId; + case IDENT_LANG: + case IDENT_LOC: + { + wchar_t szISOLang[51] = { }; + if(Id.length() == 2) + { + auto len = ::GetUserDefaultLocaleName(szISOLang, 50); + if(len > 0) + _result = szISOLang; + } + else if(Id.length() == 3) + { + auto locid = ::GetThreadUILanguage(); + + switch(Id[2]) + { + case IDENT_ID: + _result = locid; //context->helper.languageId; + break; + case IDENT_NAME: + { + + auto ret = ::GetLocaleInfoW(locid, + LOCALE_SISO639LANGNAME, + szISOLang, + sizeof(szISOLang) / sizeof(wchar_t)); + if(ret) + _result = szISOLang; + break; + } + case IDENT_COUNTRY: + { + auto ret = ::GetLocaleInfoW(locid, + LOCALE_SISO3166CTRYNAME, + szISOLang, + sizeof(szISOLang) / sizeof(wchar_t)); + if(ret) + _result = szISOLang; + break; + } + } + } + + /*wchar_t szISOLang[10] = { 0 }; + wchar_t szISOCountry[10] = { 0 }; + auto lid = ::GetThreadUILanguage(); + + auto ret = ::GetLocaleInfoW(lid, + LOCALE_SISO639LANGNAME, + szISOLang, + sizeof(szISOLang) / sizeof(wchar_t)); + if(ret) + { + loc = szISOLang; + ret = ::GetLocaleInfoW(lid, + LOCALE_SISO3166CTRYNAME, + szISOCountry, + sizeof(szISOCountry) / sizeof(wchar_t)); + if(ret) + { + loc += L"-"; + loc += szISOCountry; + } + } + */ + break; + } case IDENT_DATETIME: { SYSTEMTIME lt = { }; diff --git a/src/dll/src/Include/Cache.h b/src/dll/src/Include/Cache.h index bf8f9c3..6ea1f55 100644 --- a/src/dll/src/Include/Cache.h +++ b/src/dll/src/Include/Cache.h @@ -420,6 +420,7 @@ namespace Nilesoft struct { Scope global; Scope runtime; + Scope loc; } variables; std::vector statics; @@ -454,6 +455,7 @@ namespace Nilesoft variables.global.clear(true); variables.runtime.clear(true); + variables.loc.clear(true); Packages.list.clear(); } diff --git a/src/dll/src/Initializer.cpp b/src/dll/src/Initializer.cpp index d725430..6c8d2b4 100644 --- a/src/dll/src/Initializer.cpp +++ b/src/dll/src/Initializer.cpp @@ -808,7 +808,7 @@ namespace Nilesoft if(count == 1) { - if(kctrl || kb.is_lbutton()) // reload/enabled shell + if(kctrl || kb.is_lbutton() || kb.key(VK_F5)) // reload/enabled shell { //Modern(1); Status.Disabled = false; diff --git a/src/dll/src/Main.cpp b/src/dll/src/Main.cpp index 4358ede..0c56bda 100644 --- a/src/dll/src/Main.cpp +++ b/src/dll/src/Main.cpp @@ -1264,8 +1264,10 @@ HRESULT Register(bool reg) if(reg) { //_log.create(); + REGOP regop; + regop.REGISTER = regop.CONTEXTMENU = regop.ICONOVERLAY = true; - if(!RegistryConfig::Register(path, REG_REGISTER | REG_CONTEXTMENU | REG_ICONOVERLAY)) + if(!RegistryConfig::Register(path, regop)) { msg = string::Extract(_hInstance, IDS_REGISTER_NOT_SUCCESS).move(); _log.error(L"%s", msg.c_str()); diff --git a/src/dll/src/Parser/IdentHash.h b/src/dll/src/Parser/IdentHash.h index 6cd392a..52576d0 100644 --- a/src/dll/src/Parser/IdentHash.h +++ b/src/dll/src/Parser/IdentHash.h @@ -359,6 +359,10 @@ namespace Nilesoft constexpr auto IDENT_MENU = 0x7C9A911AU; constexpr auto IDENT_PARALLEL = 0x1455E3F2U; + constexpr auto IDENT_LOC = 0x0B888D03U; + constexpr auto IDENT_LANG = 0x7C99F3A7U; + constexpr auto IDENT_COUNTRY = 0xD3F53B19U; + constexpr auto IDENT_THEME = 0x106CDE18U; constexpr auto IDENT_THEME_AUTO = 0x7C94415EU; constexpr auto IDENT_THEME_HIGHCONTRAST = 0xA855C1B3U; @@ -553,7 +557,6 @@ namespace Nilesoft constexpr auto IDENT_LIBRARIES = 0x866F7922U; constexpr auto IDENT_DOCUMENTSLIBRARY = 0x102BD54CU; constexpr auto IDENT_TEMPLATES = 0xC41FE294U; - constexpr auto IDENT_LANGID = 0x0AE58754U; constexpr auto IDENT_QUICKLAUNCH = 0xF64BA4FDU; constexpr auto IDENT_PACKAGE = 0x9ABA6791U; constexpr auto IDENT_UWP = 0x0B88B461U; diff --git a/src/dll/src/Parser/Parser.cpp b/src/dll/src/Parser/Parser.cpp index 2d295d5..81a0bd1 100644 --- a/src/dll/src/Parser/Parser.cpp +++ b/src/dll/src/Parser/Parser.cpp @@ -1030,16 +1030,20 @@ namespace Nilesoft } //predefined constant variable - bool Parser::parse_variable(Scope *variables) + bool Parser::parse_variable(Scope *variables, bool has_sign) { skip(); - if(l->tok != L'$') - return false; + if(has_sign) + { + if(l->tok != L'$') + return false; + + skip(); + prevCol = l->column; + l->next(); // skip $ + } - skip(); - prevCol = l->column; - l->next(); // skip $ error_if(!l->is_ident(0), TokenError::VariableExpected, prevCol); Ident id; id.push_back(parse_ident(true)); @@ -1178,6 +1182,20 @@ namespace Nilesoft return 0; } + void Parser::parse_loc(bool has_curly) + { + if(has_curly) + expect_openCurly(); + while(!l->eof) + { + if(has_curly && l->tok == L'}') + break; + parse_variable(&context.Cache->variables.loc, false); + } + if(has_curly) + expect_closeCurly(); + } + // load data from disk and populate void Parser::parse_config() { @@ -1229,26 +1247,50 @@ namespace Nilesoft } case IDENT_IMPORT: { + skip(); + bool bloc = false; + if(l->peek_ident(IDENT_LOC)) + { + bloc = true; + l->next(3); + } + else if(l->peek_ident(IDENT_LANG)) + { + bloc = true; + l->next(4); + } + auto ret = load_import(l->line, l->column, true, false); if(ret == 1) { - parse_config(); + if(bloc) + parse_loc(false); + else + parse_config(); pop_import(); } break; } - case 0: + case IDENT_LANG: + case IDENT_LOC: { - if(l->eof) - break; - if(parse_variable(&cache->variables.global)) - break; - if(parse_image()) - break; + parse_loc(true); + break; } default: + { + if(id == 0) + { + if(l->eof) + break; + if(parse_variable(&cache->variables.global)) + break; + if(parse_image()) + break; + } error(TokenError::IdentifierConfigUnexpected, prevCol); break; + } } } } diff --git a/src/dll/src/Parser/Parser.h b/src/dll/src/Parser/Parser.h index b2a2ca9..a40b3e0 100644 --- a/src/dll/src/Parser/Parser.h +++ b/src/dll/src/Parser/Parser.h @@ -100,7 +100,7 @@ namespace Nilesoft bool parse_ident(Ident &id, bool allow_dash = false); uint32_t parse_ident(bool multiple = true); - bool parse_variable(Scope *variables); + bool parse_variable(Scope *variables, bool has_sign = true); int load_import(size_t line, size_t col, bool ignore_failed = true, bool parse_import = false); void parse_modify_items(uint32_t action = 0); @@ -112,6 +112,8 @@ namespace Nilesoft void parse_menu(NativeMenu *menu, bool has_curly = true); bool parse_modify_properties(NativeMenu *item, uint32_t action = 0); + void parse_loc(bool has_curly = false); + void parse_settings(std::vector *settings, const Ident &id, bool imported = false); void parse_settings(struct SETTING *setting, const Ident &id = 0, bool imported = false); void parse_theme(); diff --git a/src/dll/src/Parser/Verification.cpp b/src/dll/src/Parser/Verification.cpp index dabef50..6dc32a9 100644 --- a/src/dll/src/Parser/Verification.cpp +++ b/src/dll/src/Parser/Verification.cpp @@ -458,9 +458,9 @@ namespace Nilesoft case IDENT_TITLE: case IDENT_NAME: case IDENT_QUOTE: - return check(argc == 0, 2); + return check(argc <= 1, 2); case IDENT_ZERO: - return check(argc <= 1, 1); + return check(argc <= 2, 1); default: return error_at(2); } @@ -669,8 +669,22 @@ namespace Nilesoft case IDENT_APPDATA: case IDENT_USERS: case IDENT_TEMPLATES: - case IDENT_LANGID: + case IDENT_LANG: + case IDENT_LOC: + { + switch(id[2]) + { + case IDENT_ID: + case IDENT_NAME: + case IDENT_COUNTRY: + return check(argc == 0, 2); + case IDENT_ZERO: + return check(argc == 0, 1); + default: + return error_at(2); + } return check(argc == 0, 1); + } case IDENT_ISOREARLIER: case IDENT_ISORGREATER: return check(argc < 3, 1); @@ -1927,9 +1941,16 @@ namespace Nilesoft } return error_at(0); } + case IDENT_LOC: + { + if(length != 2) + return error_at(0); + //if(argc == 0 && context.Cache->variables.loc.exists(id[1], false)) + return ExpressionType::Identifier; + //return error_at(1); + } } - //if(argc == 0) { if(context.variables.global) diff --git a/src/dll/src/dija.h b/src/dll/src/dija.h new file mode 100644 index 0000000..e69de29 diff --git a/src/exe/exe.vcxproj b/src/exe/exe.vcxproj index 8ac9a15..0aa9cd4 100644 --- a/src/exe/exe.vcxproj +++ b/src/exe/exe.vcxproj @@ -28,7 +28,7 @@ 16.0 - Win32Proj + {FFFD0DDB-48FB-4681-A3B6-8E787FA98C98} Shell shell @@ -57,10 +57,6 @@ $(OutDir)$(TargetName)$(TargetExt).xml - - ..\tools\version\version.exe - Generating version number... - $(IncludePath) diff --git a/src/exe/src/Main.cpp b/src/exe/src/Main.cpp index 7687e71..d2899d5 100644 --- a/src/exe/src/Main.cpp +++ b/src/exe/src/Main.cpp @@ -20,8 +20,8 @@ #if defined(_M_ARM64) #pragma comment(lib, "plutosvg-arm64.lib") -#elif defined(_M_ARM) - #pragma comment(lib, "plutosvg-arm.lib") +//#elif defined(_M_ARM) +// #pragma comment(lib, "plutosvg-arm.lib") #elif defined(_M_X64) #pragma comment(lib, "plutosvg-x64.lib") #else @@ -32,11 +32,8 @@ using namespace Nilesoft; using namespace Nilesoft::Windows::Forms; using namespace Nilesoft::Shell; -//constexpr const char _DllGetClassObject[] = { 'D','l','l','G','e','t','C','l','a','s','s','O','b','j','e','c','t' }; constexpr const wchar_t dll_name[] = L"shell.dll"; -//typedef HRESULT (__stdcall *fDllGetClassObject)(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID FAR *ppv); - BOOL CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); #define ID_MAINWINDOW 100 @@ -51,15 +48,12 @@ BOOL CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); #define ID_WEB 0x006 #define ID_DONATE 0x007 #define ID_EMAIL 0x008 -#define ID_BUG 0x009 -#define ID_REDDIT 0x00a -#define ID_TWITTER 0x00b -#define ID_FACEBOOK 0x00c +#define ID_GITHUB 0x009 #define ID_DOCS 0x00d ///////// -#define SetWindowStyle(hwnd, style) ::SetWindowLong((hwnd), GWL_STYLE, (style)) -#define SetWindowExStyle(hwnd, style) ::SetWindowLong((hwnd), GWL_EXSTYLE, (style)) +#define SetWindowStyle(hwnd, style) ::SetWindowLongW((hwnd), GWL_STYLE, (style)) +#define SetWindowExStyle(hwnd, style) ::SetWindowLongW((hwnd), GWL_EXSTYLE, (style)) #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) // windowsx.h #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) // windowsx.h @@ -76,162 +70,18 @@ Logger *_log; HANDLE _fonthandle = nullptr; HFONT _hfont_icon = nullptr; HFONT _hfont_icon2 = nullptr; - UINT _dpi = 96; -/* - if (m_hwnd) - { - // Because the SetWindowPos function takes its size in pixels, we - // obtain the window's DPI, and use it to scale the window size. - float dpi = GetDpiForWindow(m_hwnd); - - SetWindowPos( - m_hwnd, - NULL, - NULL, - NULL, - static_cast(ceil(640.f * dpi / 96.f)), - static_cast(ceil(480.f * dpi / 96.f)), - SWP_NOMOVE); - ShowWindow(m_hwnd, SW_SHOWNORMAL); - UpdateWindow(m_hwnd); - } -*/ - -// https://stackoverflow.com/questions/5689904/gracefully-exit-explorer-programmatically -BOOL ExitExplorer() -{ - auto hWndTray = ::FindWindowExW(nullptr, nullptr, L"Shell_TrayWnd", nullptr); - return hWndTray ? ::PostMessageW(hWndTray, 0x5B4, 0, 0) : FALSE; -} - -template -T dpi(auto value) { return static_cast((value * _dpi) / 96); } - -void DrawPng(HDC hdc, HBITMAP hbitmap, int x, int y, int size = 16, int sx = 0, int sy = 0, int alpha = 255) -{ - if(hdc && hbitmap) - { - auto memDC = ::CreateCompatibleDC(hdc); - if(memDC) - { - auto prev_bitmap = ::SelectObject(memDC, hbitmap); - BLENDFUNCTION bf{}; - bf.BlendOp = AC_SRC_OVER; - bf.BlendFlags = 0; - bf.SourceConstantAlpha = (byte)alpha; - bf.AlphaFormat = AC_SRC_ALPHA; - ::GdiAlphaBlend(hdc, x, y, size, size, memDC, sx, sy, size, size, bf); - // Clean up - ::SelectObject(memDC, prev_bitmap); - ::DeleteDC(memDC); - } - } -} - -bool IsKeyDown(int key) -{ - return (((::GetKeyState(key) >> 8) & 0xff) != 0); -} - -bool IsAsyncKeyDown(int key) -{ - return (((::GetAsyncKeyState(key) >> 8) & 0xff) != 0); -} - -bool KeyboardIsKeyDown(int key) noexcept -{ - // the return value is a SHORT (16 bits), not a 32 bit value - // (in other words, 0x80000000 is not a valid bit mask) - return (::GetKeyState(key) & 0x8000) != 0; -} - -void ColorToHtmlCode(COLORREF rgb, LPWSTR strg, size_t count) -{ - StringCchPrintf(strg, count, L"#%02X%02X%02X", (int)GetRValue(rgb), (int)GetGValue(rgb), (int)GetBValue(rgb)); -} - -void GetCurrentMonitorResolution(HWND hwnd, int *pCXScreen, int *pCYScreen) -{ - HMONITOR const hMonitor = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); - MONITORINFO mi = { sizeof(MONITORINFO) }; - ::GetMonitorInfoW(hMonitor, &mi); - *pCXScreen = (mi.rcMonitor.right - mi.rcMonitor.left); - *pCYScreen = (mi.rcMonitor.bottom - mi.rcMonitor.top); -} - -// FullHD? => 0:'==', -1:'<', +1:'>' -inline int IsFullHD(HWND hwnd, int resX, int resY) -{ - int cxScreen{}, cyScreen{}; - GetCurrentMonitorResolution(hwnd, &cxScreen, &cyScreen); - if(resX <= 0) - resX = cxScreen; - if(resY <= 0) - resY = cyScreen; - return ((resX == 1920) && (resY == 1080)) ? 0 : (((resX < 1920) || (resY < 1080)) ? -1 : +1); -} - -/*int PointSizeToFontHeight(const float fPtHeight, const HDC hdc) -{ - return -MulDiv(float2int(fPtHeight * 100.0f), GetDeviceCaps(hdc, LOGPIXELSY), 72 * SC_FONT_SIZE_MULTIPLIER); -}*/ - -inline void StrReplChrW(WCHAR *pStrg, const WCHAR chSearch, const WCHAR chReplace) -{ - while(pStrg && *pStrg) - { - if(*pStrg == chSearch) - *pStrg = chReplace; - ++pStrg; - } -} - -/*Routine Description: This routine returns TRUE if the caller's -process is a member of the Administrators local group. Caller is NOT -expected to be impersonating anyone and is expected to be able to -open its own process and process token. -Arguments: None. -Return Value: - TRUE - Caller has Administrators local group. - FALSE - Caller does not have Administrators local group. -- -*/ -BOOL IsUserAdmin() -{ - BOOL b; - SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; - PSID AdministratorsGroup; - b = ::AllocateAndInitializeSid( - &NtAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, - &AdministratorsGroup); - - if(b) - { - if(!::CheckTokenMembership(NULL, AdministratorsGroup, &b)) - { - b = FALSE; - } - ::FreeSid(AdministratorsGroup); - } - - return(b); -} - RECT rc_window{}; RECT rc_reg{}; RECT rc_unreg{}; - POINT p{}; - UI::Window *main_window = nullptr; HBITMAP hbitmap_logo = nullptr; //0xAA0000FF COLORREF color_background = 0xffffff; +template +T dpi(auto value) { return static_cast((value * _dpi) / 96); } string loadstring(UINT id, HMODULE hmodule = nullptr) { @@ -244,6 +94,7 @@ string loadstring(UINT id, HMODULE hmodule = nullptr) return str.release(size).move(); } + BOOL EnablePrivilege() { BOOL result = FALSE; @@ -338,7 +189,7 @@ bool SetPermissions(HKEY root, const wchar_t *subkey, REGSAM reg_view = KEY_WOW6 void disable_modern(bool _register) { string k; - k.format(L"CLSID\\%s",string::ToString(IID_FileExplorerContextMenu, 2).c_str()); + k.format(L"CLSID\\%s", string::ToString(IID_FileExplorerContextMenu, 2).c_str()); auto setval = [=](auto reg)->LSTATUS { auto_regkey key{}; @@ -384,33 +235,26 @@ void disable_modern(bool _register) } //printf("Please wait shell we'll process your command \n"); -// r register -// u unregister -// s silent -// i init -// re restart restart explorer +// r register +// u unregister +// s silent +// restart restart explorer // shx cmh integrated Shell Extensions ContextMenuHandlers // Register the COM server and the context menu handler. -bool Registration(int freg) +bool Registration(REGOP reg) { auto ver = &Windows::Version::Instance(); try { - bool _register = freg & REG_REGISTER; - bool _unregister = freg & REG_UNREGISTER; - bool _treat = freg & REG_TREAT; - bool _silent = freg & REG_SILENT; - bool _restart = freg & REG_RESTART; - - //string dir = IO::Path::Parent(IO::Path::Module(_hInstance)); - //string dll_path = IO::Path::Combine(dir, dll_name).move(); + string dir = IO::Path::Parent(IO::Path::Module(_hInstance)); + string dll_path = IO::Path::Combine(dir, dll_name).move(); string path = IO::Path::Module(_hInstance).move(); - - if(_register) + //string dir = IO::Path::Parent(path).move(); + + if(reg.REGISTER) { - string dir = IO::Path::Parent(path).move(); if(!dir.empty()) { Security::Permission::SetFile(dir.c_str()); @@ -419,7 +263,6 @@ bool Registration(int freg) _log->close(); //logger->reset(); //IO::Path::Delete(logger->path()); - } if(!ver->IsWindows7OrGreater()) @@ -431,14 +274,14 @@ bool Registration(int freg) string msg; - if(_register || _unregister) + if(reg.REGISTER || reg.UNREGISTER) { if(!is_elevated) { // Missing administrative privileges! msg = string::Extract(IDS_ADMIN_PRIVILEGES).move(); _log->warning(msg); - if(!_silent) + if(!reg.SILENT) { //You will need to provide administrator permission to run this Shell MessageBox::Show(msg, APP_FULLNAME, MessageBoxIcon::Warning); @@ -446,18 +289,18 @@ bool Registration(int freg) return false; } - if(_register) + if(reg.REGISTER) { //logger->create(); - if(path.length() > 3) - path.remove_left(3).append(L"dll"); + REGOP regop; + regop.CONTEXTMENU = regop.ICONOVERLAY = true; - if(!RegistryConfig::Register(path, freg | REG_CONTEXTMENU | REG_ICONOVERLAY)) + if(!RegistryConfig::Register(dll_path, regop)) { msg = string::Extract(IDS_REGISTER_NOT_SUCCESS).move(); _log->error(msg); - if(!_silent) + if(!reg.SILENT) { MessageBox::Show(msg, APP_FULLNAME, MessageBoxIcon::Error, MessageBoxButtons::OK); @@ -468,7 +311,7 @@ bool Registration(int freg) // HKEY_CLASSES_ROOT\LibraryFolder\ShellEx\ContextMenuHandlers // HKEY_CLASSES_ROOT\LibraryFolder\background\shellex\ContextMenuHandlers // is windows 11 or later - if(ver->IsWindows11OrGreater() && _treat) + if(ver->IsWindows11OrGreater() && reg.TREAT) { //SOFTWARE\\Classes\\CLSID" disable_modern(true); @@ -485,7 +328,7 @@ bool Registration(int freg) { msg = string::Extract(IDS_UNREGISTER_NOT_SUCCESS).move(); _log->error(msg); - if(!_silent) + if(!reg.SILENT) { MessageBox::Show(msg, APP_FULLNAME, MessageBoxIcon::Error, MessageBoxButtons::OK); @@ -494,7 +337,7 @@ bool Registration(int freg) } // is windows 11 or later - if(ver->IsWindows11OrGreater() && _treat) + if(ver->IsWindows11OrGreater() && reg.TREAT) disable_modern(false); msg = string::Extract(IDS_UNREGISTER_SUCCESS).move(); @@ -503,23 +346,25 @@ bool Registration(int freg) if(ver->IsWindows8OrGreater()) _log->info(msg); - if(_restart) + if(reg.RESTART) { - if(!_silent) + if(!reg.SILENT) { msg += L"\n\n"; msg += string::Extract(IDS_RESTART_EXPLORERQ).move(); - _restart = MessageBox::Show(msg, APP_FULLNAME, + reg.RESTART = MessageBox::Show(msg, APP_FULLNAME, MessageBoxIcon::Information, MessageBoxButtons::OKCancel) == DialogResult::OK; } } - if(_restart) + if(reg.RESTART) { if(ver->IsWindows8OrGreater()) _log->info(string::Extract(IDS_RESTART_EXPLORER).move()); - Windows::Explorer::Restart(); + + if(Windows::Explorer::Restart()) + ::Sleep(1000); } else { @@ -530,7 +375,7 @@ bool Registration(int freg) } return true; } - else if(_restart) + else if(reg.RESTART) { if(ver->IsWindows8OrGreater()) _log->info(string::Extract(IDS_RESTART_EXPLORER).move()); @@ -546,35 +391,43 @@ bool Registration(int freg) return false; } -bool Register(int freg, HWND hwnd = nullptr) +bool Register(REGOP reg, HWND hwnd = nullptr) { string path = IO::Path::Combine(IO::Path::Parent(IO::Path::Module(nullptr)), dll_name).move(); DLL dll(path, true); - if((freg & REG_REGISTER) || (freg & REG_UNREGISTER)) + if(reg.REGISTER || reg.UNREGISTER) { if(!is_elevated) { // Missing administrative privileges! string msg = loadstring(IDS_ADMIN_PRIVILEGES, dll).move(); - //You will need to provide administrator permission to run this Shell - ::MessageBoxW(hwnd, msg, APP_FULLNAME, MB_ICONWARNING); + _log->error(msg); + if(!reg.SILENT) + { + //You will need to provide administrator permission to run this Shell + ::MessageBoxW(hwnd, msg, APP_FULLNAME, MB_ICONWARNING); + } return false; } } if(!dll) { - MessageBox::Show(L"shell.dll not found.", APP_FULLNAME, MessageBoxIcon::Warning); + auto ernf = L"shell.dll not found."; + _log->error(ernf); + if(!reg.SILENT) + MessageBox::Show(ernf, APP_FULLNAME, MessageBoxIcon::Warning); return false; } - auto ret = Registration(freg); + auto ret = Registration(reg); _log->close(); return ret; } +/* class Console { FILE *_handle = nullptr; @@ -628,7 +481,7 @@ public: void check() { Console c; - c.writel(L"\n\nNilesoft Shell version 1.8.1\n"); + c.writel(L"\n\nNilesoft Shell\n"); _log->info(L"BEGIN CHECK"); @@ -681,17 +534,7 @@ void check() _log->info(L"END CHECK"); } - -/* -BLENDFUNCTION func={AC_SRC_OVER,0,(BYTE)alpha,AC_SRC_ALPHA}; - - HDC hSrc=CreateCompatibleDC(NULL); - HGDIOBJ bmp0=SelectObject(hSrc,m_Bitmap); - POINT srcPos={0,0}; - UpdateLayeredWindow(m_hWnd,NULL,NULL,&m_Size,hSrc,&srcPos,0,&func,ULW_ALPHA); - SelectObject(hSrc,bmp0); - DeleteDC(hSrc); -*/ +*/ struct Theme { @@ -732,15 +575,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, COM_INITIALIZER com_initializer(true); CommandLine cmdline; - int freg{}; + REGOP reg{}; _hInstance = hInstance; _log = &Logger::Instance(); if(cmdline.ShowHelp) { - //-config:register - // MessageBox::Show(usage, APP_NAME, MessageBoxIcon::Information); //::DialogBoxParamW(hInstance, MAKEINTRESOURCEW(IDD_CMDLINE), nullptr, (DLGPROC)WndProc, 0); auto hWnd = ::CreateDialogParamW(_hInstance, MAKEINTRESOURCEW(IDD_CMDLINE), NULL, (DLGPROC)WndProc, 0); if(hWnd) @@ -750,7 +591,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, MSG msg; BOOL bRet; - while((bRet = ::GetMessageW(&msg, NULL, 0, 0)) != 0) + while((bRet = ::GetMessageW(&msg, nullptr, 0, 0)) != 0) { if(bRet == -1) { @@ -786,11 +627,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, else _dpi = 96;// DC(GetDesktopWindow()).GetDeviceCapsY(); - //_dpi = ::GetSystemDpiForProcess(::GetCurrentProcess()); - _hTheme = ::OpenThemeData(nullptr, L"MENU"); - // RunGlyphs(); - //return 0; + + UI::App app(_hInstance, WindowProc, m_theme.frame.color, LoadIcon(_hInstance, MAKEINTRESOURCE(IDI_RPMICON)), CS_HREDRAW | CS_VREDRAW); @@ -879,21 +718,14 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, auto btn_email = new UI::Button(L"\uE115", { tl, tt, btn_h, btn_h }, ID_EMAIL, main_window, BS_OWNERDRAW, _hfont_icon, L"Email Ctrl+E"); tl += btn_h + offset_2; - auto btn_bug = new UI::Button(L"\uE0D4", { tl, tt, btn_h, btn_h }, ID_BUG, main_window, BS_OWNERDRAW, _hfont_icon, L"Bugs Ctrl+B"); + auto btn_bug = new UI::Button(L"\uE22B", { tl, tt, btn_h, btn_h }, ID_GITHUB, main_window, BS_OWNERDRAW, _hfont_icon, L"Github Ctrl+G"); - tl += (dpi(50) - btn_h) + btn_h + dpi(12); + //tl += (dpi(50) - btn_h) + btn_h + dpi(12); + tl += btn_h + offset_2; auto btn_donate = new UI::Button(L"\uE1A8", { tl, tt, btn_h, btn_h }, ID_DONATE, main_window, BS_OWNERDRAW, _hfont_icon, L"Donate Ctrl+D"); - tl += btn_h + offset_2; - auto btn_reddit = new UI::Button(L"\uE23F", { tl, tt, btn_h, btn_h }, ID_REDDIT, main_window, BS_OWNERDRAW, _hfont_icon, L"Reddit Ctrl+I"); - tl += btn_h + offset_2; - auto btn_t = new UI::Button(L"\uE242", { tl, tt, btn_h, btn_h }, ID_TWITTER, main_window, BS_OWNERDRAW, _hfont_icon, L"Twitter Ctrl+T"); - - tl += btn_h + offset_2; - auto btn_f = new UI::Button(L"\uE244", { tl, tt, btn_h, btn_h }, ID_FACEBOOK, main_window, BS_OWNERDRAW, _hfont_icon, L"Facebook Ctrl+F"); - - main_window->SetColor({ btn_reg, btn_unreg,btn_restart,btn_donate,btn_web,btn_email,btn_bug, btn_f, btn_t , btn_reddit }, + main_window->SetColor({ btn_reg, btn_unreg,btn_restart,btn_donate,btn_web,btn_email,btn_bug }, m_theme.text.nor, m_theme.back.nor, m_theme.text.sel, m_theme.back.sel);//0xeeeee0 main_window->SetColor({ btn_close }, 0xFFFFFF, m_theme.back.nor, m_theme.text.nor, 0x2311E8);//E81123 @@ -904,9 +736,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, delete main_window; _log->close(); - if(_hfont_icon) - DeleteObject(_hfont_icon); + ::DeleteObject(_hfont_icon); if(_fonthandle) ::RemoveFontMemResourceEx(_fonthandle); @@ -935,27 +766,27 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, } else if(op->has_name({ L"r", L"register", L"e", L"enable" })) { - freg |= REG_REGISTER; + reg.REGISTER = true;; } else if(op->has_name({ L"u", L"unregister", L"d", L"disable" })) { - freg |= REG_UNREGISTER; + reg.UNREGISTER = true; } else if(op->has_name({ L"t", L"treat" })) { - freg |= REG_TREAT; + reg.TREAT = true; } else if(op->has_name({ L"f", L"force" })) { - freg |= REG_FOLDEREXTENSIONS; + reg.FOLDEREXTENSIONS=true; } else if(op->has_name({ L"s", L"silent" })) { - freg |= REG_SILENT; + reg.SILENT=true; } - else if(op->has_name({ L"re", L"restart" })) + else if(op->has_name(L"restart")) { - freg |= REG_RESTART; + reg.RESTART = true; } else if(op->has_name(L"cmd")) { @@ -970,32 +801,26 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, if(_check) { - check(); + //check(); return 0; } - /*if(runglyphs) + if(reg.REGISTER || reg.UNREGISTER || reg.RESTART || reg.FOLDEREXTENSIONS) { - RunGlyphs(); - return FALSE; - }*/ - - if((freg & REG_REGISTER) || (freg & REG_UNREGISTER) || (freg & REG_RESTART) || (freg & REG_FOLDEREXTENSIONS)) - { - return Register(freg); + return Register(reg); } else { if(!cmd.empty()) { - int sw = 1; - if(auto o = cmdline[L"wd"]) - sw = (int)string::ToInt(o); - int run = 1; if(auto o = cmdline[L"runas"]) run = (int)string::ToInt(o); + int sw = SW_SHOWNORMAL; + if(auto o = cmdline[L"show"]) + sw = (int)string::ToInt(o); + string verb = L"open"; if(run > 1) verb = L"runas"; @@ -1005,7 +830,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, cmd, cmdline[L"args"], cmdline[L"wd"], - SW_SHOWNORMAL); + sw); } } } @@ -1032,6 +857,26 @@ HFONT FontSize(HFONT hFont, int size, int weight = 0, byte quality= ANTIALIASED_ bool hover = false; using namespace Nilesoft::Drawing; +void DrawPng(HDC hdc, HBITMAP hbitmap, int x, int y, int size = 16, int sx = 0, int sy = 0, int alpha = 255) +{ + if(hdc && hbitmap) + { + auto memDC = ::CreateCompatibleDC(hdc); + if(memDC) + { + auto prev_bitmap = ::SelectObject(memDC, hbitmap); + BLENDFUNCTION bf{}; + bf.BlendOp = AC_SRC_OVER; + bf.BlendFlags = 0; + bf.SourceConstantAlpha = (byte)alpha; + bf.AlphaFormat = AC_SRC_ALPHA; + ::GdiAlphaBlend(hdc, x, y, size, size, memDC, sx, sy, size, size, bf); + // Clean up + ::SelectObject(memDC, prev_bitmap); + ::DeleteDC(memDC); + } + } +} void DrawString(HDC hdc, HFONT hFont, RECT *rc, COLORREF color, const wchar_t *text, int length, DWORD format, uint8_t opacity) { @@ -1130,17 +975,6 @@ void Open(HWND hWnd, const wchar_t* cmd) ::ShellExecuteW(hWnd, L"open", cmd, nullptr, nullptr, SW_NORMAL); } -//https://www.nilesoft.org/download/update/?version=1.1.0.0 -/* -The latest Shell version is 1.1.0.0. You are using version 1.1.0.0. [Click here to download the latest version][https://www.nilesoft.org/download]. - -Found a bug or have a suggestion? Please report it here on the official Shell GitHub page. - -//https://www.nilesoft.org/download/update/ -The latest Notepad3 version is 5.21.227.1. You are using version Unknown. Click here to download the latest version. -*/ -//hWindow - LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) @@ -1188,15 +1022,10 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara DrawString(dc, cfont, &rect, 0x808080, text, text.length(), DT_CENTER, 255); - //dc.draw_text(text, text.length(), rect, DT_CENTER); text.format(L"\xA9 %d %s", VERSION_YEAR, APP_COMPANY); rect = { 0, dpi(150 + 30), dpi(150), dpi(25 + 128 + 32 + 15) }; - //dc.set_text(0x808080); - //dc.draw_text(text, text.length(), rect, DT_CENTER); DrawString(dc, cfont, &rect, 0x808080, text, text.length(), DT_CENTER, 255); - ::DeleteObject(::SelectObject(dc, ofont)); - //DrawPng(hdc, hbitmap_res, 38, 25 + 128 + 32 + 5, 16, 16 * 13, 0, 128); } ::EndPaint(hWnd, &ps); return TRUE; @@ -1228,104 +1057,23 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara case ID_EMAIL: Open(hWnd, L"mailto:support@nilesoft.org"); break; - case ID_BUG: - Open(hWnd, L"https://nilesoft.org/bugs"); - break; - case ID_REDDIT: - Open(hWnd, L"https://reddit.com/u/moudeygo"); - break; - case ID_TWITTER: - Open(hWnd, L"https://twitter.com/moudey"); - break; - case ID_FACEBOOK: - Open(hWnd, L"https://facebook.com/moudeygo"); + case ID_GITHUB: + Open(hWnd, L"https://github.com/moudey/shell"); break; case ID_RESTART: - { Windows::Explorer::Restart(); - //for(auto &process : Diagnostics::Process::EnumInfo()) - //{ - // auto hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, process.th32ProcessID); - // if(hProcess) - // { - // if(string::Equals(process.szExeFile, "explorer.exe")) continue; - // //if(process.szExeFile Diagnostics::Process::ModuleBaseName("explorer.exe")) - // //MB(process.szExeFile); - // for(auto &module : Diagnostics::Process::Modules(hProcess)) - // { - // string dll = Diagnostics::Process::ModuleBaseName(hProcess, module).move(); - // if(dll.equals(L"shell.dll")) - // { - // DWORD dwNewThreadId; - // LPVOID freeLibrary= FreeLibraryAndExitThread; - // HANDLE hRemoteThread = CreateRemoteThread(hProcess, nullptr, 0, (LPTHREAD_START_ROUTINE)freeLibrary, module, 0, nullptr); - // if(hRemoteThread) - // { - // /*WaitForSingleObject(hRemoteThread, INFINITE); - // DWORD lpExitCode = 0; - // ::GetExitCodeThread(hRemoteThread, &lpExitCode); - // CloseHandle(hRemoteThread);*/ - // } - // else { - // ::MessageBox(0, L"Fail to build the remote thread \"FreeLibraryAndExitThread\"", L"Error during injection", MB_ICONERROR); - // } - - // /*LPVOID dllPathAddressInRemoteMemory = - // ::VirtualAllocEx(hProcess, NULL, sizeof module, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - // - // if(dllPathAddressInRemoteMemory) - // { - // BOOL succeededWriting = - // ::WriteProcessMemory(hProcess, dllPathAddressInRemoteMemory, module, sizeof module, NULL); - // - // if(succeededWriting) - // { - // LPVOID freeLibraryAndExitThreadAddress = - // (LPVOID)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "FreeLibraryAndExitThread"); - // if(freeLibraryAndExitThreadAddress) - // { - // HANDLE remoteThread = - // CreateRemoteThread(hProcess, NULL, NULL, (LPTHREAD_START_ROUTINE)freeLibraryAndExitThreadAddress, module, NULL, NULL); - - // if(remoteThread) - // { - // WaitForSingleObject(remoteThread, INFINITE); - // CloseHandle(remoteThread); - // MB(process.szExeFile); - // } - // } - // } - // else { - // MBF(L"not succeededWriting '%s'", process.szExeFile); - // } - // VirtualFreeEx(hProcess, dllPathAddressInRemoteMemory, sizeof module, MEM_RELEASE); - // - // } - // */ - // //MB(Diagnostics::Process::ModuleFileName(hProcess).c_str()); - // //proc.append_format(L"%d %s\n", process.th32ProcessID, Diagnostics::Process::ModuleFileName(hProcess).c_str()); - // break; - // } - // } - // ::CloseHandle(hProcess); - // } - //} - //Windows::Explorer::Restart(); - //ExitExplorer(); break; - } case ID_REG: case ID_UNREG: - // case ID_RESTART: { - int freg = 0; + REGOP reg{}; + reg.RESTART = true; + reg.TREAT = true; if(wParam == ID_REG) - freg |= REG_REGISTER | REG_TREAT; + reg.REGISTER = true; else if(wParam == ID_UNREG) - freg |= REG_UNREGISTER | REG_TREAT; - //else if(wParam == ID_RESTART) - // reg.Restart = true; - return Register(freg, hWnd); + reg.UNREGISTER = true; + return Register(reg, hWnd); } } break; @@ -1362,21 +1110,12 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara case 'E': main_window->SendCommand(ID_EMAIL); break; - case 'B': - main_window->SendCommand(ID_BUG); + case 'G': + main_window->SendCommand(ID_GITHUB); break; case 'D': main_window->SendCommand(ID_DONATE); break; - case 'F': - main_window->SendCommand(ID_FACEBOOK); - break; - case 'T': - main_window->SendCommand(ID_TWITTER); - break; - case 'I': - main_window->SendCommand(ID_REDDIT); - break; } } } @@ -1416,7 +1155,6 @@ BOOL CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, [[maybe_unused]] L L"Examples:\r\nshell.exe -register -treat\r\n" // L"shell.exe -runas:admin -cmd:'cmd.exe' -args:\"/K echo Hello world!\"\r\n" ; - ::SetDlgItemTextW(hwnd, IDC_CMDLINE_TEXT, usage); // SendDlgItemMessage(hwnd, IDC_CMDLINE_TEXT, EM_SETSEL, -1, -1); break; diff --git a/src/setup/build.cmd b/src/setup/build.cmd new file mode 100644 index 0000000..05657e7 --- /dev/null +++ b/src/setup/build.cmd @@ -0,0 +1,29 @@ +@echo off + +echo build setup... +echo. + +set arch=%~1 +set bin=..\..\bin + +if "%~1" == "x86" ( + set arch=x86 +) else if "%~1" == "arm64" ( + set arch=arm64 +) else ( + set arch=x64 +) + +echo %arch% + +if exist %bin%\setup-%arch%.msi del %bin%\setup-%arch%.msi + +echo WIX + +wix.exe --version +echo. +wix.exe build -o %bin%\setup-%arch%.msi setup.wxs -arch %arch% + +if exist %bin%\setup-%arch%.wixpdb del %bin%\setup-%arch%.wixpdb>nul +echo. +pause \ No newline at end of file diff --git a/src/setup/ca/ca.def b/src/setup/ca/ca.def new file mode 100644 index 0000000..d1f1c0c --- /dev/null +++ b/src/setup/ca/ca.def @@ -0,0 +1,9 @@ +;LIBRARY "ca" + +EXPORTS + Install + Uninstall + Update + ;ShellExecute + ValidatePath + diff --git a/src/setup/ca/ca.vcxproj b/src/setup/ca/ca.vcxproj new file mode 100644 index 0000000..e78c1b4 --- /dev/null +++ b/src/setup/ca/ca.vcxproj @@ -0,0 +1,84 @@ + + + + + Release + Win32 + + + Release + x64 + + + Release + ARM64 + + + + {F72D34CA-48DA-4DFD-91A9-A0C78BEF6981} + DynamicLibrary + ca_$(Platform.ToLower().Replace('win32', 'x86')) + Unicode + ca.def + WiX Toolset CustomAction + 10.0 + $(SolutionDir)bin\ + $(ProjectDir)obj\$(Configuration.ToLower())\ + + + + v143 + + + + msi.lib;shlwapi.lib + + + + false + None + + + false + + + + + false + + + None + + + + + false + + + None + + + + + MultiThreaded + MaxSpeed + stdcpp20 + Create + NotUsing + $(IntDir)$(TargetName).pch + + + ca.def + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/setup/ca/dllmain.cpp b/src/setup/ca/dllmain.cpp new file mode 100644 index 0000000..0d7686b --- /dev/null +++ b/src/setup/ca/dllmain.cpp @@ -0,0 +1,390 @@ +#define VC_EXTRALEAN +//#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#pragma comment(lib, "shlwapi.lib") +#pragma comment(lib, "msi.lib") + +template +static void log(const char *format, Args ... args) +{ + /* + using ___snprintfFT = size_t(__stdcall *)(char *, size_t, const char *, Args... args); + if(auto hm = ::GetModuleHandleW(L"msvcrt.dll"); hm) + { + auto ___snprintf = (___snprintfFT)::GetProcAddress(hm, "_snprintf"); + if(___snprintf) + { + auto size = ___snprintf(nullptr, 0, format, args ...); + if(size > 0) + { + std::string buf(size, '\0'); + ___snprintf(buf.data(), size, format, args ...); + ::OutputDebugStringA(buf.c_str()); + } + } + } + */ + auto size = ::_snprintf(nullptr, 0, format, args ...); + if(size > 0) + { + std::string buf(size, '\0'); + ::_snprintf(buf.data(), size, format, args ...); + ::OutputDebugStringA(buf.c_str()); + } +} + +struct MSI +{ + MSIHANDLE hInstall = 0; + + MSI(MSIHANDLE hInstall = 0) + : hInstall{ hInstall } + { + } + + bool get(const wchar_t *name, std::wstring &value) const + { + if(hInstall && name != nullptr) + { + DWORD length = 0; + auto hr = ::MsiGetPropertyW(hInstall, name, nullptr, &length); + if(length > 0) + { + value.resize(length++); + hr = ::MsiGetPropertyW(hInstall, name, value.data(), &length); + return true; + } + } + return false; + } + + + std::wstring InstallFolder() + { + std::wstring result; + get(L"INSTALLFOLDER", result); + return std::move(result); + } + + std::wstring ProductCode() + { + std::wstring result; + get(L"ProductCode", result); + return std::move(result); + } + + bool set(const wchar_t *name, const wchar_t *value) const + { + if(hInstall && name != nullptr) + { + return ERROR_SUCCESS == ::MsiSetPropertyW(hInstall, name, value); + } + return false; + } +}; + +bool streq(const std::wstring &s1, const wchar_t *s2) +{ + return ::memicmp(s1.c_str(), s2, s1.size() * sizeof(wchar_t)) == 0; +} + +#undef ShellExecute + +constexpr auto FILEEXE = L"shell.exe"; +constexpr auto FILEDLL = L"shell.dll"; +constexpr auto FILEOLD = L"shell.old"; + +constexpr auto upgrading = L"UPGRADINGPRODUCTCODE"; + +BOOL ShellExec(const wchar_t *file, const wchar_t *parameters, const wchar_t *directory, bool run_as_admin = false, int nshow = SW_NORMAL, bool wait = false) +{ + SHELLEXECUTEINFOW sei = { }; + sei.cbSize = sizeof(SHELLEXECUTEINFO); + sei.fMask = SEE_MASK_FLAG_NO_UI | (wait ? SEE_MASK_NOCLOSEPROCESS : 0); + sei.lpFile = file; + sei.lpVerb = run_as_admin ? L"runas" : nullptr; + sei.lpParameters = parameters; + sei.lpDirectory = directory; + sei.nShow = nshow; + + auto res = ::ShellExecuteExW(&sei) || (wait && !sei.hProcess); + if(!res) + return res; + + if(!wait) + return res; + + // Wait until child process exits. + MSG msg; + DWORD dw; + while(wait) + { + dw = ::MsgWaitForMultipleObjects(1, &sei.hProcess, FALSE, INFINITE, QS_ALLINPUT); + if(dw != WAIT_OBJECT_0 + 1) + { + // unexpected failure + wait = false; + break; + } + else while(::PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE)) // we have a message - peek and dispatch it + { + if(msg.message == WM_QUIT) + { + wait = false; + break; + } + ::DispatchMessageW(&msg); + } + } + ::CloseHandle(sei.hProcess); + return res; +} + +/* +static BOOL ProcessStart(const wchar_t *application, const wchar_t *parameters, const wchar_t *directory = nullptr, bool wait = false, int showCmd = SW_SHOWNORMAL) +{ + PROCESS_INFORMATION processInfo = { }; + STARTUPINFOW startupInfo = { }; + startupInfo.cb = sizeof(STARTUPINFOW); + startupInfo.wShowWindow = (WORD)showCmd; + startupInfo.dwFlags = STARTF_USESHOWWINDOW; + std::wstring commandLine= parameters; + + auto result = ::CreateProcessW(application, + commandLine.data(), nullptr, nullptr, FALSE, + NORMAL_PRIORITY_CLASS, + nullptr, directory, + &startupInfo, &processInfo); + if(!result) + return FALSE; + + // Wait until child process exits. + if(wait && processInfo.hProcess) + ::WaitForSingleObject(processInfo.hProcess, INFINITE); + + if(processInfo.hThread) + ::CloseHandle(processInfo.hThread); + if(processInfo.hProcess) + ::CloseHandle(processInfo.hProcess); + + return result; +} + +static bool IsDirectoryExists(const std::wstring_view &path) +{ + auto attr = ::GetFileAttributesW(path.data()); + return (attr != UINT32_MAX && (attr & FILE_ATTRIBUTE_DIRECTORY)); +} + +// Checks if a file exists (accessible) +static bool IsFileExists(const std::wstring_view &path) +{ + auto attr = ::GetFileAttributesW(path.data()); + //return (attr != INVALID_FILE_ATTRIBUTES && (!(attr & FILE_ATTRIBUTE_DIRECTORY))); + if(attr == INVALID_FILE_ATTRIBUTES) + { + auto errval = ::GetLastError(); + return (errval != ERROR_FILE_NOT_FOUND) + && (errval != ERROR_PATH_NOT_FOUND) + && (errval != ERROR_INVALID_NAME) + && (errval != ERROR_INVALID_DRIVE) + && (errval != ERROR_NOT_READY) + && (errval != ERROR_INVALID_PARAMETER) + && (errval != ERROR_BAD_PATHNAME) + && (errval != ERROR_BAD_NETPATH); + } + return true; +} +*/ + +static std::wstring JoinPath(const std::wstring &path1, const std::wstring &path2) +{ + std::wstring path = path1; + if(path.size() > 0 && path.back() != L'\\') + { + if(path2.size() > 0 && path2.front() != L'\\') + path += L'\\'; + } + return std::move(path1 + path2); +} + +static bool InstallFolder(MSIHANDLE hInstall, std::wstring& install_folder, bool find_by_reg) +{ + MSI msi(hInstall); + DWORD length = MAX_PATH; + install_folder = msi.InstallFolder(); + if(install_folder.size() == 0) + { + if(find_by_reg) + { + install_folder.resize(MAX_PATH); + auto rc = ::RegGetValueW(HKEY_CLASSES_ROOT, + L"CLSID\\{BAE3934B-8A6A-4BFB-81BD-3FC599A1BAF1}\\InprocServer32", + nullptr, RRF_RT_REG_SZ | KEY_WOW64_64KEY, nullptr, static_cast(install_folder.data()), &length); + if(rc == ERROR_SUCCESS) + { + install_folder.resize(length / sizeof(wchar_t)); + auto p = install_folder.find_last_of(L"\\"); + if(p != install_folder.npos) + { + install_folder = std::move(install_folder.substr(0, p + 1)); + } + } + } + } + return install_folder.size() > 0; +} +/* +bool start(MSIHANDLE hInstall, const wchar_t *parameters, bool run_as_admin, bool wait, bool find_dir_by_reg) +{ + auto result = false; + MSI msi(hInstall); + std::wstring install_folder; + if(InstallFolder(hInstall, install_folder, find_dir_by_reg)) + { + std::wstring sh = std::move(JoinPath(install_folder, FILEEXE)); + result = ShellExec(JoinPath(install_folder, FILEEXE).c_str(), + parameters, install_folder.c_str(), true, SW_HIDE, true); + std::wstring old = std::move(JoinPath(install_folder, FILEOLD)); + if(::PathFileExistsW(old.c_str())) + ::DeleteFileW(old.c_str()); + } + return result; +} +*/ +//MsiGetProperty (hMSI, "CustomActionData", strOurVersion, numSize); +//::MsiSetPropertyW(hInstall, L"MSIRESTARTMANAGERCONTROL", L"Disable"); + +//constexpr auto UninstallKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"; + +UINT __stdcall Install(MSIHANDLE hInstall) +{ + std::wstring install_folder; + if(InstallFolder(hInstall, install_folder, false)) + { + ShellExec(JoinPath(install_folder, FILEEXE).c_str(), + L"-r -s -t -restart", install_folder.c_str(), true, SW_HIDE, true); + + std::wstring old = std::move(JoinPath(install_folder, FILEOLD)); + if(::PathFileExistsW(old.c_str())) + ::DeleteFileW(old.c_str()); + } + return ERROR_SUCCESS; + //return ERROR_INSTALL_FAILURE; +} + +UINT __stdcall Uninstall(MSIHANDLE hInstall) +{ + std::wstring install_folder; + if(InstallFolder(hInstall, install_folder, true)) + { + ShellExec(JoinPath(install_folder, FILEEXE).c_str(), + L"-u -s -t -restart", install_folder.c_str(), true, SW_HIDE, true); + } + return ERROR_SUCCESS; + //return res ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; +} + +UINT __stdcall Update(MSIHANDLE hInstall) +{ + std::wstring install_folder; + if(InstallFolder(hInstall, install_folder, true)) + { + std::wstring dll = std::move(JoinPath(install_folder, FILEDLL)); + std::wstring old = std::move(JoinPath(install_folder, FILEOLD)); + + if(::PathFileExistsW(dll.c_str())) + ::MoveFileW(dll.c_str(), old.c_str()); + + if(::PathFileExistsW(old.c_str())) + ::DeleteFileW(old.c_str()); + } + return ERROR_SUCCESS; +} + +UINT __stdcall ValidatePath(MSIHANDLE hInstall) +{ + HRESULT hr = S_OK; + + BOOL fInstallPathIsRemote = TRUE; + BOOL fInstallPathIsRemoveable = TRUE; + + MSI msi(hInstall); + std::wstring pwszWixUIDir, pwszInstallPath; + if(!msi.get(L"WIXUI_INSTALLDIR", pwszWixUIDir)) + { + log("failed to get WixUI Installation Directory"); + return ERROR_INSTALL_FAILURE; + } + + if(!msi.get(pwszWixUIDir.c_str(), pwszInstallPath)) + { + log("failed to get Installation Directory"); + return ERROR_INSTALL_FAILURE; + } + + std::wstring pStrippedTargetFolder = pwszInstallPath; + + // Terminate the path at the root + if(!::PathStripToRootW(pStrippedTargetFolder.data())) + { + hr = HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE); + if(FAILED(hr)) + { + log("failed to parse target folder"); + return hr; + } + } + + auto drive_type = ::GetDriveTypeW(pStrippedTargetFolder.c_str()); + + fInstallPathIsRemote = (DRIVE_REMOTE == drive_type); + fInstallPathIsRemoveable = ((DRIVE_CDROM == drive_type) || (DRIVE_REMOVABLE == drive_type) || (DRIVE_RAMDISK == drive_type) || (DRIVE_UNKNOWN == drive_type)); + + // If the path does not point to a network drive, mapped drive, or removable drive, + // then set WIXUI_INSTALLDIR_VALID to "1" otherwise set it to 0 + BOOL fInstallPathIsUnc = ::PathIsUNCW(pwszInstallPath.c_str()); + if(!fInstallPathIsUnc && !fInstallPathIsRemote && !fInstallPathIsRemoveable) + { + // path is valid + if(!msi.set(L"WIXUI_INSTALLDIR_VALID", L"1")) + { + log("failed to set WIXUI_INSTALLDIR_VALID"); + return ERROR_INSTALL_FAILURE; + } + } + else + { + // path is invalid; we can't log it because we're being called from a DoAction control event + // but we can at least call WcaLog to get it to write to the debugger from a debug build + log("Installation path %ls is invalid: it is %s UNC path, %s remote path, or %s path on a removable drive, and must be none of these.", + pwszInstallPath.c_str(), fInstallPathIsUnc ? "a" : "not a", fInstallPathIsRemote ? "a" : "not a", fInstallPathIsRemoveable ? "a" : "not a"); + + if(!msi.set(L"WIXUI_INSTALLDIR_VALID", L"0")) + { + log("failed to set WIXUI_INSTALLDIR_VALID"); + return ERROR_INSTALL_FAILURE; + } + } + return ERROR_SUCCESS; +} + +extern "C" BOOL WINAPI DllMain(IN HINSTANCE hInst, IN ULONG ulReason, IN LPVOID) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + break; + + case DLL_PROCESS_DETACH: + break; + } + + return TRUE; +} + + diff --git a/src/setup/wix/res/WixUI_Banner.png b/src/setup/wix/res/WixUI_Banner.png new file mode 100644 index 0000000..5437659 Binary files /dev/null and b/src/setup/wix/res/WixUI_Banner.png differ diff --git a/src/setup/wix/res/WixUI_Bmp_New.bmp b/src/setup/wix/res/WixUI_Bmp_New.bmp new file mode 100644 index 0000000..27881df Binary files /dev/null and b/src/setup/wix/res/WixUI_Bmp_New.bmp differ diff --git a/src/setup/wix/res/WixUI_Bmp_Up.bmp b/src/setup/wix/res/WixUI_Bmp_Up.bmp new file mode 100644 index 0000000..86f6b5a Binary files /dev/null and b/src/setup/wix/res/WixUI_Bmp_Up.bmp differ diff --git a/src/setup/wix/res/WixUI_Dialog.png b/src/setup/wix/res/WixUI_Dialog.png new file mode 100644 index 0000000..3dc49c0 Binary files /dev/null and b/src/setup/wix/res/WixUI_Dialog.png differ diff --git a/src/setup/wix/res/WixUI_Ico_Exclam.ico b/src/setup/wix/res/WixUI_Ico_Exclam.ico new file mode 100644 index 0000000..906ce32 Binary files /dev/null and b/src/setup/wix/res/WixUI_Ico_Exclam.ico differ diff --git a/src/setup/wix/res/WixUI_Ico_Info.ico b/src/setup/wix/res/WixUI_Ico_Info.ico new file mode 100644 index 0000000..7e0ff7f Binary files /dev/null and b/src/setup/wix/res/WixUI_Ico_Info.ico differ diff --git a/src/setup/wix/setup.wixproj b/src/setup/wix/setup.wixproj new file mode 100644 index 0000000..06f7dde --- /dev/null +++ b/src/setup/wix/setup.wixproj @@ -0,0 +1,7 @@ + + + Package + ..\..\bin\ + setup-$(Platform.ToLower().Replace('win32', 'x86')) + + diff --git a/src/setup/wix/setup.wxs b/src/setup/wix/setup.wxs new file mode 100644 index 0000000..286a481 --- /dev/null +++ b/src/setup/wix/setup.wxs @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/setup/wix/ui.wxi b/src/setup/wix/ui.wxi new file mode 100644 index 0000000..3ed0463 --- /dev/null +++ b/src/setup/wix/ui.wxi @@ -0,0 +1,747 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file