Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 7th November 2008, 09:51   #1
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
semi-silent installer and InstFiles

I'm currently making an installer semi-silent by allowing for unattended installation using a sort of 'preferences file'.

When a preference is invalid or missing, I still want the user interface to show up - which seems to exclude a silent installer as I can't switch silent mode anywhere outside of .onInit.

So instead for any page where I do have a valid 'preference', I simply call Abort in the Pre function so that the page never shows, and set any variables/etc. to the appropriate values based on the preference which might otherwise be handled in any Post function.

This all works quite lovely, but then in comes the special InstFiles page. Calling Abort in its Pre or Show (does it even have one - using MUI?) functions does absolutely bupkis.
I can stick HideWindow in the pre function, or in the first section, but that will still flash InstFiles onto the screen for a fraction of a second.

Now personally I don't mind the InstFiles page popping up - any unattended install isn't going to care about a dialog, as long as the application finishes and exits okay, and personally I like having -some- visual confirmation of things happening even with a silent installation. But for the user expecting a completely invisible installation, I'd still like to be able to hide it completely without any UI flash.

So... can it be done at all, or am I SOL and just need to deal with the flash? If it -can- be done... how?

Most of the threads deal with the opposite.. a silent installer that users -do- still want to show the InstFiles page for.. go figure

Thanks in advance!
Animaether is offline   Reply With Quote
Old 7th November 2008, 21:58   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
You should use silent installer and set it in .onInit if silent installers is what you want. Simply make sure everything you need is present in the preferences file before you set the silent mode.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th November 2008, 05:38   #3
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
yeah, that's the thing - I don't want a silent installer, but I think what you're saying is.. (pseudocode)

code:

If (not using a preferences file) then (
proceed with installation as a full UI installer
)
else (
if (all preference values are found and valid) then (
set installation type silent, which hides instFiles
)
else (
proceed with semi-silent installer (some pages may display), instFiles shows up as well as a result
)
)



Which is a good idea and I'll have to see how easy that is to implement - duplicating and/or moving code out of pages and to .onInit - thanks

I take it that the "don't show instFiles in a non-silent installer" is one of the things that can't be done, though?
Animaether is offline   Reply With Quote
Old 8th November 2008, 09:24   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
You don't have to move the code to .onInit, it can stay in the sections. Only silent installers execute sections code outside of the instfiles page.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th November 2008, 17:21   #5
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
That'd be fine if all code was within sections - but a lot of it is in pre/post functions for other / custom pages.. those don't seem to get called if the installer is in silent mode.
Animaether is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump