Old 26th October 2012, 06:18   #1
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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?
winman2004 is offline   Reply With Quote
Old 26th October 2012, 13:57   #2
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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.
winman2004 is offline   Reply With Quote
Old 26th October 2012, 16:40   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,144
NSIS uses the documented CSIDL_DESKTOPDIRECTORY constant to get the folder.

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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th October 2012, 17:14   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,144
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 27th October 2012, 07:11   #5
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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?
winman2004 is offline   Reply With Quote
Old 27th October 2012, 08:39   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
winman: Please paste the install log here. Anders needs the text printed there with the detailprint commands.
MSG is offline   Reply With Quote
Old 27th October 2012, 09:31   #7
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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)
winman2004 is offline   Reply With Quote
Old 29th October 2012, 19:57   #8
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,144
Could you please run http://pastebin.com/PUFCS1gZ and paste the output?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd November 2012, 04:55   #9
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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..
winman2004 is offline   Reply With Quote
Old 2nd November 2012, 05:18   #10
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,144
You should try adding requestexecutionlevel to your script and see if that fixes it...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump