Skip to content
⌘ NSIS Forum Archive

$PLUGINSDIR safe?

5 posts

bnicer#

$PLUGINSDIR safe?

Hi,

Just wondering, is this code safe to change images?

  StrCmp $Language 1031 0 +5
Delete "$PLUGINSDIR\modern-wizard.bmp"
SetOutPath "$PLUGINSDIR"
File "tigwg.bmp"
Rename "$PLUGINSDIR\tigwg.bmp" "$PLUGINSDIR\modern-wizard.bmp"
100%?
Anders#
you dont have to rename, you can specify the extracted name with File
File "/oname=$PLUGINSDIR\\modern-wizard.bmp" "tigwg.bmp" 
bnicer#
  StrCmp $Language 1031 0 +4
SetOverwrite on
SetOutPath "$PLUGINSDIR"
File "/oname=$PLUGINSDIR\modern-wizard.bmp" "tigwg.bmp"
(thanks 🙂)

Is it also possible to set the image to avoid having to change it? A !define works only once, eg:
  !define MUI_WELCOMEFINISHPAGE_BITMAP "tigw.bmp"
or
  !define MUI_WELCOMEFINISHPAGE_BITMAP "tigwg.bmp"
The image is the last !define in the script. Is there another way of doing this conditionally so one image is copied to $PLUGINSDIR with no need to replace it?