Complete working NSIS 3.0 script for compiling REBOL scipts to Windows Executable incl. Version Ressource ! Grap it !

76 views
Skip to first unread message

Hans Schüren

unread,
Aug 23, 2016, 5:21:27 PM8/23/16
to REBOL
Hello ,

as a beginner in learning REBOL i had the first aim to complete run and compile the program e-mail client from section 

4 - Several Basic Examples

REBOL Programming For The Absolute Beginner   By: Nick Antonaccio !


Only this app , but complete until redy to deploy .exe.


For this aim i got good help and want to thank JOHN in this forum who helped to run the NSIS script.

Also a programming friend i , who send me a private message.


The result of testing the code was that the line : 
 h1 "Read:" f: field "pop://user:pa...@site.com"    btn "Read" [editor read to-url f/text]
is not running.

I couldn't fix the program so i decided to replace the code with a Mailbox code from
olivier auverlot Rebol Manual that works as a single script.

The Result is this working code :
_____________________________________________________________________________________

REBOL [title: "email-client"]


view layout[
    h1 "Send:"
    btn "Server settings" [
        system/schemes/default/host: request-text/title "SMTP Server:"
        system/schemes/pop/host:     request-text/title "POP Server:"
        system/schemes/default/user: request-text/title "SMTP User Name:"
        system/schemes/default/pass: request-text/title "SMTP Password:"
        system/user/email: to-email request-text/title "Your Email Addr:"
    ]
    a: field "us...@website.com"
    s: field "Subject" 
    b: area
    btn "Send"[
        send/subject to-email a/text b/text s/text
        alert "Sent"
    ]
    h1 "Read:" 
    btn "Read" [
               mailbox:  
               [
               scheme: 'pop
               system/schemes/pop/host
               system/schemes/default/user
               system/schemes/default/pass
          ]
          editor read to-url: mailbox          
          ]]
_________________________________________________________________________________________

It is definetly running.

Write emails in textmode and receive emails in textmode.

Its the principle. It is running. No matter if the received data is html format etc. Theese are additional programming steps.

I just want to have fast results and fun.

Now comes the compilation to .exe.

For this step i had two tools in valuation.  XPackerX   and NSIS 3.0

I checked XpackerX and the result was a .exe without ICON change and
the script offers no Version Ressource code.
I couldn't find any in internet for this tool.

Therefore i make an eye on NSIS 3.0 and found a script.

After a lot of attempts and with the help of John this script is running.

It makes a good.exe with ICON change.

Many search leeds me to a nsis scipt that had a Version Ressource option in it.

I pasted the code into the NSIS Script and made attempts.

It is perfectly running and make a very good .exe with all  (author-rights etc)

Here is my complete script that definetly works.  
a .nsi  file script

I have personal tested the e-mail exe for sending and receiving.
--------------------------------------------------------------------------------

; NULLsoft Scriptable Install System
; make a REBOL Script executable
; provided by www.digicamsoft.com
 
