Old 16th January 2007, 12:49   #1
AGU
Junior Member
 
Join Date: Jan 2007
Posts: 2
Installer request ;)

I don't know if it's asked to much, nevertheless I'm asking if someone is willing/wants to write me a little installer script for my BBCodeWriter Autohotkey script. Feel free to tell me if it's asked too much.

I already made a little one, but it's very limited. One thing is, it adds entries to startmenu although I uncheck the specified checkbox during install. On the other hand I always wanted an uninstaller for the script but don't know how to do it.
Is it possible to write an uninstall entry to the control panel - software - add/remove?
And last but not least, is it possible to ask the user during install if he/she would like to install it for all users or only for the currently registered user?

This is how far I came with v.2.14 and my limited knowledge:
code:
!define TITLE "AHK BBCodeWriter"
!define VERSION 6.6

;#######################################
;Include Modern UI
!include "MUI.nsh"
;#######################################


;#######################################
; General

; Installer Name
Name "AHK BBCodeWriter"

; The file to write
OutFile "Setup BBCodeWriter.exe"

; The default installation directory
InstallDir C:\Tools\BBCode
;#######################################


;#######################################
;Interface Settings
!define MUI_ICON ${NSISDIR}\Contrib\Graphics\Icons\box-install.ico
!define MUI_UNICON ${NSISDIR}\Contrib\Graphics\Icons\box-uninstall.ico

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ${NSISDIR}\Contrib\Graphics\Header\win.bmp
!define MUI_HEADERIMAGE_UNBITMAP ${NSISDIR}\Contrib\Graphics\Header\win.bmp

!define MUI_ABORTWARNING
;#######################################


;#######################################
; Variables
Var STARTMENU_FOLDER
;#######################################


;#######################################
; Pages
!define MUI_PAGE_HEADER_TEXT "${TITLE} v${VERSION}"
!define MUI_PAGE_HEADER_SUBTEXT "An offline BBCode Editor written in Autohotkey"

!define MUI_WELCOMEPAGE_TITLE "${TITLE} v${VERSION}"
!insertmacro MUI_PAGE_WELCOME

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER

!define MUI_FINISHPAGE_RUN $INSTDIR\BBCodeWriter.exe
!insertmacro MUI_PAGE_FINISH
;#######################################


;#######################################
;Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
;#######################################


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

; Put files in InstallDir
File /r Files\*.*

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

; Create Shortcuts
CreateDirectory "$SMPROGRAMS\${TITLE}"
CreateShortCut "$SMPROGRAMS\${TITLE}\${TITLE}.lnk" "$INSTDIR\BBCodeWriter.exe"

!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;#######################################

AGU is offline   Reply With Quote
Old 16th January 2007, 16:03   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
I guess you may manage that installer easily with NSIS Quick Setup Script Generator

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 16th January 2007, 16:17   #3
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
Quote:
One thing is, it adds entries to startmenu although I uncheck the specified checkbox during install.
you should change the order of the installer pages.
your code for startmenu entries is in a "section", meaning it will be executed on page instfiles. your checkbox to choose if actually any shortcuts should be created is a page AFTER this.
you should flip the two pages:
code:

!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER



Quote:
On the other hand I always wanted an uninstaller for the script but don't know how to do it.
see the user manual

Quote:
Is it possible to write an uninstall entry to the control panel - software - add/remove?
yes, quite simple - a small topic in the user manual

[quopte]And last but not least, is it possible to ask the user during install if he/she would like to install it for all users or only for the currently registered user?[/quote]
search the forums/wiki.

there are several solutions for this one in here.

small hint: installoptions page.
Comm@nder21 is offline   Reply With Quote
Old 17th January 2007, 10:24   #4
AGU
Junior Member
 
Join Date: Jan 2007
Posts: 2
Thx Guys,

looks like "NSIS Quick Setup Script Generator" is exactly what I was looking for.

Nevertheless thanks to Comm@nder21 for pointing out what is wrong in my script. I will have a look at it.
AGU 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