Old 27th January 2009, 05:04   #1
Dieter01
Junior Member
 
Join Date: Jan 2009
Posts: 2
Make correct CreateShortCut's

Hello together,

i want to make a ShortCut entry that starts the local mail client with a default mail title an a default mail body.

(first: my experiences with NSIS are limited and so my code looks very credulous)

The ideal ShortCut entry would be like that:

"C:\Programme\Mozilla Thunderbird\thunderbird.exe" mailto:name@domain.de?subject=mailtitle&body=bla_bla

But the result is always:

"C:\"C:\Programme\Mozilla Thunderbird\thunderbird.exe" " mailto:name@domain.de?subject=mailtitle&body=bla_bla

Well, my problem is the correct handling of the strings; i'm convinced there is a more elegant solution than mine ;-)

Many thanks for your help
Dieter

And that's my naive code:


Section "Start Menu Shortcuts"

Var /GLOBAL MailURL
Var /GLOBAL MailPgm
Var /GLOBAL MailPgmTMP

; ----- look for mailto connections...
; HKEY_CURRENT_USER\Software\Classes\mailto\shell\open\command
ReadRegStr $MailPgmTMP HKCU "Software\Classes\mailto\shell\open\command" ""
${If} $MailPgmTMP != ""
StrCpy $MailPgm $MailPgmTMP
${EndIf}

; HKEY_CLASSES_ROOT\mailto\shell\open\command
ReadRegStr $MailPgmTMP HKCR "mailto\shell\open\command" ""
${If} $MailPgmTMP != ""
StrCpy $MailPgm $MailPgmTMP
${EndIf}

; HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command
ReadRegStr $MailPgmTMP HKLM "SOFTWARE\Classes\mailto\shell\open\command" ""
${If} $MailPgmTMP != ""
StrCpy $MailPgm $MailPgmTMP
${EndIf}

StrCpy $MailURL mailto:name@domain.de?subject=mailtitle&body=bla_bla

MessageBox MB_OK $MailPgm
${StrRep} $MailPgm $MailPgm "/mailurl:" ""
${StrRep} $MailPgm $MailPgm "/defini" ""
${StrRep} $MailPgm $MailPgm "-osint" ""
${StrRep} $MailPgm $MailPgm "-compose" ""
${StrRep} $MailPgm $MailPgm "%1" ""
${StrRep} $MailPgm $MailPgm '""' ""
; ${StrRep} $MailPgm $MailPgm %1 ""
MessageBox MB_OK $MailPgm

CreateDirectory "$SMPROGRAMS\MyEntry"
CreateShortCut "$SMPROGRAMS\MyEntry\Mail to me.lnk" $MailPgm $MailURL $MailPgm 0

SectionEnd
Dieter01 is offline   Reply With Quote
Old 27th January 2009, 05:08   #2
Dieter01
Junior Member
 
Join Date: Jan 2009
Posts: 2
NSI file

... and thats my complete nsi file
Attached Files
File Type: nsi !nsis_entry-demo.nsi (1.6 KB, 199 views)
Dieter01 is offline   Reply With Quote
Old 27th January 2009, 06:21   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
From the FAQ:

http://nsis.sourceforge.net/I_am_hav...CreateShortcut

Parameters for the executable should be passed as a separate parameter for CreateShortcut.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik 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