Patches: Browse | Submit New | Admin

[#13995] qtruby4 installer for Microsoft Windows 32

Date:
2007-09-16 19:48
Priority:
3
Submitted By:
Jan Wedekind (wedesoft)
Assigned To:
Nobody (None)
Category:
None
State:
Deleted
Summary:
qtruby4 installer for Microsoft Windows 32

Detailed description
Hi,
I have created an installer for Microsoft Windows 32.
It requires Ruby, Rubygems (gem), and Qt-4.3.0 preinstalled.

The installer basically does the following things:
* Create and register uninstaller
* Unpack and install a qtruby4-gem for Windows
* Install libsmokeqt.dll as system DLL
* Optionally add c:\qt\4.3.0\bin to the path (configured by dialog)

The uninstaller reverses all this things.
Enjoy!

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-10-07 11:01
Sender: Jan Wedekind

I forgot to include the rbuic4 before.
you can download the new installer here:
http://vision.eng.shu.ac.uk/jan/qtruby4installer.exe
Here is the new NSIS-script if anyone is interested:

!include Library.nsh
!include nsDialogs.nsh
!include AddToPath.nsh

Name "qtruby4installer"

Caption "qtruby4 installer"
Icon "ruby.ico"
OutFile "qtruby4installer.exe"

ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "qtdir.ini"

LicenseText "License page"
LicenseData "gpl2.txt"

XPStyle on

InstallDir $PROGRAMFILES\QtRuby4


Page license
Page components
Page custom qtdirDialog
Page instfiles

Uninstallicon "ruby.ico"
UninstPage uninstConfirm
UninstPage instfiles


Section "QtRuby4 (required)"

  SectionIn RO
  SetOutPath $INSTDIR
  WriteRegStr HKLM SOFTWARE\QtRuby4 "Install_Dir"
"$INSTDIR"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayName" "QtRuby4"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayIcon" '"$INSTDIR\uninstall.exe"'

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayVersion" "1.4.9"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"Publisher" "Richard Dale, Alexander Kelett, Caleb
Tennis"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"URLInfoAbout"
"http://developer.kde.org/language-bindings/ruby/"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"UninstallString" '"$INSTDIR\uninstall.exe"'

  WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"NoModify" 1

  WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"NoRepair" 1

  WriteUninstaller "uninstall.exe"

  SetOutPath $TEMP
  File "qtruby4-1.4.9-mswin32.gem"
  ExecShell "open" "gem" 'install
"$TEMP\qtruby4-1.4.9-mswin32.gem"' SW_SHOWNORMAL
  IfErrors 0 +2
     Abort "Failed to install QtRuby4 Rubygem!"

  !insertmacro InstallLib DLL NOTSHARED
NOREBOOT_NOTPROTECTED libsmokeqt.dll $SYSDIR\libsmokeqt.dll
$SYSDIR

  ReadINIStr $1 "$PLUGINSDIR\qtdir.ini" "Field
1" "State"
  WriteRegDWORD HKLM SOFTWARE\QtRuby4 "UnsetQtPath" $1
  StrCmp $1 "1" 0 +5
  ReadINIStr $1 "$PLUGINSDIR\qtdir.ini" "Field
3" "State"
  WriteRegStr HKLM SOFTWARE\QtRuby4 "QtPath" $1
  Push $1
  Call AddToPath

SectionEnd

Section "Ruby User Interface Compiler"

  SetOutPath $SYSDIR
  File "rbuic4.exe"

SectionEnd

; Uninstallation of gem does not work when called from
Start-Menu.
;Section "Start Menu Shortcuts"
;
;  SetShellVarContext All
;  CreateDirectory "$SMPROGRAMS\QtRuby4"
;  CreateShortCut "$SMPROGRAMS\QtRuby4\Uninstall.lnk"
"$INSTDIR\uninstall.exe" 0
;
;SectionEnd

Section "Uninstall"

  ReadRegDWORD $1 HKLM SOFTWARE\QtRuby4 "UnsetQtPath"
  StrCmp $1 "1" 0 +4
  ReadRegStr $1 HKLM SOFTWARE\QtRuby4 "QtPath"
  Push $1
  Call un.RemoveFromPath

  DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"

  DeleteRegKey HKLM SOFTWARE\QtRuby4

  !insertmacro UnInstallLib DLL NOTSHARED
NOREBOOT_NOTPROTECTED $SYSDIR\libsmokeqt.dll

  ExecShell "open" "gem" 'uninstall qtruby4'
SW_SHOWNORMAL

  Delete $INSTDIR\uninstall.exe
  RMDir "$INSTDIR"

  Delete "$SYSDIR\rbuic4.exe"

;  SetShellVarContext All
;  Delete "$SMPROGRAMS\QtRuby4\*.*"
;  RMDIR "$SMPROGRAMS\QtRuby4"

SectionEnd

Function qtdirDialog
  Push $1
  InstallOptions::dialog "$PLUGINSDIR\qtdir.ini"
  Pop $1
  Pop $1
FunctionEnd

Function .onInit
  InitPluginsDir
  File /oname=$PLUGINSDIR\qtdir.ini "qtdir.ini"
FunctionEnd
Date: 2007-10-07 11:00
Sender: Jan Wedekind

I forgot to include the rbuic4 before.
Here is the new NSIS-script if anyone is interested:

!include Library.nsh
!include nsDialogs.nsh
!include AddToPath.nsh

Name "qtruby4installer"

Caption "qtruby4 installer"
Icon "ruby.ico"
OutFile "qtruby4installer.exe"

ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "qtdir.ini"

LicenseText "License page"
LicenseData "gpl2.txt"

XPStyle on

InstallDir $PROGRAMFILES\QtRuby4


Page license
Page components
Page custom qtdirDialog
Page instfiles

Uninstallicon "ruby.ico"
UninstPage uninstConfirm
UninstPage instfiles


Section "QtRuby4 (required)"

  SectionIn RO
  SetOutPath $INSTDIR
  WriteRegStr HKLM SOFTWARE\QtRuby4 "Install_Dir"
"$INSTDIR"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayName" "QtRuby4"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayIcon" '"$INSTDIR\uninstall.exe"'

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"DisplayVersion" "1.4.9"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"Publisher" "Richard Dale, Alexander Kelett, Caleb
Tennis"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"URLInfoAbout"
"http://developer.kde.org/language-bindings/ruby/"

  WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"UninstallString" '"$INSTDIR\uninstall.exe"'

  WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"NoModify" 1

  WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"
"NoRepair" 1

  WriteUninstaller "uninstall.exe"

  SetOutPath $TEMP
  File "qtruby4-1.4.9-mswin32.gem"
  ExecShell "open" "gem" 'install
"$TEMP\qtruby4-1.4.9-mswin32.gem"' SW_SHOWNORMAL
  IfErrors 0 +2
     Abort "Failed to install QtRuby4 Rubygem!"

  !insertmacro InstallLib DLL NOTSHARED
NOREBOOT_NOTPROTECTED libsmokeqt.dll $SYSDIR\libsmokeqt.dll
$SYSDIR

  ReadINIStr $1 "$PLUGINSDIR\qtdir.ini" "Field
1" "State"
  WriteRegDWORD HKLM SOFTWARE\QtRuby4 "UnsetQtPath" $1
  StrCmp $1 "1" 0 +5
  ReadINIStr $1 "$PLUGINSDIR\qtdir.ini" "Field
3" "State"
  WriteRegStr HKLM SOFTWARE\QtRuby4 "QtPath" $1
  Push $1
  Call AddToPath

SectionEnd

Section "Ruby User Interface Compiler"

  SetOutPath $SYSDIR
  File "rbuic4.exe"

SectionEnd

; Uninstallation of gem does not work when called from
Start-Menu.
;Section "Start Menu Shortcuts"
;
;  SetShellVarContext All
;  CreateDirectory "$SMPROGRAMS\QtRuby4"
;  CreateShortCut "$SMPROGRAMS\QtRuby4\Uninstall.lnk"
"$INSTDIR\uninstall.exe" 0
;
;SectionEnd

Section "Uninstall"

  ReadRegDWORD $1 HKLM SOFTWARE\QtRuby4 "UnsetQtPath"
  StrCmp $1 "1" 0 +4
  ReadRegStr $1 HKLM SOFTWARE\QtRuby4 "QtPath"
  Push $1
  Call un.RemoveFromPath

  DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\QtRuby4
"

  DeleteRegKey HKLM SOFTWARE\QtRuby4

  !insertmacro UnInstallLib DLL NOTSHARED
NOREBOOT_NOTPROTECTED $SYSDIR\libsmokeqt.dll

  ExecShell "open" "gem" 'uninstall qtruby4'
SW_SHOWNORMAL

  Delete $INSTDIR\uninstall.exe
  RMDir "$INSTDIR"

  Delete "$SYSDIR\rbuic4.exe"

;  SetShellVarContext All
;  Delete "$SMPROGRAMS\QtRuby4\*.*"
;  RMDIR "$SMPROGRAMS\QtRuby4"

SectionEnd

Function qtdirDialog
  Push $1
  InstallOptions::dialog "$PLUGINSDIR\qtdir.ini"
  Pop $1
  Pop $1
FunctionEnd

Function .onInit
  InitPluginsDir
  File /oname=$PLUGINSDIR\qtdir.ini "qtdir.ini"
FunctionEnd
Date: 2007-09-16 20:21
Sender: Jan Wedekind

I testet the qtruby4-installer with the Ruby system
installed by Ruby one-click installer version 1.8.5-21
(ruby185-21.exe).
Date: 2007-09-16 19:55
Sender: Jan Wedekind

Some more information...

I have used the Ruby one-click installer to install Ruby and
Rubygems. It adds the location of Rubygems (gem/gem.bat) to
the path which is required for my installer:
http://rubyforge.org/projects/rubyinstaller/

Qt opensource edition (GPL) is available here:
http://trolltech.com/developer/downloads/qt/windows

I have used Qt-4.3.0. I don't know, wether my gem will work
with other versions of Qt. Most probably not. The installer
for Qt-4.3.0 is available here:
ftp://ftp.trolltech.com/qt/source/qt-win-opensource-4.3.0-mingw.e
xe

Attached Files:

Name Description Download
qtruby4installer.zip Download

Changes:

Field Old Value Date By
status_idOpen2007-10-07 11:02wedesoft
close_date2007-10-07 11:022007-10-07 11:02wedesoft
File Added2518: qtruby4installer.zip2007-09-16 19:48wedesoft