; Name of the installer (don't really care here because of silent below)
Name "Namexif"
 
; Don't want a window, just unpack files and execute
SilentInstall silent
 
; Set a name for the resulting executable
OutFile "e-mailclient.exe"

;-----Version Information------

LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"

VIProductVersion "1.0.0.0"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Long Application Name"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© Your Name 2006"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Application Description"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "1.0.0.0"

 
; Set an icon (optional)
Icon "hs_soft.ico"
 
; The stuff to install
Section ""
  ; Set output path to a temporary directory.
  InitPluginsDir
  SetOutPath $PLUGINSDIR
 
  ; put here requiered files
  File "rebol-view-278-3-1.exe" ; a REBOL interpreter
  File "4_SBE_emailclient.r"   ; put one or more REBOL script(s)
 
  ; Execute and wait for the REBOL script to end
   ExecWait '"$PLUGINSDIR\rebol-view-278-3-1.exe" "-s" "$PLUGINSDIR\4_SBE_emailclient.r"' 
 
  ; Set working directory to something else
  ; If it's not set, $PLUGINSDIR will not be deleted
  SetOutPath $TEMP
SectionEnd

-----------------------------------------------------------------------------------------

If you don't believe it , here is the NSIS REPORT too.

I have the scriptfile of REBOL and NSIS in the REBOL folder together with the REBOLVIEW.exe and the application script .r    basta

-----------------------------------------------------------------------------------------

MakeNSIS v3.0 - Copyright 1999-2016 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Processing config: C:\Programme\NSIS\nsisconf.nsh
Processing default plugins: "C:\Programme\NSIS\Plugins\x86-ansi\*.dll"
 + Banner::destroy
 + Banner::getWindow
 + Banner::show
 + BgImage::AddImage
 + BgImage::AddText
 + BgImage::Clear
 + BgImage::Destroy
 + BgImage::Redraw
 + BgImage::SetBg
 + BgImage::SetReturn
 + BgImage::Sound
 + Dialer::AttemptConnect
 + Dialer::AutodialHangup
 + Dialer::AutodialOnline
 + Dialer::AutodialUnattended
 + Dialer::GetConnectedState
 + InstallOptions::dialog
 + InstallOptions::initDialog
 + InstallOptions::show
 + LangDLL::LangDialog
 + Math::Script
 + StartMenu::Init
 + StartMenu::Select
 + StartMenu::Show
 + System::Alloc
 + System::Call
 + System::Copy
 + System::Free
 + System::Get
 + System::Int64Op
 + System::Store
 + System::StrAlloc
 + TypeLib::GetLibVersion
 + TypeLib::Register
 + TypeLib::UnRegister
 + UserInfo::GetAccountType
 + UserInfo::GetName
 + UserInfo::GetOriginalAccountType
 + VPatch::GetFileCRC32
 + VPatch::GetFileMD5
 + VPatch::vpatchfile
 + advsplash::show
 + nsDialogs::Create
 + nsDialogs::CreateControl
 + nsDialogs::CreateItem
 + nsDialogs::CreateTimer
 + nsDialogs::GetUserData
 + nsDialogs::KillTimer
 + nsDialogs::OnBack
 + nsDialogs::OnChange
 + nsDialogs::OnClick
 + nsDialogs::OnNotify
 + nsDialogs::SelectFileDialog
 + nsDialogs::SelectFolderDialog
 + nsDialogs::SetRTL
 + nsDialogs::SetUserData
 + nsDialogs::Show
 + nsExec::Exec
 + nsExec::ExecToLog
 + nsExec::ExecToStack
 + nsisdl::download
 + nsisdl::download_quiet
 + splash::show

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "C:\rebol"

Processing script file: "C:\rebol\NSIS_Script3.nsi" (UTF16LE)
Name: "Namexif"
SilentInstall: silent
OutFile: "e-mailclient.exe"
LoadLanguageFile: C:\Programme\NSIS\Contrib\Language files\English.nlf
VIAddVersionKey: "ProductName" "Long Application Name"
VIAddVersionKey: "LegalCopyright" "© Your Name 2006"
VIAddVersionKey: "FileDescription" "Application Description"
VIAddVersionKey: "FileVersion" "1.0.0.0"
Icon: "hs_soft.ico"
Section: ""
InitPluginsDir
SetOutPath: "$PLUGINSDIR"
File: "rebol-view-278-3-1.exe" [compress] 528595/864256 bytes
File: "4_SBE_emailclient.r" [compress] 347/976 bytes
ExecWait: ""$PLUGINSDIR\rebol-view-278-3-1.exe" "-s" "$PLUGINSDIR\4_SBE_emailclient.r"" (->)
SetOutPath: "$TEMP"
SectionEnd

Processed 1 file, writing output (x86-ansi):
Adding plug-ins initializing function... Done!
Processing pages... Done!
Removing unused resources... Done!
Generating language tables... Done!

Output: "C:\rebol\e-mailclient.exe"
Install: 0 pages (0 bytes), 1 section (2072 bytes), 22 instructions (616 bytes), 29 strings (626 bytes), 1 language table (162 bytes).

Using zlib compression.

EXE header size:              783360 / 36864 bytes
Install code:                    719 / 2780 bytes
Install data:                 528950 / 865240 bytes
CRC (0xC93BE8BE):                  4 / 4 bytes

Total size:                  1313033 / 904888 bytes (145.1%)

-------------------------------------------------------------------------------------------------------------------------------------

So this is full success in detail.

Everyone who is interested in this script has advantages now.

Best Regards

Hans















Reply all
Reply to author
Forward
0 new messages