Old 23rd August 2010, 19:35   #1
BMullin
Junior Member
 
Join Date: Aug 2010
Location: Tucson, AZ
Posts: 4
Question NSIS Noob question!

I pieced this script together from examples I found in various locations. It now does just about everything I want to do with 2 exceptions:

- The publisher's name and file size do not appear in the control panel's "Programs and Features" list. How do I get these to show?

- I've seen a check box during install which allows me to uncheck the mail program's name, which of course I wouldn't do. But how to I get the desktop shortcut and the start menu shortcuts to also become optional?

Thanks, Bill


code:

; QuikWAS.nsi

;--------------------------------

; The name of the installer
Name "QuickWAS"

; The file to write
OutFile "QuickSetup.exe"

; The default installation directory
InstallDir $PROGRAMFILES\QuickWAS

; Request application privileges for Windows Vista
RequestExecutionLevel admin


;--------------------------------

; Pages

Page components
Page directory
Page instfiles
; Page license

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section "QuickWAS"

; SectionIn RO

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File "QuickWAS.exe"

; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuickWAS" "DisplayName" "QuickWAS"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuickWAS" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuickWAS" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuickWAS" "NoRepair" 1
WriteUninstaller "uninstall.exe"

; SectionEnd

; Section "install" Installation info

;create desktop shortcut
CreateShortCut "$DESKTOP\QuickWAS.lnk" "$INSTDIR\QuickWAS.exe" ""

;create start-menu items
CreateDirectory "$SMPROGRAMS\QuickWAS"
CreateShortCut "$SMPROGRAMS\QuickWAS\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\QuickWAS\QuickWAS.lnk" "$INSTDIR\QuickWAS.exe" "" "$INSTDIR\QuickWAS.exe" 0


SectionEnd

;--------------------------------

Section "Uninstall"

; Remove registry keys
DeleteRegKey HKCU "Software\AA4M Software"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuickWAS"

; Remove files and uninstaller
Delete $DESKTOP\QuickWAS.lnk
Delete $INSTDIR\QuickWAS.exe
Delete $INSTDIR\uninstall.exe
Delete $INSTDIR\*.was

; Remove shortcuts, if any
Delete "$SMPROGRAMS\QuickWAS\*.*"

; Remove directories used
RMDir "$SMPROGRAMS\QuickWAS"
RMDir "$INSTDIR"

SectionEnd

BMullin is offline   Reply With Quote
Old 23rd August 2010, 20:08   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Please use http://nsis.pastebin.com to paste large amounts of code.

You can create a custom page to show checkboxes. See the nsDialogs readme.

Try searching for 'add remove programs' to get info on the registry keys you need to set to add publisher name.
MSG is offline   Reply With Quote
Old 26th August 2010, 19:25   #3
BMullin
Junior Member
 
Join Date: Aug 2010
Location: Tucson, AZ
Posts: 4
I've just spend 3 days (on and off) digging into the documentation and now have everything doing exactly what I want with only one exception. This is that the desktop icon still doesn't appear as an option with a checkbox, but the start menu words as expected. So how do I get the desktop icon to be an optional install for the user?

Thanks, Bill

code:
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\QuickWAS"
CreateShortCut "$DESKTOP\QuickWAS.lnk" "$INSTDIR\QuickWAS.exe" "" "$INSTDIR\QuickWAS.exe" 0
CreateShortCut "$SMPROGRAMS\QuickWAS\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\QuickWAS\QuickWAS.lnk" "$INSTDIR\QuickWAS.exe" "" "$INSTDIR\QuickWAS.exe" 0
SectionEnd

BMullin is offline   Reply With Quote
Old 26th August 2010, 19:27   #4
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
Section /o "Start Menu Shortcuts"
demiller9 is offline   Reply With Quote
Old 26th August 2010, 19:44   #5
BMullin
Junior Member
 
Join Date: Aug 2010
Location: Tucson, AZ
Posts: 4
Quote:
Originally Posted by demiller9 View Post
Section /o "Start Menu Shortcuts"
All that did was remove the check mark from the item "Start Menu Shortcuts". What I'm trying to do is get the desktop icon offered as an option in the following screen capture:

BMullin is offline   Reply With Quote
Old 26th August 2010, 19:39   #6
redxii
Senior Member
 
Join Date: Nov 2005
Posts: 115
You use Section /o but you also need to put the desktop shortcut command in its own section.
redxii is offline   Reply With Quote
Old 26th August 2010, 19:49   #7
BMullin
Junior Member
 
Join Date: Aug 2010
Location: Tucson, AZ
Posts: 4
Quote:
Originally Posted by redxii View Post
You use Section /o but you also need to put the desktop shortcut command in its own section.
That worked, and I didn't even use the /o, which I guess is just a toggle for the check marks!

Thanks, Bill
BMullin is offline   Reply With Quote
Old 27th August 2010, 04:06   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Quote:
Originally Posted by BMullin View Post
/o, which I guess is just a toggle for the check marks!
You could have found that in the manual.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.6.1.2
MSG 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