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 ?
Script to refresh my desktop icons (windows 10)?
11 posts
Does the target (.exe or whatever) exist before you call CreateShortcut?
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
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
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"
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"
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.
I reply here too, so I hope you can check my code. Thanks for you time to help.
You need to make sure that you extract the .exe and .ico before calling CreateShortcut.
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 ...
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 ...
Section ; Main app
SetOutPath "$INSTDIR"
File c:\mystuff\app.exe
SetOutPath "$INSTDIR\.icon"
File c:\mystuff\m.ico
SectionEnd
Section "Desktop shortcut"
CreateShortcut "$DESKTOP\app.lnk" "$INSTDIR\app.exe" "" "$INSTDIR\.icon\m.ico" 0
SectionEnd 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
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
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 ?
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 ?
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.