Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How do I unhide then hide files during install? (http://forums.winamp.com/showthread.php?t=304651)

ronca 26th March 2009 14:28

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?

Anders 26th March 2009 14:34

Don't mess with the users explorer settings!

ronca 27th March 2009 14:27

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?

Anders 27th March 2009 14:41

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

Comperio 27th March 2009 14:44

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
:o yes, SetFileAttributes should work. (Thanks Anders). I knew I read that somewhere; go figure it'd be in the NSIS help file!

Anders 27th March 2009 14:48

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


All times are GMT. The time now is 17:45.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.