|
![]() |
#1 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
Script to refresh my desktop icons (windows 10)?
Hey,
How I can refresh my desktop icons ? Does anyone know which script I can use before finish the nsis installation? My desktop shortcut stay blank until I'm refreshing my desktop.... Does anyone know how to solve it please ? |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,332
|
Does the target (.exe or whatever) exist before you call CreateShortcut?
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
I assume yes, because I'm calling for the shortcut creation in the end of the script (after all my files are installed).
I'm really really new with this kind of nsis scripting, I hope someone can help...I'm so frustrated with this ... hours.... I also created a exe file that refresh my desktop icons when I double click on it, but the file not really executed through nsis.. I tired so many options.. like: Section ExecWait "$INSTDIR\reic\refresh.exe" SectionEnd So I give up on this line cause it's not working for me... I edit the Modren.nsh file this way (current state): ;Change this file to customize zip2exe generated installers with a modern interface !include "MUI2.nsh" !define MUI_ICON "${NSISDIR}\contrib\graphics\icons\install.ico" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE "English" Section "Desktop Shortcut" SectionX SetShellVarContext current SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\DeskMate.lnk" "$INSTDIR\DeskMate.exe" "" "$INSTDIR\.icon\m.ico" 0 SectionEnd |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
I'm really new into it... This is my script ...
I don't know what I'm doing wrong ... my icon is blank (white color)... just if I'm refreshing my desktop it's visible.... :\ I also checked it in other pc... same issue... ;Change this file to customize zip2exe generated installers with a modern interface !include "MUI2.nsh" !define MUI_ICON "${NSISDIR}\contrib\graphics\icons\install.ico" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES Section SetShellVarContext all SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\app.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\.icon\m.ico" 0 SectionEnd !insertmacro MUI_LANGUAGE "English" |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
Hi Andres .. I'm not sure if you received my quick reply.
I reply here too, so I hope you can check my code. Thanks for you time to help. |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,332
|
You need to make sure that you extract the .exe and .ico before calling CreateShortcut.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
How can I make sure it's happen before?
I think it's created before because this line: !insertmacro MUI_PAGE_INSTFILES is executed before: Section SetShellVarContext all SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\app.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\.icon\m.ico" 0 SectionEnd Am I right?... I'm really new with this... I'm not sure about that ... |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,332
|
PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
Sorry for the dumb question......but what is the path I should replace with:
File c:\mystuff\app.exe and File c:\mystuff\m.ico This path should not be ...? File $INSTDIR\app.exe File $INSTDIR\.icon\m.ico |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Aug 2020
Posts: 8
|
Now I set each file path to my project folder (that already exist\extracted).
And after I run the setup file - it's all works great ! The icon appear without issue. I didn't get it How it's actually works when my setup installer run the second time, after it get built. It's actually use these files because they are already exist? they saved somewhere in advance in my setup package, so my shortcut built correctly ? |
![]() |
![]() |
![]() |
#11 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 893
|
The "File" command specifies where the source file is on your computer, so that the compiler knows where to get it from to put it into the installer. When the installer is run, it extracts that file to $OUTDIR, which can be set multiple ways but usually SetOutPath is used.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|