Archive: Create shortcut problrm in windows 8


Create shortcut problrm in windows 8
I am using NSIS to create my application.It is working fine in windows xp,vista and windows 7.
but in windows 8 shortcut of my application in desktop is not creating.But in other OS it's creating shortcut in desktop properly.Why does it doesnt create shortcut in windows 8 OS?Is there any solution to solve this?


I want to add some more details for above problem.I was trying to find out the error of creating shortcut.I did a small testing with CreateShortcuts.
Below is a part of coding.

!macro CreateShortcuts
Messagebox MB_OK "$Desktop"
CreateShortCut "$Desktop\nvt.lnk" "$INSTDIR\Database2.mdb"
CreateShortCut "$INSTDIR\nvt.lnk" "$INSTDIR\Database2.mdb"
copyfiles "$Desktop\test\test.txt" "$Desktop"
!macroend

The Messagebox MB_OK "$Desktop" displays output as "D:\Desktop" which is proper in my case.
But CreateShortCut "$Desktop\nvt.lnk" "$INSTDIR\Database2.mdb" creates a shortcut in C:\Documents and Settings\winman\Desktop path only in windows 8.but in other OS(xp etc) the shortcut is created in D:\desktop
here is some interesting thing
copyfiles "$Desktop\test\test.txt" "$Desktop" copies file from D:\Desktop\test\test.txt to D:\desktop in both windows 8 and other OS.
So how this copyfiles and createshortcut behave differently for $Desktop at same time?
So is the problem of creating shortcut is a problem with NSIS or something else.


NSIS uses the documented CSIDL_DESKTOPDIRECTORY constant to get the folder.

Could you run http://pastebin.com/gztsZbyi and paste the output?


NSIS uses the normal COM shortcut interface to create the shortcut, I suspect Windows is trying to "help" by tweaking the PIDL stored in the shortcut...


Thank u Andres for replying me.. I tried running what u have told(http://pastebin.com/gztsZbyi). when i run this nsistest.exe is created in D:\Desktop in both windows 8 and windows xp. So what does it mean?Is it problem with createshortcut or something else?


winman: Please paste the install log here. Anders needs the text printed there with the detailprint commands.


this was the log of installation(for this http://pastebin.com/gztsZbyi )
$Desktop=D:\Desktop
shfolder(0)
SHGetFolderPathA=D:\Desktop
SHGetFolderPathW=D:\Desktop
shell32(0)
SHGetSpecialFolderLocation=D:\Desktop
SHGetSpecialFolderPathA=D:\Desktop
SHGetSpecialFolderPathW=D:\Desktop
SHGetFolderPathA=D:\Desktop
SHGetFolderPathW=D:\Desktop
shfolder(0x10)
SHGetFolderPathA=D:\Desktop
SHGetFolderPathW=D:\Desktop
shell32(0x10)
SHGetSpecialFolderLocation=D:\Desktop
SHGetSpecialFolderPathA=D:\Desktop
SHGetSpecialFolderPathW=D:\Desktop
SHGetFolderPathA=D:\Desktop
SHGetFolderPathW=D:\Desktop
SHGetKnownFolderPath=D:\Desktop
Done (NSIS v2.46, Win 6.2.9200 SP=0 IsWow64=0)


Could you please run http://pastebin.com/PUFCS1gZ and paste the output?


I tested http://pastebin.com/PUFCS1gZ in windows 8 and output was
Output folder: F:\Users\winman\AppData\Local\Temp
$Desktop=D:\Desktop
SHGetFolderPathA:SHGFP_TYPE_DEFAULT=F:\Users\winman\Desktop
Saved 1="D:\Desktop\test_1.lnk"|hr=0|exists=YES|lastop=0
Saved 2="D:\Desktop\test_2.lnk"|hr=0|exists=YES|lastop=0
Saved 3="D:\Desktop\test_3.lnk"|hr=0|exists=YES|lastop=0
Saved 4="D:\Desktop\test_4.lnk"|hr=0|exists=YES|lastop=0
Create shortcut: D:\Desktop\test_0.lnk
Saved normal, error=NO
Done (NSIS v2.46, Win 6.2.9200 SP=0 IsWow64=0)

Also i got nsistest.exe and shortcuts test_0,test_1,test_2,test_3,test_4. All in D:\desktop itself..


You should try adding requestexecutionlevel to your script and see if that fixes it...