Old 27th November 2005, 22:37   #1
Xi0Ns
Junior Member
 
Join Date: Nov 2005
Posts: 9
Need help about some easy subjects

First: thanks for all the people that makes this real:

I want to ask some things:

1: How do i do to set a custom folder in a shortcut's "Start in" field when i create such shortcut?

2: In the components page, i want to display "Create shortcuts" and enable to expand this and show under the same component, 2 child components "Start menu" and "Desktop"?? (that stuff with the "+" symbol beside the component).

Thanks for your help
Xi0Ns is offline   Reply With Quote
Old 28th November 2005, 12:50   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
1. Use SetOutPath first.
2. ...
code:

SectionGroup "Create shortcuts" secGroupCSC

Section "Desktop" secSCDesktop
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\My App.lnk" "$INSTDIR\MyApp.exe"
SectionEnd

Section "Start menu" secSCStartMenu
SetOutPath $INSTDIR
CreateDirectory "$SMPROGRAMS\My App"
CreateShortCut "$SMPROGRAMS\My App\My App.lnk" "$INSTDIR\MyApp.exe"
SectionEnd

SectionGroupEnd



-Stu
Afrow UK is offline   Reply With Quote
Old 28th November 2005, 13:11   #3
Xi0Ns
Junior Member
 
Join Date: Nov 2005
Posts: 9
Thanks, u are the best, but i need two last things.

1) Is there any way to do this?: When i launch the setup.exe i want it to check if the app is already installed, if that is the situation, launch the uninstall program before performing the installation (Very useful for the new releases)

2) When launching the uninstall, check if the app is running, and if so happens, close it before performing the uninstall..


I hope i can explain myself clearly.. as u probably deduced, i am not english talking

Thanks a lot mate
Xi0Ns is offline   Reply With Quote
Old 28th November 2005, 15:22   #4
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
1. Yes.
read the uninstaller location from the registry (ReadRegStr)
- if the read string is empty, your app probably isn't installed (short of the user mucking with the registry)
- if the read string isn't empty, your app probably -is- installed.
-- check whether the uninstaller file exists (IfFileExists)
--- if it doesn't exist, the user moved or deleted the files after installation, can't do much about that
--- if it does exist, throw up a messagebox stating that you'll be running the uninstaller first
---- run the uninstaller

2. http://nsis.sourceforge.net/Detect_i..._and_close_it.
Animaether is offline   Reply With Quote
Old 28th November 2005, 15:24   #5
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Oh, step 1 is detailed here as well:
http://nsis.sourceforge.net/Auto-uni...installing_new

Though it lacks the check whether the uninstaller file exists (it tries to run it, regardless, and if an error occurred (such as the file not existing), it skips. Cleaner to check whether the file exists first
Animaether is offline   Reply With Quote
Old 28th November 2005, 15:32   #6
Xi0Ns
Junior Member
 
Join Date: Nov 2005
Posts: 9
Thanks!!! is a really good idea.. i will try to do it..

thanks a lot.. but i still need to know how to close the running app...

Thanks, again to all of u
Xi0Ns is offline   Reply With Quote
Old 28th November 2005, 17:39   #7
Xi0Ns
Junior Member
 
Join Date: Nov 2005
Posts: 9
http://nsis.sourceforge.net/Detect_...n_and_close_it



Sorry, i didnt see b4... thanks
Xi0Ns 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