-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debugging option to identify IPv6 configurations and remind users…
… it is slow.
- Loading branch information
1 parent
c1a6337
commit 3c736ab
Showing
8 changed files
with
306 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[MRU List] | ||
MRU1=C:\Users\corey\OneDrive\Documents\workspace\libraries\oss\coreybutler\nvm-windows\dist\nvm.exe | ||
MRU2=C:\Users\corey\nvm test\nvm.exe | ||
MRU3= | ||
MRU4= | ||
MRU5= | ||
MRU6= | ||
MRU7= | ||
MRU8= | ||
|
||
[Setup] | ||
left=4150 | ||
top=798 | ||
width=1200 | ||
height=660 | ||
MaximizedState=0 | ||
MenuEditMode=0 | ||
DisableGridlines=0 | ||
vsplit=300 | ||
LastDir=C:\Users\corey\OneDrive\Documents\workspace\libraries\oss\coreybutler\nvm-windows\dist | ||
ToolbarSize=3 | ||
|
||
[MonospaceFont] | ||
Name=Courier New | ||
Size=9 | ||
Color=-16777208 | ||
Style=0 | ||
|
||
[Font] | ||
Name=Tahoma | ||
Size=9 | ||
Color=-16777208 | ||
CharSet=1 | ||
Style=0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module iconize | ||
|
||
go 1.20 | ||
|
||
require ( | ||
github.com/coreybutler/go-fsutil v1.2.1 | ||
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 | ||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e | ||
) | ||
|
||
require ( | ||
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 // indirect | ||
gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/coreybutler/go-fsutil v1.2.1 h1:HlnBaPgJAYEDUwQu5zc1MzmaWtB6OSvIWLXnTA11g18= | ||
github.com/coreybutler/go-fsutil v1.2.1/go.mod h1:tLG9p9LcRVBiKWtG8HC7btUpRY7uvl4xqEnCYagf0qc= | ||
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 h1:NVRJ0Uy0SOFcXSKLsS65OmI1sgCCfiDUPj+cwnH7GZw= | ||
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= | ||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e h1:H+t6A/QJMbhCSEH5rAuRxh+CtW96g0Or0Fxa9IKr4uc= | ||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk= | ||
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13 h1:5jaG59Zhd+8ZXe8C+lgiAGqkOaZBruqrWclLkgAww34= | ||
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc= | ||
gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
"os/exec" | ||
"syscall" | ||
|
||
fs "github.com/coreybutler/go-fsutil" | ||
) | ||
|
||
const ( | ||
LR_LOADFROMFILE = 0x00000010 | ||
LR_DEFAULTSIZE = 0x00000040 | ||
IMAGE_ICON = 1 | ||
LR_DEFAULTCOLOR = 0x00000000 | ||
RT_ICON = 3 | ||
) | ||
|
||
var ( | ||
modUser32 = syscall.NewLazyDLL("user32.dll") | ||
procDestroyIcon = modUser32.NewProc("DestroyIcon") | ||
modKernel32 = syscall.NewLazyDLL("kernel32.dll") | ||
procUpdateResourceW = modKernel32.NewProc("UpdateResourceW") | ||
procBeginUpdateResource = modKernel32.NewProc("BeginUpdateResourceW") | ||
procEndUpdateResource = modKernel32.NewProc("EndUpdateResourceW") | ||
procLoadImageW = modUser32.NewProc("LoadImageW") | ||
) | ||
|
||
func main() { | ||
if len(os.Args) != 3 { | ||
log.Println("Incorrect number of arguments. Expected 2: iconize <file> <icon>") | ||
os.Exit(1) | ||
} | ||
|
||
exePath := fs.Abs(os.Args[1]) | ||
iconPath := fs.Abs(os.Args[2]) | ||
|
||
if !fs.Exists(exePath) { | ||
log.Fatal(exePath + " does not exist") | ||
} | ||
|
||
if !fs.Exists(iconPath) { | ||
log.Fatal(iconPath + " does not exist") | ||
} | ||
|
||
// Run Resource Hacker command to modify the icon | ||
cmd := exec.Command("../ResourceHacker.exe", "-open", exePath, "-save", exePath, "-action", "modify", "-resource", iconPath, "-mask", "ICONGROUP,MAINICON,", "-log", "NUL") | ||
err := cmd.Run() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Println("Icon associated with EXE file successfully!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters