简体   繁体   English

带有 electron builder nsis 的默认不受欢迎页面无法更改或删除

[英]default unwelcome page with electron builder nsis can't be changed or removed

Electron-Builder Version: 22.14.5 Node Version: 16.15.1 Electron Version: 18.3.0 Electron Type (current, beta, nightly): current Electron-Builder 版本:22.14.5 节点版本:16.15.1 Electron 版本:18.3.0 Electron 类型(当前,测试版,每晚):当前

Target: win nsis ia32 based on this PR #1173目标:基于此 PR #1173 赢得 nsis ia32

Hi, based on this feature, it seems there is an issue to interact with the unwelcome page.嗨,基于此功能,与不受欢迎的页面交互似乎存在问题。 by default when we use electron builder with nsis, we have now during the uninstallation, the unwelcome page and the unfinish page like you described bellow.默认情况下,当我们将 electron builder 与 nsis 一起使用时,我们现在在卸载过程中会出现如下所述的不受欢迎页面和未完成页面。 And it's cool but we didn't interact with them like this这很酷,但我们没有像这样与他们互动

.define MUI_PAGE_CUSTOMFUNCTION_PRE un.custom_pre_page !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.custom_leave_page !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TITLE 'unwelcome_title' !define MUI_WELCOMEPAGE_TEXT 'unwelcome_text' !insertmacro MUI_UNPAGE_WELCOME .define MUI_PAGE_CUSTOMFUNCTION_PRE un.custom_pre_page !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.custom_leave_page !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TITLE 'unwelcome_title' !define MUI_WELCOMEPAGE_TEXT 'unwelcome_PAGEWELUNE_

so when we have are in a language where the default text is too long we don't have the 3 lines.因此,当我们使用默认文本太长的语言时,我们没有 3 行。 and we can't change the text.我们不能改变文本。 see the screenshot.看截图。

I've test many ways to solve it, manage anothe unpage welcome and it works for the othe page but the default page that you added is never removed.我已经测试了许多解决它的方法,管理另一个取消页面欢迎,它适用于其他页面,但您添加的默认页面永远不会被删除。 I tried to manipulate the window item to hide it, try to click on the next button with a command to navigate but it doesn't work.我试图操纵 window 项目来隐藏它,尝试使用命令单击下一步按钮进行导航,但它不起作用。 And I verified that handles are correct.我验证了句柄是正确的。

so what it the solution in this context to interact with your unwelcome page or to remove it?那么在这种情况下与您不受欢迎的页面交互或删除它的解决方案是什么? thanks in advance提前致谢

Electron-Builder Version: 22.14.5 Node Version: 16.15.1 Electron Version: 18.3.0 Electron Type (current, beta, nightly): current Electron-Builder 版本:22.14.5 节点版本:16.15.1 Electron 版本:18.3.0 Electron 类型(当前,测试版,每晚):当前

Target: win nsis ia32 based on this PR #1173目标:基于此 PR #1173 赢得 nsis ia32

Hi, based on this feature, it seems there is an issue to interact with the unwelcome page.嗨,基于此功能,与不受欢迎的页面交互似乎存在问题。 by default when we use electron builder with nsis, we have now during the uninstallation, the unwelcome page and the unfinish page like you described bellow.默认情况下,当我们将 electron builder 与 nsis 一起使用时,我们现在在卸载过程中会出现如下所述的不受欢迎页面和未完成页面。 And it's cool but we didn't interact with them like this这很酷,但我们没有像这样与他们互动

.define MUI_PAGE_CUSTOMFUNCTION_PRE un.custom_pre_page !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.custom_leave_page !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TITLE 'unwelcome_title' !define MUI_WELCOMEPAGE_TEXT 'unwelcome_text' !insertmacro MUI_UNPAGE_WELCOME .define MUI_PAGE_CUSTOMFUNCTION_PRE un.custom_pre_page !define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.custom_leave_page !define MUI_WELCOMEPAGE_TITLE_3LINES !define MUI_WELCOMEPAGE_TITLE 'unwelcome_title' !define MUI_WELCOMEPAGE_TEXT 'unwelcome_PAGEWELUNE_

so when we have are in a language where the default text is too long we don't have the 3 lines.因此,当我们使用默认文本太长的语言时,我们没有 3 行。 and we can't change the text.我们不能改变文本。 see the screenshot.看截图。

I've test many ways to solve it, manage anothe unpage welcome and it works for the othe page but the default page that you added is never removed.我已经测试了许多解决它的方法,管理另一个取消页面欢迎,它适用于其他页面,但您添加的默认页面永远不会被删除。 I tried to manipulate the window item to hide it, try to click on the next button with a command to navigate but it doesn't work.我试图操纵 window 项目来隐藏它,尝试使用命令单击下一步按钮进行导航,但它不起作用。 And I verified that handles are correct.我验证了句柄是正确的。

so what it the solution in this context to interact with your unwelcome page or to remove it?那么在这种情况下与您不受欢迎的页面交互或删除它的解决方案是什么? thanks in advance提前致谢

https://github.com/electron-userland/electron-builder/issues/6987 https://github.com/electron-userland/electron-builder/issues/6987

screenshot截屏

after searched deeper, I can see in the electron-builder code (after cloning the repo) that the assistedInstaller.nsh managed the uninstaller as is经过深入搜索后,我可以在电子生成器代码中(克隆存储库后)看到 assistedInstaller.nsh 按原样管理卸载程序

...
!else
  !insertmacro MUI_UNPAGE_WELCOME
  !ifndef INSTALL_MODE_PER_ALL_USERS
    !insertmacro PAGE_INSTALL_MODE
  !endif
  !insertmacro MUI_UNPAGE_INSTFILES
  !ifmacrodef customUninstallPage
    !insertmacro customUninstallPage
  !endif
  !insertmacro MUI_UNPAGE_FINISH
!endif

the.insertmacro MUI_UNPAGE_WELCOME is added without condition whereas the customWelcomePage is added with a condition. the.insertmacro MUI_UNPAGE_WELCOME 是无条件添加的,而 customWelcomePage 是有条件添加的。 I guess it's the root cause of my problem.我想这是我问题的根本原因。 If I try to add a custom unwelcome page like this如果我尝试添加这样的自定义不受欢迎页面

!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.ModifyUnWelcome
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.LeaveUnWelcome
!insertmacro MUI_UNPAGE_WELCOME

Var mycheckbox ;

Function un.ModifyUnWelcome
 ${NSD_CreateCheckbox} 120u -18u 50% 12u "Clean Configuration"
 Pop $mycheckbox
 SetCtlColors {MUI_BGCOLOR}
 ${NSD_Check} $mycheckbox ; Check it by default
FunctionEnd

Function un.LeaveUnWelcome
 ${NSD_GetState} $mycheckbox $0
 ${If} $0 <> 0
  MessageBox MB_TOPMOST 'We remove configuration'
 ${EndIf}
FunctionEnd

I have my custom unwelcomePage, but when click on next I go to the second unwelcome page placed in the assistedInstaller.nsh我有我的自定义 unwelcomePage,但是当单击 next 我 go 到第二个不受欢迎的页面放置在 assistedInstaller.nsh

And I have no ways to change this file.而且我无法更改此文件。

if someone knows how to manage this file.如果有人知道如何管理这个文件。 I guess that I must rebuild electron-builder with a change for that but It will be better that electron-builder team fix the problem isn't it?我想我必须为此进行更改来重建电子制造商,但是电子制造商团队解决问题会更好,不是吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM