Archive: Problem with Shortcuts.


Problem with Shortcuts.
Hey there.

First of all thanks for this great piece of software, but I have ran into a problem with the shortcuts.

It can easily create the shortcuts, in the start menu, but when clicking on them it opens command promt, and closes again = something is wrong. I have looked though my code for some time now, and I don't see what is wrong?
For some reason the shortcut target will be

"C:\DOCUME~1\ADMINI~1\MENUEN~1\PROGRA~1\NEVERL~1\NEVERL~1.EXE"

Which don't exist? Can anyone help me?

--

Here is my script;


; Neverlands POL Edition Install Application
; v. 1.5
; Made by Necrocide - 2006

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "Neverlands, The POL edition"
OutFile "neverlands_polnl_installer_1.5.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\"

;Get installation folder from registry if available
InstallDirRegKey HKLM "SOFTWARE\Origin Worlds Online\Ultima Online\1.0" "InstCDPath"

;--------------------------------
;Variables

Var STARTMENU_FOLDER

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Pages

!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "SOFTWARE\Neverlands"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Neverlands, the POL edition"

!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER

!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Neverlands POL files" SecDummy

SetOutPath "$INSTDIR"

File hues.mul
File multi.idx
File neverlands.url
File staidx0.mul
File tiledata.mul
File skills.idx
File login.cfg
File multi.mul
File polnl_client.exe
File skills.mul
File verdata.mul
File statics0.mul

;Store installation folder
WriteRegStr HKCU "Software\Neverlands" "InstallDIR" $INSTDIR

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Neverlands.ink" "$INSTDIR\polnl_client.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Website.ink" "$INSTDIR\neverlands.url"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd


Thanks in advance!

ink->lnk ? :)


I also have a problem with shortcuts, how can you define where the taget programm is started?


Manual, 4.9.3.4 CreateShortCut:
$OUTDIR is used for the working directory. You can change it by using SetOutPath before creating the Shortcut.


Thanks I had miss this sentence in the manual... RTFM as we say.
It's working well now.


Thanks for the replies, still I can not get it working, this is what I changed? Hmmmmm...


;Store installation folder
WriteRegStr HKCU "Software\Neverlands" "InstallDIR" $INSTDIR

SetOutPath "$OUTDIR"

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Neverlands.Ink" "$OUTDIR\polnl_client.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Website.Ink" "$OUTDIR\neverlands.url"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd


What am I doing wrong? :/

:) Ink->lnk (INK->LNK)


Just to say what L.N.K. stands for... it's LINK :)

-Stu


Doh. Thanks everyone, it's all working now - lol.