I am trying to add a custom page to a PA.c generated installer (0.91.5) but when I get to the custom page the Back, Next and Cancel buttons are inactive and I have to use task manager to kill the install. Here is the code that I am trying this out with which is almost a direct copy from one of the example files included with NSISPortable.
!include LogicLib.nsh
!include nsDialogs.nsh
XPStyle on
Page license
Page custom nsDialogsPage
Var BUTTON
Var EDIT
Var CHECKBOX
!macro CustomCodePostInstall
Call nsDialogsPage
CustomCodePostInstallEnd:
!macroend
Function nsDialogsPage
nsDialogs::Create 1018
Pop $0
GetFunctionAddress $0 OnBack
nsDialogs::OnBack $0
${NSD_CreateButton} 0 0 100% 12u Test
Pop $BUTTON
GetFunctionAddress $0 OnClick
nsDialogs::OnClick $BUTTON $0
${NSD_CreateText} 0 35 100% 12u hello
Pop $EDIT
GetFunctionAddress $0 OnChange
nsDialogs::OnChange $EDIT $0
${NSD_CreateCheckbox} 0 -50 100% 8u Test
Pop $CHECKBOX
GetFunctionAddress $0 OnCheckbox
nsDialogs::OnClick $CHECKBOX $0
${NSD_CreateLabel} 0 40u 75% 40u "* Type `hello there` above.$\n* Click the button.$\n* Check the checkbox.$\n* Hit the Back button."
Pop $0
nsDialogs::Show
FunctionEnd
Function OnClick
Pop $0 # HWND
MessageBox MB_OK clicky
FunctionEnd
Function OnChange
Pop $0 # HWND
System::Call user32::GetWindowText(i$EDIT,t.r0,i${NSIS_MAX_STRLEN})
${If} $0 == "hello there"
MessageBox MB_OK "right back at ya"
${EndIf}
FunctionEnd
Function OnBack
MessageBox MB_YESNO "are you sure?" IDYES +2
Abort
FunctionEnd
Function OnCheckbox
Pop $0 # HWND
MessageBox MB_OK "checkbox clicked"
FunctionEnd
Any NSDialogs wizards know what is going wrong?
Many many thanks
You can't add custom pages to the PortableApps.com Installer. It's purposely designed to be basic and easy for both developers and users.
You actually can't make any changes to the generated code of the PortableApps.com Installer unless you're going to release it under the GPL (and only package GPL apps) and remove the branding (ie, it can't be a PortableApps.com Installer).
What is it exactly you're trying to do? There may be another way.
Sometimes, the impossible can become possible, if you're awesome!
I was using the built in ability to add post install code via adding a file named PortableApps.comInstallerCustom.nsh in much the same way as other official PortableApps. Difference being that I was hoping to get some input from the user to tweak the actions of CustomCodePostInstall
If including custom code via the PortableApps.comInstallerCustom.nsh file is not a kosher method for tweaking the install process I apologize. I went down this path due to the number of official apps that I saw that use this tool.
Minor tangent. The CommonFiles GnuPG installation I have been working on I uses PortableApps.comInstallerCustom.nsh to do the following
so that the key rings are stored in a place that is backed up by PortableAppsBackup.
Is this code a problem?
Thank you for your time.
Key ID: 0xDAE3095F
Fingerprint: 5D98 65D2 1844 21A5 76C1 F0F6 4BE6 D689 DAE3 095F
Ah, ok. The custom code isn't intended for pages. We're limiting things to the current set of pages, all of which can be easily automated with the updater. Everything outside of the existing pages and prompts should be entirely automatic with no further pages or messageboxes to the user.
Why would you need to generate GnuPGPortable.nsh on the fly?
Sometimes, the impossible can become possible, if you're awesome!
GnuPGPortable.nsh isn't generated on the fly. Just whether or not to put a copy of GnuPGPortable.nsh in the NSISPortable include directory. I will remove the message box and just add directions to the readme on adding GnuPGPortable.nsh to NSISPortable until they both move to official. (big humble imploring smile)
The other project is a wrapper that when invoked will mount a truecrypt container file, launch a portableapp from it then wait for the portable app to exit after which it will dismount the tc file. The wrapper's ini settings are specific to each instance and I was hoping to set them during install. But I think I have a different approach that is working. I will be posting the code later today.
Again thank you for your time an attention.
Key ID: 0xDAE3095F
Fingerprint: 5D98 65D2 1844 21A5 76C1 F0F6 4BE6 D689 DAE3 095F
Ah, lets's do an independent plugin installer for GnuPGPortable.nsh as an NSIS Portable add-on for now. I think that will make the most sense. I'm not sure if we'll think of GnuPGPortable as a CommonFiles add-on. Maybe as an independent app that stuff like TB Portable can utilize. GPGP does have it's own app within it that should be on the PA.c Menu does it not? Which do you think makes the most sense?
The second thing is more about the launcher for your app itself, so it wouldn't really be affected by the installer. I'm curious to see what it is and look forward to your post
Sometimes, the impossible can become possible, if you're awesome!
Sounds good. I'll split it out that way.
Not exactly. It's kinda like Java. No NSIS launcher executable. There are exes, but they are just command line programs that are mostly meant to be called in the background by other apps.
PAF.tc is up!
thanks for all the feedback. It has been very helpful
Key ID: 0xDAE3095F
Fingerprint: 5D98 65D2 1844 21A5 76C1 F0F6 4BE6 D689 DAE3 095F