Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   NSIS Noob question! (http://forums.winamp.com/showthread.php?t=321906)

BMullin 23rd August 2010 19:35

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


MSG 23rd August 2010 20:08

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.

BMullin 26th August 2010 19:25

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


demiller9 26th August 2010 19:27

Section /o "Start Menu Shortcuts"

redxii 26th August 2010 19:39

You use Section /o but you also need to put the desktop shortcut command in its own section.

BMullin 26th August 2010 19:44

Quote:

Originally Posted by demiller9 (Post 2692229)
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:

http://aa4m.com/Clipboard.jpg

BMullin 26th August 2010 19:49

Quote:

Originally Posted by redxii (Post 2692230)
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

MSG 27th August 2010 04:06

Quote:

Originally Posted by BMullin (Post 2692232)
/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


All times are GMT. The time now is 17:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.