wrong location for start in folder for shortcuts?

Posted by Tspivey on Fri 17 Sep 2010 09:38 PM — 13 posts, 51,163 views.

Canada #0
The start-in folder of the shortcut the instaler creates is set to the start menu
directory where the mushclient icons are installed. As a result of this, the prefs.sqlite
and mushclient.ini get created in the start menu, and things like saving plugin states doesn't work
since the state directory isn't in .\worlds\plugins\state where the client expects to find it. I've
verified this by removing mushclient, deleting the start menu folder and the program files folder, and reinstalling.
I'm using Windows XP if that matters.
USA #1
Hello Tyler,

I've also seen this behavior. I'm running Win 7 under VMware Fusion.
USA #2
I've seen this too, actually. I believe it happened to me on Vista. It was a few months ago, and I think I just changed the shortcut target to point to the right location, or something.
Amended on Fri 17 Sep 2010 09:47 PM by Twisol
Australia Forum Administrator #3
The installer needs work for Windows 7.

Meanwhile see the helpful tips here:

http://www.gammon.com.au/forum/?id=9842
USA #4
Well, Tspivey said he was using XP, which is interesting because nobody's reported this rather hard-to-miss issue before, and XP has been around for quite a while. It's hard for me to believe that this is just a W7 issue.
Australia Forum Administrator #5
The techniques described in that thread would also apply to earlier versions - you can put MUSHclient manually somewhere and avoid all the installer issues. Well picked up, though, that I skimmed the original problem. I think I picked up on Coderunner's comment about Windows 7.
USA #6
I wonder... Nick, would it be possible to create a separate installer designed for the later versions of Windows, so we can dodge these inconsistencies altogether?
Canada #7
I think I found the problem. In the NSIS docs
for CreateShortCut, it says:
$OUTDIR is used for the working directory.
You can change it by using SetOutPath before creating the Shortcut.

Currently, you have:

;  SetOutPath $INSTDIR
  SetOutPath "$SMPROGRAMS\MUSHclient" 
CreateShortCut...


I think it will work if you use:

  SetOutPath "$SMPROGRAMS\MUSHclient" 
  SetOutPath $INSTDIR
CreateShortCut...

The first SetOutPath will create the MUSHclient directory in the start menu, and the second will reset it to $INSTDIR so that
the start in field will be set correctly.
I tried testing this by copying the relevant binaries to the correct locations so the installer could find them to rebuild,
and on my system, it seems to work - all the shortcuts
have the start in field set to the directory containing mushclient.exe.
Australia Forum Administrator #8
Look strange, but I'll try it.
USA #9
Tspivey said:

I think I found the problem. In the NSIS docs
for CreateShortCut, it says:
$OUTDIR is used for the working directory.
You can change it by using SetOutPath before creating the Shortcut.

Currently, you have:

;  SetOutPath $INSTDIR
  SetOutPath "$SMPROGRAMS\MUSHclient" 
CreateShortCut...


...


The semicolon should be a comment character. You shouldn't need to SetOutPath twice.
Australia Forum Administrator #10
Yes, but I think he's saying it will create the directory, and then move back. Don't know if this is right.
Canada #11
Nick Gammon said:

Yes, but I think he's saying it will create the directory, and then move back. Don't know if this is right.

That's what it does, gathering from the documentation.
You might be able to use CreateDirectory "$SMPROGRAMS\MUSHclient"
to make it more clear, but what you have now in latest git should work.
Amended on Sat 18 Sep 2010 06:16 AM by Tspivey
USA #12
On line 114 of the nsi script, you're doing:

CreateDirectory "$INSTDIR\worlds"


Does

CreateDirectory "$SMPROGRAMS\MushClient"


not work?