【发布时间】:2012-12-08 17:28:34
【问题描述】:
我使用 NSIS 脚本创建了 EXE 文件。我使用以下代码创建了自定义页面,
page custom check
Function check
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My app" "UninstallString"
IfFileExists $R0 +1 NotInstalled
call nsDialogpage
NotInstalled:
FunctionEnd
Function nsDialogpage
nsDialogs::Create 1018
Pop $Dialog12
${If} $Dialog12 == error
Abort
${EndIf}
${NSD_CreateRadioButton} 0 5u 100% 10u "Repair"
Pop $Repair
${NSD_CreateRadioButton} 0 25u 100% 56u "Remove"
Pop $Remove
${NSD_SetState} $Repair ${BST_CHECKED}
${NSD_GetState} $Repair $test
--Do repair operation--
${NSD_OnClick} $Remove "Remove"
nsDialogs::Show
${NSD_GetState} $Remove $RadioButton_State
${If} $RadioButton_State == ${BST_CHECKED}
call Removed
${Else}
Goto Done
${EndIf}
Done:
FunctionEnd
Function Remove
nsDialogs::Create 1018
Pop $Dialog12
${If} $Dialog12 == error
Abort
${EndIf}
--Do remove function--
/* nsDialogs::Show*/
FunctionEnd
如果我运行上面的代码,它不起作用。在显示函数之后没有执行任何代码。如果我在 functionEnd 之前给出显示函数,它会抛出运行时异常。因为在 Remove 函数内部还有一个 show()。
我的要求是,
如果用户单击删除单选按钮,则转到下一页并执行卸载过程,页面结束。我已经使用上面的代码尝试了这种情况。但它工作正常。
如何在 nsis 安装程序中包含两个自定义页面?
谁能帮帮我?
谢谢。
【问题讨论】:
-
为什么删掉老问题,基本上又问同样的问题?
-
这个问题不太清楚。这就是我发布这个的原因
-
如果您发布人们可以编译的代码会更清楚,在这种情况下,这至少意味着页面说明......
标签: nsis