Skip to content
New issue

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

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

Already on GitHub? # to your account

winget support? #574

Closed
MerrickZ opened this issue Dec 25, 2022 · 24 comments
Closed

winget support? #574

MerrickZ opened this issue Dec 25, 2022 · 24 comments

Comments

@MerrickZ
Copy link

Hi there,
just found this amazing notepad2-mod with EXTRA features
could you make it available in Winget?
Thanks.

Winget search notepad2 now have only one item which is notepad2-mod.

@KaiHuaDou
Copy link

KaiHuaDou commented Jul 14, 2023

Notepad2 still needs an installer to support winget though the winget support "zip install mode", which is just extract the installer from the zip file.

This might be a possible version of the manifests (Treat Notepad2.exe as the installer):
4.23.06r4862.zip

@MerrickZ
Copy link
Author

how about this?
https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/Gyan/FFmpeg/6.0

@zufuliu
Copy link
Owner

zufuliu commented Jul 17, 2023

Then some one would need to make a PR to add manifests files into winget repo?

@MerrickZ
Copy link
Author

Then some one would need to make a PR to add manifests files into winget repo?

well, I hope someone could integrate it with Github Actions to automatically send PR to winget repo, still don't know how to do it for now :(

@MerrickZ
Copy link
Author

microsoft/winget-pkgs#118013
Tried, waiting for approval.

@MerrickZ
Copy link
Author

done.
use:
winget install -e "Notepad2"
or
winget install zufuliu.notepad2
to install, don't know how to add start menu entry yet.

@zufuliu
Copy link
Owner

zufuliu commented Aug 26, 2023

Thanks 👍, will add these instructions on release page.

@zufuliu zufuliu added this to the v4.23.08.1 milestone Aug 26, 2023
@jay-ramani
Copy link

done. use: winget install -e "Notepad2" or winget install zufuliu.notepad2 to install, don't know how to add start menu entry yet.

Getting a package not found error with both methods:

Microsoft Windows [Version 10.0.22621.2428]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>winget install -e "Notepad2"
Failed in attempting to update the source: winget
No package found matching input criteria.

C:\Windows\System32>winget install zufuliu.notepad2
Failed in attempting to update the source: winget
No package found matching input criteria.

@MerrickZ
Copy link
Author

MerrickZ commented Nov 9, 2023

Microsoft should be blamed for this.
Some helpful tips maybe:

  1. Use a system proxy
  2. Change your DNS

@MerrickZ
Copy link
Author

updated winget to latest version

@jay-ramani
Copy link

Microsoft should be blamed for this. Some helpful tips maybe:

1. Use a system proxy

2. Change your DNS

updated winget to latest version

done. use: winget install -e "Notepad2" or winget install zufuliu.notepad2 to install, don't know how to add start menu entry yet.

Getting a package not found error with both methods:

Microsoft Windows [Version 10.0.22621.2428]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>winget install -e "Notepad2"
Failed in attempting to update the source: winget
No package found matching input criteria.

C:\Windows\System32>winget install zufuliu.notepad2
Failed in attempting to update the source: winget
No package found matching input criteria.

Still getting this same error. Is anyone else running into the same?

@zufuliu, is it working for you?

@zufuliu
Copy link
Owner

zufuliu commented Nov 22, 2023

@zufuliu, is it working for you?

Sorry, but I don't know.

@jay-ramani
Copy link

@zufuliu, is it working for you?

Sorry, but I don't know.

Can you try two commands in

done. use: winget install -e "Notepad2" or winget install zufuliu.notepad2 to install, don't know how to add start menu entry yet.

and confirm?

Thanks.

@MerrickZ
Copy link
Author

image
winget install -e "Notepad2" Failed because there's another notepad2-mod, while winget install zufuliu.notepad2 works.
You'd try to use some VPN to bypass GFW in order to access winget database.

@jay-ramani
Copy link

Is that Chinese? Sorry, I don't understand that language, but thanks for confirming

winget install zufuliu.notepad2

works

@Mapaler
Copy link

Mapaler commented Dec 2, 2024

我是多用户环境,目前Notepad4安装范围是user,但注册表替换是machine范围,因为路径不同,其他用户会打开失败。
所以我希望安装到一个共用位置,这样我才能使用注册表替换系统Notepad。

I am in multi-user environment, currently Notepad4 installation scope is user, but registry replacement is machine scope, because the path is different, other users will fail to open.
So I'd like to install to a common location so I can replace the system Notepad with the registry.

名称            ID                    版本       源
--------------------------------------------------------
Notepad4 (AVX2) zufuliu.notepad4.AVX2 24.11r5548 winget

Can't uninstall/upgrade by ID

I cannot uninstall this installation using the uninstall command.

WindowsTerminal_管理员_命令提示符_0915
WindowsTerminal_管理员_Windows_PowerShell_0918

PS C:\Users\Mapaler> winget install --id zufuliu.notepad4.AVX2
已找到 Notepad4 (AVX2) [zufuliu.notepad4.AVX2] 版本 24.11r5548
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
添加了命令行别名: "Notepad4"
添加了命令行别名: "matepath"
已成功安装
PS C:\Users\Mapaler> winget uninstall --id zufuliu.notepad4.AVX2
找不到与输入条件匹配的已安装程序包。
PS C:\Users\Mapaler> winget upgrade --id zufuliu.notepad4.AVX2
找不到与输入条件匹配的已安装程序包。

The path is not automatically changed

After the installation location is specified, the address added to the path is still the default address, which makes it impossible to use the Notepad4 alias.

WindowsTerminal_Windows_PowerShell_0917
SystemPropertiesAdvanced_编辑环境变量_0916

PS C:\Users\Mapaler> winget install --id zufuliu.notepad4.AVX2 --location C:\ProgramFree\Notepad2
已找到 Notepad4 (AVX2) [zufuliu.notepad4.AVX2] 版本 24.11r5548
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
添加了命令行别名: "Notepad4"
添加了命令行别名: "matepath"
已成功安装
PS C:\Users\Mapaler> Notepad4
Notepad4 : 无法将“Notepad4”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保
路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ Notepad4
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Notepad4:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

After upgrading, it will return to the default path

If I modify the installation path with the --location parameter, the next time I upgrade with upgrade, the folder will be deleted and returned to the previous default path.

explorer_Notepad2_0919
explorer_zufuliu notepad4 AVX2_Microsoft Winget Source_8wek_0920

PS C:\Users\Mapaler> winget install --id zufuliu.notepad4.AVX2 --location C:\ProgramFree\Notepad2 --scope machine --version "24.09r5472"
已找到 Notepad4 (AVX2) [zufuliu.notepad4.AVX2] 版本 24.09r5472
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
添加了命令行别名: "Notepad4"
添加了命令行别名: "matepath"
已成功安装
PS C:\Users\Mapaler> winget upgrade --name "Notepad4 (AVX2)" --force
已找到 Notepad4 (AVX2) [zufuliu.notepad4.AVX2] 版本 24.11r5548
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
添加了命令行别名: "Notepad4"
添加了命令行别名: "matepath"
已成功安装

@jay-ramani
Copy link

jay-ramani commented Dec 2, 2024

Warning to everyone:

winget install zufuliu.notepad4

resets all the configuration to default (by overwriting the .ini files)! Luckily, I had a backup of my settings.

@MerrickZ
Copy link
Author

MerrickZ commented Dec 7, 2024

Yes, that's true.
I've tried several ways to avoid this, but maybe the best and easiest way is to move .ini files to %appdata% , which requires @zufuliu to change source code.

@zufuliu
Copy link
Owner

zufuliu commented Dec 7, 2024

which requires @zufuliu to change source code.

following is the order looking for INI files, put INI file in %appdata% will work when no INI in exe folder.

notepad4/src/Notepad4.cpp

Lines 6441 to 6447 in 1c2360f

// program directory
lstrcpy(tchBuild, lpszModule);
lstrcpy(PathFindFileName(tchBuild), tchFileExpanded);
if (PathIsFile(tchBuild)) {
lstrcpy(lpszFile, tchBuild);
return true;
}

notepad4/src/Notepad4.cpp

Lines 6469 to 6479 in 1c2360f

// %LOCALAPPDATA%
// C:\Users\<username>\AppData\Local
// C:\Documents and Settings\<username>\Local Settings\Application Data
CSIDL_LOCAL_APPDATA,
// %APPDATA%
// C:\Users\<username>\AppData\Roaming
// C:\Documents and Settings\<username>\Application Data
CSIDL_APPDATA,
// Home
// C:\Users\<username>
CSIDL_PROFILE,

@Mapaler
Copy link

Mapaler commented Dec 7, 2024

which requires @zufuliu to change source code.这需要更改源代码。

following is the order looking for INI files, put INI file in %appdata% will work when no INI in exe folder.以下是查找 INI 文件的顺序,当 exe 文件夹中没有 INI 时,将 INI 文件放入 %appdata% 中将起作用。

notepad4/src/Notepad4.cpp

Lines 6441 to 6447 in 1c2360f

// program directory
lstrcpy(tchBuild, lpszModule);
lstrcpy(PathFindFileName(tchBuild), tchFileExpanded);
if (PathIsFile(tchBuild)) {
lstrcpy(lpszFile, tchBuild);
return true;
}

notepad4/src/Notepad4.cpp

Lines 6469 to 6479 in 1c2360f

// %LOCALAPPDATA%
// C:\Users\<username>\AppData\Local
// C:\Documents and Settings\<username>\Local Settings\Application Data
CSIDL_LOCAL_APPDATA,
// %APPDATA%
// C:\Users\<username>\AppData\Roaming
// C:\Documents and Settings\<username>\Application Data
CSIDL_APPDATA,
// Home
// C:\Users\<username>
CSIDL_PROFILE,

应该是 Winget 配置为 protable,只是把 zip 简单的解压。zip 里有 ini 就无法解决。

https://github.com/microsoft/winget-pkgs/blob/35963bb33050cdbe027fa955a700228548c68986/manifests/z/zufuliu/notepad4/24.11r5548/zufuliu.notepad4.installer.yaml#L5-L6

@jay-ramani
Copy link

Yes, that's true. I've tried several ways to avoid this, but maybe the best and easiest way is to move .ini files to %appdata% , which requires @zufuliu to change source code.

Agree. %APPDATA% is the best way to have this implemented.

@zufuliu, at present, there's no directory created in %APPDATA% with Notepad4. Given that we don't have an installer (and have to instead rely on external programs like Notepad Replacer), do you want to have the directory created (if not already existing) in the program when it begins execution (initialization)?

Hope to have this issue fixed, which otherwise makes it very convenient with winget.

Cheers folks.

@zufuliu
Copy link
Owner

zufuliu commented Dec 8, 2024

have to instead rely on external programs

You can use Settings -> Advanced Settings -> System Integration.
image

@jay-ramani
Copy link

have to instead rely on external programs

You can use Settings -> Advanced Settings -> System Integration. image

I already have this enabled, but it doesn't seem to create a directory under %APPDATA%

1 similar comment
@jay-ramani
Copy link

have to instead rely on external programs

You can use Settings -> Advanced Settings -> System Integration. image

I already have this enabled, but it doesn't seem to create a directory under %APPDATA%

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants