Old 26th March 2009, 14:28   #1
ronca
Junior Member
 
Join Date: Aug 2008
Posts: 13
How do I unhide then hide files during install?

In one of the steps I need to unhide files (visible in their folder during install) then unhide them.

I found a registry key that does that and it works but only if the user logs off and logs on again - which stop the execution of my installer.

I noticed that in windows xp in folder options when you select hide/unhide and press the apply button this happen immediately without having to logoff/logon. How do they do that?

Can I do something similar in NSIS?
ronca is offline   Reply With Quote
Old 26th March 2009, 14:34   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Don't mess with the users explorer settings!

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th March 2009, 14:27   #3
ronca
Junior Member
 
Join Date: Aug 2008
Posts: 13
Thanks Anders for your advice. It is good in general but in my special case I need this for an internal company application.

If I can't do this via NSIS I will have to find a way to do this via win32 API.

I tried ${RefreshShellIcons} but this doesn't help.

Any ideas?
ronca is offline   Reply With Quote
Old 27th March 2009, 14:41   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
You would have to refresh every explorer window, you can probably do that with COM (CLSID_ShellWindows/IID_IShellWindows)

See http://blogs.msdn.com/oldnewthing/ar...20/188696.aspx for more

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th March 2009, 14:44   #5
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
hmm...
Maybe instead of messing with the user's explorer settings, you could simply change the file/folder attributes to remove and then set the "hidden" flag?

My thought is that perhaps you could just use attrib.exe (which I believe is included with all Windows installation). Or you might find a plugin or API call to do the same.

edit
yes, SetFileAttributes should work. (Thanks Anders). I knew I read that somewhere; go figure it'd be in the NSIS help file!
Comperio is offline   Reply With Quote
Old 27th March 2009, 14:48   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Quote:
Originally posted by Comperio
My thought is that perhaps you could just use attrib.exe (which I believe is included with all Windows installation). Or you might find a plugin or API call to do the same.
SetFileAttributes

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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