Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperlinking (in Windows) #907

Closed
brandoncomputer opened this issue Dec 22, 2017 · 1 comment
Closed

Hyperlinking (in Windows) #907

brandoncomputer opened this issue Dec 22, 2017 · 1 comment

Comments

@brandoncomputer
Copy link

There is never a good way to release a shim or front end. Only halfway good attempts.

Regard link. dat.zip
`
#dat.ps1
#window flash unresolvable. See PowerShell/PowerShell#3028
#Run this script once with no parameters to "installl" this protocol. This will allow the hyperlinking of dat:// within most web browsers in windows - with the most notable exception being Edge.

param([string]$uri)
$invocation = (Get-Variable MyInvocation).Value
$invocationpath = '"' + $invocation.MyCommand.Path + '"'

New-Item 'HKCU:\Software\Classes\Dat' -Force | New-ItemProperty -Name "(Default)" -Value "Dat Uri" -Force | New-ItemProperty -Name "URL Protocol" -Value "" -Force | New-ItemProperty -Name "Content Type" -Value "application/x-dat" -Force | Out-Null
New-Item 'HKCU:\Software\Classes\Dat\shell' -Force | New-ItemProperty -Name "(Default)" -Value "open" -Force | Out-Null
New-Item 'HKCU:\Software\Classes\Dat\shell\open\command' -Force | New-ItemProperty -Name "(Default)" -Value ""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"-windowstyle Hidden -nologo -executionpolicy bypass -sta -file $invocationpath -uri"%1"` " -Force | Out-Null

$directorypath = Split-Path $invocation.MyCommand.Path
$filepath = $directorypath + '' + $uri.TrimStart("dat://")
cd $directorypath

#twice on purpose. Once to clone, once to watch changes.
Start-Process -filePath dat -Argumentlist "clone $uri" -passthru -NoNewWindow
Start-Process -filePath dat -Argumentlist "clone $uri" -passthru -NoNewWindow

sleep 1
Invoke-Item $filepath
`

@okdistribute
Copy link
Collaborator

We need more information to debug this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants