OK, I've managed to rewrite a compact build using open-source autoit (aka ahk) scripting. It's still a work in progress. Also I didn't bother with the console functionality now that this is handled inside Electrum itself.
The good news is that this is a lightweight, transparent and auditable process. Expect new compact builds soon!
; Notes:
; -- requires the latest release of AHK and AHK2EXE, PyQt 4.9.6, Python 2.7 and the 7-zip DLL
; -- first, do a git pull master of the Electrum source code and copy that to %APPDATA%\Electrum_SysFiles
The packer script:
WhichFolder = 1.7.0.1
FileDelete, %A_scriptdir%\Electrum.arc
runwait, cmd /c del *.pyc /s, %WhichFolder%, hide
runwait, d:\tools\7za.dll a "%A_scriptdir%\Electrum.arc" "%WhichFolder%" -r -sfx, d:\tools
FileCount = 0
Loop, %WhichFolder%\*.*, , 1
FileCount ++
msgbox %FileCount% items compacted.
The launcher script:
process, close, python.exe
sleep 100
Rel = 1.7.0.1
commandline = %1% %2% %3% %4% %5% %6% %7% %8%
ReleaseDir = %appdata%\Electrum_SysFiles\%Rel%
if 1 !=
if 1 not contains -P,-w,bitcoin
{
exitapp
}
commandline = -P -w "./electrum.dat"
ReleaseDir = %a_scriptdir%\Electrum_SysFiles\%Rel%
ifNOTexist, %ReleaseDir%
{
FileCreateDir, %ReleaseDir%
Gui, Add, text,, Please wait while unpacking files to the "Electrum_SysFiles" directory...
Gui, Add, Progress, vlvl -Smooth 0x8 p0 w350 h12 ; PBS_MARQUEE = 0x8
Gui, Add, text,, Thanks for using flatfly's optimized builds of Electrum!
Gui, -MinimizeBox
Gui, Show, , Electrum for Windows (flatfly build)
; SetTimer, Push, 61
sleep 850
FileInstall, Electrum.arc, %ReleaseDir%\Electrum.arc, 1
runwait, %ReleaseDir%\Electrum.arc -y -o"%ReleaseDir%\.." ,, hide
}
Groupadd, bado, Electrum 1
Groupadd, bado, Message
EnvSet, path, %ReleaseDir%\`%System`%;%ReleaseDir%\C_\Python27;%path%
Setworkingdir, %ReleaseDir%\C_\ElectrumPY
HourGlassON()
run "%ReleaseDir%\C_\Python27\python.exe" "%ReleaseDir%\C_\ElectrumPY\electrum" %commandline% ,,hide useErrorLevel
WinWait ahk_group bado
WinActivate
WinShow
HourGlassOFF()
FileDelete, %ReleaseDir%\Electrum.arc
exitapp
HourGlassON()
{
CursorHandle := DllCall( "LoadCursor", Uint,0, Int, 32650 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int, 32512)
}
HourGlassOFF()
{
DllCall( "SystemParametersInfo", UInt, 0x57, UInt,0, UInt,0, UInt,0 )
}