- NSIS Discussion
- Hide Files and My Documents $?
Archive: Hide Files and My Documents $?
MechMykl
3rd May 2005 21:19 UTC
Hide Files and My Documents $?
Hey, im making an installer where I need the ability to make the folder a hidden one when nsis creates it, and, is there a $ type code for mydocumets? because with xp its C:\Doc and Settings...
Thanks for your help in advance
~Mechy
MechMykl
3rd May 2005 22:35 UTC
Hey, thanks for the $ code, but i cant get the thing for the hidden, help plz :)
;Create shortcuts
CreateShortCut "$SMPROGRAMS\Startup\HQubed Webcam.lnk |HIDDEN" "$INSTDIR\booruWebCam.exe /run /minimized"
Oh, and after booruwebcam.exe" /run /minimized
will it work the way it is? as the /run is supposed to be outside of the quote....
MechMykl
4th May 2005 01:51 UTC
Ok, so I cant edit that post, anyway.
I need an example of how to use the hidden thing. Also, with the above post, will creating a shortcut allow me to have the /run and /minimized after it? Because usually they go after the " in an actual shortcut.
Thanks in advance.
Comperio
4th May 2005 03:34 UTC
Read the link above:
The hidden attribute is set with the SetFileAttributes command, not with the CreateShortcut command. You'll probably want to create the shortcut first and then set the file attributes on it.
Here's an example which also illustrates the usage of the run minimized command:
SetOutPath "$SMPROGRAMS\Startup"
CreateShortcut "HQubed Webcam.lnk" "$INSTDIR\booruWebCam.exe" "" "" 0 SW_SHOWMINIMIZED "" "Sample Description"
SetFileAttributes "$SMPROGRAMS\HQubed Webcam.lnk" hidden
MechMykl
5th May 2005 22:06 UTC
Hey, thanks alot, the shortcut is now hidden but I have 2 more questions/problems.
I need to make my installation folder hidden also, is this possible? If so I could use the code :)
Secondly, the shortcuts current target is
"C:\Program Files\Michael\Webcam\booruWebCam.exe"
but I need to make it like this
"C:\Program Files\Michael\Webcam\booruWebCam.exe" /run /minimized
and I cant put the /run /minimized in OR out of the quotes in NSIS, is there a way to do this that I dont know about?
I've attached the installer, thanks in advace.
Afrow UK
5th May 2005 22:45 UTC
1.
CreateShortcut "HQubed Webcam.lnk" '"$INSTDIR\booruWebCam.exe" /run /minimized' "" "" 0 SW_SHOWMINIMIZED "" "Sample Description"
2.
SetFileAttributes $INSTDIR hidden
-Stu
Afrow UK
6th May 2005 18:18 UTC
Put the SetFileAttributes $INSTDIR hidden code in Function .onInstSuccess
Function .onInstSuccess
SetFileAttributes $INSTDIR hidden
FunctionEnd
Or you could put it in a last hidden section.
Section
SetFileAttributes $INSTDIR hidden
Section
-Stu
MechMykl
7th May 2005 00:47 UTC
Thanks sooo much, but theres a problem with the shortcut...
This installers attached (updated)
And the acutal exe's at hqubed.com/stuff/hcamai.exe
Check the target of the shortcut, can it be fixed?
Comperio
7th May 2005 03:15 UTC
I don't see an attachment...
MechMykl
7th May 2005 16:35 UTC
Yes you do.
Afrow UK
7th May 2005 19:11 UTC
CreateShortcut "$SMPROGRAMS\Startup\HQubed Webcam.lnk" '"$INSTDIR\booruWebCam.exe" /run /minimized' "" "" 0 SW_SHOWMINIMIZED "" "Sample Description"
-Stu
MechMykl
7th May 2005 19:29 UTC
Yea, like i said, when I do that the shortcut target in startup says this
"C:\"C:\Documents and Settings\Michael\My Documents\HQubed Webcam\booruWebCam.exe" \run \minimized"
If there's no way to get it to say
"C:\Documents and Settings\Michael\My Documents\HQubed Webcam\booruWebCam.exe" /run /minimized
then i'll have to make a shortcut to it myself
Afrow UK
7th May 2005 20:40 UTC
What does the message box say (put it in code):
MessageBox MB_OK $SMPROGRAMS
-Stu
MechMykl
7th May 2005 21:35 UTC
not sure what you mean
Afrow UK
7th May 2005 22:56 UTC
Put
MessageBox MB_OK $SMPROGRAMS
under your CreateShortcut compile and run the installer!!!
-Stu :o
MechMykl
7th May 2005 23:23 UTC
C:\Documents and Settings\Michael\Start Menu\Programs
Afrow UK
7th May 2005 23:58 UTC
Attach your script again.
-Stu
MechMykl
8th May 2005 23:50 UTC
Hey, was gone till 6 for mothers day, here it is.
MechMykl
13th May 2005 21:03 UTC
*bump*
If you cant help, tell me.
Afrow UK
13th May 2005 21:35 UTC
I couldn't find anything significantly wrong with the script that could cause this, but you don't have to create the Startup folder because there's no way a user cannot have it.
Secondly, it may not always be called Startup (apparently) so you should use $SMSTARTUP not "$SMPROGRAMS\Startup"
The SetOutPath call you're using will set the "Start in" path for the proceeding shortcuts. Idealy then you should use SetOutPath $INSTDIR.
-Stu
MechMykl
15th May 2005 06:18 UTC
Ok, I took your advice and fixed the code, but it seems the shortcut just cant be done... Thanks for all of your help though, www.projects.hqubed.com ; it'll be up there soon.