Old 17th November 2007, 16:51   #1
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
HELP!!! w/Custom scripted installer.

Hi guys, I promised the community that I am a part of that I would release a mod I created Thanks Giving day for the game TRIBES.

I successfully created a installer, now the only problem is that I need it to install :\

I originally worked out of gfx.nsi, I got everything to work, and the installer itself looks excellent. I couldn't find any code in the NSI that attaches files to it so I browsed around in zip2exe. I noticed at the top it says the contrib crap, so I went ahead and went to my Programs files/NSIS/Contrib/ bla bla... I then opened up the base, then I attempted to replace the base code with the one gfx gave me.. No luck... Syntax syntax syntax.. Now this is weird knowing the installer works in the scripter but not the zip2exe... I am basically trying to add the zip to my custom gfx.nsi, if anyone could help I would deeply appreciate it..

Josh-

Here is the un-syntaxed GFX.nsi code.

code:

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

!macro BIMAGE IMAGE PARMS
Push $0
GetTempFileName $0
File /oname=$0 "${IMAGE}"
SetBrandingImage ${PARMS} $0
Delete $0
Pop $0
!macroend

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

Name "WTF Mod v0.2"

OutFile "Gfx.exe"

; Adds an XP manifest to the installer
XPStyle on

; Add branding image to the installer (an image placeholder on the side).
; It is not enough to just add the placeholder, we must set the image too...
; We will later set the image in every pre-page function.
; We can also set just one persistent image in .onGUIInit
AddBrandingImage left 100

; Sets the font of the installer
SetFont "Comic Sans MS" 8

; Just to make it three pages...
SubCaption 0 ": !?WTF?! Mod installer - Clanmx.com"
SubCaption 2 ": !?WTF?! Mod installer Page - Clanmx.com"
LicenseText "WTF Mod License page"
LicenseData "License.nsi"
DirText "--!?WTF?! Mod-- (example: C:\Dynamix\Tribes\)"

; Install dir
InstallDir "C:\Dynamix\Tribes\"

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

; Pages
Page license licenseImage
Page custom customPage
Page directory dirImage
Page instfiles instImage

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

Section ""
; You can also use the BI_NEXT macro here...
MessageBox MB_YESNO "You are about ready to install !?WTF?! Mod v0.2. Please NOTE: I am not responsible \
for any problems this installer/mod may cause to your computer. As far as I know, it's safe. Help + \
information at Clanmx.com & clanmx.info." IDNO done
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" ""
done:
WriteUninstaller uninst.exe
SectionEnd

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

Function licenseImage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
MessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no
Abort
no:
FunctionEnd

Function customPage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
MessageBox MB_OK 'After clicking "Ok" Please select a propper TRIBES directory to install !?WTF?! \
Mod to. Make sure you back up your Tribes folder!'
#insert install options/start menu/<insert plugin name here> here
FunctionEnd

Function dirImage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
FunctionEnd

Function instImage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
FunctionEnd

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

; Uninstall pages

UninstPage uninstConfirm un.uninstImage
UninstPage custom un.customPage
UninstPage instfiles un.instImage

Function un.uninstImage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
FunctionEnd

Function un.customPage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
MessageBox MB_OK 'You have chosen to delete !?WTF?! mod from the directory you selected'
#insert install options/start menu/<insert plugin name here> here
FunctionEnd

Function un.instImage
!insertmacro BIMAGE "C:\Documents and Settings\HaCKeR\Desktop\Installer stuff\WTFmod2.bmp" /RESIZETOFIT
FunctionEnd

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

; Uninstaller

; Another page for uninstaller
UninstallText "--!?WTF?! Mod Uninstaller--"

Section uninstall
MessageBox MB_OK "Are you sure you want to completley delete !?WTF?! mod?"
SectionEnd

Dark-energy is offline   Reply With Quote
Old 17th November 2007, 21:14   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You don't need zip2exe. It's only used for converting ZIP files to installers with two clicks and no customizations. What you are looking for is the File command. Start with the simpler examples - example1.nsi.

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
Old 17th November 2007, 21:56   #3
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Mmk, I might convert some code over from example1.nsi to gfx, but I am definetly not starting over.
Dark-energy is offline   Reply With Quote
Old 17th November 2007, 22:11   #4
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Ahh! thank you so much!

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

; The stuff to install
Section "" ;No components page, name is not important

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

; Put file there
File Filenamehere.w/e

SectionEnd ; end the section
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 00:11   #5
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
mmm..
How do we write a shortcut to installer?
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 05:25   #6
Maked0n
Junior Member
 
Join Date: Nov 2007
Posts: 2
Quote:
Originally posted by Dark-energy
mmm..
How do we write a shortcut to installer?
Try this hmne.sourceforge.net

And for desktop shortcut

Section "-Make Shortcut" SEC0XX
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\Name_of_your
_shortcut.lnk" "$INSTDIR\Game.exe" "$INSTDIR\shortcut_icon.ico"
SectionEnd

shortcut icon is optional if u like to have different icon than main game icon
Maked0n is offline   Reply With Quote
Old 18th November 2007, 18:28   #7
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Mmm, but I already have the shortcut, I just need to write it :\
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 19:31   #8
pospec
Senior Member
 
pospec's Avatar
 
Join Date: Jun 2007
Location: Otrokovice, Czech Republic
Posts: 308
Use CreateShortCut please.
pospec is offline   Reply With Quote
Old 18th November 2007, 21:03   #9
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Oh, I get it.

Another thing, last thing and I will stop bugging you guys..

How do you change Installer icon?
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 21:40   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The Icon command would do that.

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
Old 18th November 2007, 22:13   #11
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Err great, uninstaller doesn't work..
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 22:30   #12
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Hmm, what is change shortcut icon code?
Dark-energy is offline   Reply With Quote
Old 18th November 2007, 22:50   #13
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Nvm got it all working
Dark-energy is offline   Reply With Quote
Old 24th November 2007, 15:46   #14
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Hmm, What if I wanted a file to open after it's done installing?
Dark-energy is offline   Reply With Quote
Old 24th November 2007, 20:54   #15
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You could use the .onInstSuccess function, or add a leave function for the finish page...

Stu
Afrow UK is offline   Reply With Quote
Old 24th November 2007, 21:20   #16
Dark-energy
Junior Member
 
Join Date: Mar 2007
Posts: 24
Err that didn't exactally help at all but I did get it to work anyways.

;AIFO
Section "" ;No components page, name is not important

ExecShell "open" "$INSTDIR\Config\WTF.cs"

SectionEnd ; end the section
Dark-energy 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