Old 31st May 2007, 07:37   #1
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
php & php-gtk

Hi guys...
I am new as a nsis programming, making package for my project for that i have to check is php and php- gtk is installed or not and get the correct version
Can someone pls direct me or tell links
how to do that??
thanx
dinesh_oi is offline   Reply With Quote
Old 31st May 2007, 12:53   #2
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
i have tried to code but unable to detect php
as
Section "PHP"
ReadRegStr $4 HKLM "Software\Microsoft\PHP" "CurrentVersion"
IfErrors 0 done
MessageBox MB_OK "Your system has PHP"
call peoceed

done:
MessageBox MB_OK "Your system doesn't have php"
Abort

proceed:
SectionEnd


it is giving me the error as::
Error:resolving install function "proceed" in install section "PHP"
Note:uninstall functionsmust begin with "un." ,and install function must not


Can somebody help in finding wat is the error
dinesh_oi is offline   Reply With Quote
Old 31st May 2007, 13:52   #3
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Let's see:
PHP Code:
Section "PHP"
ReadRegStr $4 HKLM "Software\Microsoft\PHP" "CurrentVersion"
IfErrors 0 done
MessageBox MB_OK 
"Your system has PHP"
call peoceed

done
:
MessageBox MB_OK "Your system doesn't have php"
Abort

proceed
:
SectionEnd 
1. What's peoceed? Do you mean proceed? If so, use goto instead of Call.
2. Do you reall need Abort there?


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 31st May 2007, 14:38   #4
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
When i put tried this in my example you can see the exaple at

http://students.iiit.ac*****~dinesh/example.html

it compiles but it behaves starange which i can't understand

in the installer it comes as ...............

InstallDir: "$PROGRAMFILES\example2"
InstallRegKey: "HKLM\Software\NSIS_example2\Install_Dir"
Section: "PHP"
ReadRegStr $4 HKLM\Software\MicrosoftPHP\CurrentVersion
IfErrors ?0:done
MessageBox: 0: "Your system has PHP"
Goto: proceed
MessageBox: 0: "Your system doesn't have php"
Quit
SectionEnd

................
it should not go in done and proceed function then why it is going i used quit instead of "Abort"

Thanx for yr reply
dinesh_oi is offline   Reply With Quote
Old 31st May 2007, 14:40   #5
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
example is ..

; example2.nsi
;
; This script is based on example1.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install example2.nsi into a directory that the user selects,

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

; The name of the installer
Name "example2"

; The file to write
OutFile "example2.exe"




; The default installation directory
InstallDir $PROGRAMFILES\example2

; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)

InstallDirRegKey HKLM "Software\NSIS_example2" "Install_Dir"

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

; The stuff to install

/* php detection */
Section "PHP"
ReadRegStr $4 HKLM "Software\MicrosoftPHP" "CurrentVersion"
IfErrors 0 done
MessageBox MB_OK "Your system has PHP"
goto proceed

done:
MessageBox MB_OK "Your system doesn't have php"
Quit

proceed:
SectionEnd

Section "file_association"

SectionIn RO

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

; Put file there
File "example2.nsi"




; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\NSIS_example2 "Install_Dir" "$INSTDIR"

; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\example2" "DisplayName" "NSIS_example2"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\example2" "UninstallString" '"$INSTDIR\uninstall.exe"'
SectionEnd
dinesh_oi is offline   Reply With Quote
Old 31st May 2007, 15:17   #6
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Maybe you are using IfErrors incorrectly, because I have php installer..and this both works propertly:
PHP Code:
!include "LogicLib.nsh"

Name "example2"
OutFile "example2.exe"
ShowInstDetails show

InstallDir $EXEDIR


Section 
"PHP"
ReadRegStr $4 HKLM "Software\\Microsoft\\PHP" "CurrentVersion"
${IF} $""
DetailPrint "Your system doesn't has PHP"
${ELSE}
DetailPrint "Your system does have php: $4"
${ENDIF}
SectionEnd 
BTW, use [ code ][ /code ] tags


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 31st May 2007, 16:14   #7
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
thanx a lot it solved my problem
dinesh_oi is offline   Reply With Quote
Old 1st June 2007, 15:48   #8
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
Onr more thing ,, I will ckecks the presence of php and php-gtk in the system by regisrty keys .. it they will not there i have to install them first ans then continue further ..
for this issue I just need to attach windows binaries as
File "php-5.2.2-win32.zip" or should i also make an seprate package in which i will put all of the files for php-5.2.2

thanx foe the replis.......
dinesh_oi is offline   Reply With Quote
Old 1st June 2007, 17:54   #9
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
There's a ZipDll plugin for extractig ZIPs.


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 2nd June 2007, 07:01   #10
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
I am trying to download the files using NSISdl as

>NSISdl::download http://www.programmersheaven.com/d/c...F6656&AltURL=2 $0

i have also tried "download_quiet"
But it also didn't work..
it always shows error as "unable to open "
I can further extract it by zipdll plugin...
Can you suggest the error ....
dinesh_oi is offline   Reply With Quote
Old 2nd June 2007, 21:03   #11
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
unable to open can be:
1. bad url format.
2. url doesn't exists.
3. Can't connect to the server.
4. Firewall blocked.
5. No internet connection.
6. Connection to the server was too long or busy


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 4th June 2007, 07:20   #12
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
instead of , nsisdl i used "inetload" but it is always giving
tranfer error;;;
code is
InetLoad::load "http://www.awitness.org/prophecy.zip" $4
Pop $0
StrCmp $0 "OK" dlok
MessageBox MB_OK|MB_ICONEXCLAMATION "Download Error, { $0 }click OK to abort installation" /SD IDOK
;Abort
dlok:
.....

$0 always contains transfer error ...
Can anybody help me in this
dinesh_oi is offline   Reply With Quote
Old 4th June 2007, 08:58   #13
AxelMock
Junior Member
 
Join Date: Apr 2007
Location: Seltz, France
Posts: 46
Just saw this thread today,

Quote:
Originally posted by Joel
[B]Maybe you are using IfErrors incorrectly, because I have php installer..and this both works propertly:
Yes, that's what I stumbled upon, when I read the initial post.

ReadRegStr ....
IfErrors <JumptoIfError> <JumpToIfNoError>

In all the snippets except the one using LogicLib the jumps were vice-versa.

So the following should work:

code:

ReadRegStr $4 HKLM "Software\\Microsoft\\PHP"
IfErrors 0 proceed
DetailPrint "Your system does have php: $4"
proceed:
SectionEnd

AxelMock is offline   Reply With Quote
Old 4th June 2007, 09:13   #14
dinesh_oi
Junior Member
 
Join Date: May 2007
Location: hyderabad
Posts: 12
I am still struggling with "Transfer error"...
can anybody give me a hint ..
dinesh_oi is offline   Reply With Quote
Old 4th June 2007, 13:45   #15
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Quote:
Originally posted by dinesh_oi
I am still struggling with "Transfer error"...
can anybody give me a hint ..
Quote:
Originally posted by Joel
unable to open can be:
1. bad url format.
2. url doesn't exists.
3. Can't connect to the server.
4. Firewall blocked.
5. No internet connection.
6. Connection to the server was too long or busy
Just pick one or more...!!!!


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel 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