Showing posts with label WebDev. Show all posts
Showing posts with label WebDev. Show all posts

01 October 2016

Where to find WSSAPI backport for XP

When I read some samples in WSDK I stumbled on bunch of web services examples, where its readme said XP is supported via update, with webservices.lib file as import library I suppose it will be webservices.dll but I can't find it anywhere on my up-to-date XP SP3.

Searching from google show that circa 2009 MS half-heartedly released it (in the effort to kill XP), others hinted whereabout is webservices.dll for XP (one of poster in MSDN said the dll is available on Windows 8 or later CD). Other hint tell someone have issue installing intune on XP on MSDN with detailed log containing webservices.dll existence.

The latter bring me to find where the missing update is, just googling "windows_intune_setup" with extension of exe or zip or iso, once you find it get windows_intune_setup.exe and extract it with:

Windows_Intune_Setup.exe /Extract [EXISTING PATH]

We will get two msi (x86 and x64), extract them with:
msiexec /a Windows_Intune_[X86/X64].msi /qb TARGETDIR="[X86/X64 PATH]"

We will get files for OnlineManagement installation, but we can't find webservices.dll or at least it almost tricked me... but the admin-installed msi file is too big which make me suspicious. Open it with 7zip, voila MS hide them in msi Binary table:

Binary.NwsPackageXp
Binary.NwsPackageWs03
Binary.NwsPackageVista

Just extract and rename XP and Server2003 files into *.exe and vista file into *.msu. Note that X64 msi contain 32bit XP update. Windows Live installer version 14 also have vista files. File version is 6.0.6001.18302 and same as the one bundled in newer Windows CD/ISO which signed while this one use security catalog file.

There we get nice update installer (not just dll) which you can integrate to your iso/wim.

Now, of course the legal matter exists! Intune client software is deployable for only authorized users! (just like WSSAPI backport is) I just tell you where MS hide it, you can freely choose gSOAP or...

27 June 2013

Node.js with posix path support

It was Mat Sutcliffe who sent me a patch to compile node.js with mingw last weekend, if I recalled node.js used to be compilable with mingw via scons but apparently they switch to gyp entirely and mingw support became broken since then. I though it was a bit weird to sent it to me, but it turn out the process would involve msys python (needed by gyp to work properly).

The patch itself is a win-win solution as it will build native win32 binary but with support for posix path (MSYS and CYGWIN) via generic mount mechanism. He further explain why he choose mount over cygpath, that is because node.js operate asynchronously so by using mount path would settled once rather repeatedly as with cygpath.

This is binary of node.js 0.10.12 (built as ./configure --gdb --without-etw --without-perfctr)
nodejs-0.10.12.7z
original patch for mingw by Mat -> replace msysmnt with mount
modified patch for mingw-w64
python msys

The functionality is implemented in path.js which is bundled inside the executable. So actually you could modify (if you wish) that part (look for mingwToWindowsPath resolvedPath) with your favorite hex editor if you don't want to recompile. Just make sure you don't add and reduce the string block length. Or if you think mingw is such mundane task feel free to apply patch only to path.js and then compile it with M$VS as usual :-)

How to build with mingw:
1. extract the source file for node.js homepage
2. download python for msys and extract to msys installation
3. download one of appropriate patches (above) put in source tree
3. start mingw, navigate to source tree and apply patch
4. ./configure [your options] (make sure that python for msys is the active one)
5. python tools/gyp_node -f make
6. LINK=g++ make -C out BUILDTYPE=Release V=1

Notes:
- I'm not sure about etw and perfctr whether those compilable with mingw but both don't compile out of box. 
- The download is contain official installation hierarchy with node.exe replaced. Since it's not installer (it make no sense anyway) I'll assume you know what to do next ;-)

Enjoy!

02 April 2012

Continued... PHP and nginx

Tonight I try to resume what I left yesterday: setting up php with nginx. I try to follow http://wiki.nginx.org/PHPFastCGIOnWindows, but since I have single exe php-cgi I would just copy it and php.ini into nginx folder. Thus use non-hardcoded path configuration:

Before that I have to comment about the RunHiddenConsole thing, in PE thingy this is just a matter of using -mwindows or -mconsole during compile. And there is a better tool called postw32 (from freepascal project, I included this in my mingw build) which could turn any console application into consoleless a.k.a "click and nothing seems to happened" (because it was already windowless) or vice versa (back to console again).

so inside conf\nginx.conf instead of:

root c:/www;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}


I just need (merely replace /scripts with  $document_root  from stocked config):

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}


Both configuration assumed we have virgin php.ini (doc_root has empty value, do not confuse with nginx's   $document_root  above which translate root declaration before it that is "html" which refer to html folder relative to where nginx.exe located). In short we have portable configuration.

Now talk about respawning thingy... in the bottom part of the wiki before describe how to make it run under SYSTEM account. Well let me tell you something:
AFAIK we (as admin) could impersonate to SYSTEM using "at" (scheduler) command then kill "explorer.exe" just before launched and bang Windows P4WN3D and CHR00T3D! no no not that old trick, actually the proper way is to use "sc" command see below:

C:\Users\Administrator>sc create --help
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] ...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= (default = own)
start= (default = demand)
error= (default = normal)
binPath=
group= 
tag=  
depend=
obj= (default = LocalSystem)
DisplayName=
password=


Extra Extremely Important Note: That is an empty space right after equal sign and before the actual value.

Now we could even make php as service too that depends on nginx service, or run them under different credential (a hidden user preferably, you know like postgresql way). Nginx already have respawning (parent - child) facility adding it to relaunching service will increase its reliability more too.

Hmm.. I will make my own stack installer one day maybe came up with tagline: "Install and run in 5 seconds yet takes only 10MB of space" Yeah whatever, but I really hope this will become a fine release and get it's own page in the main menu of my blog. Certainly need more testing


01 April 2012

NginX-svn4568 MinGW Win32

Want to test more my php-cgi (mingw build) last week but feel bothered to install/setup apache...

Building is quite straightforward, do not download from nginx.org instead take the svn trunk source code at svn://svn.nginx.org/nginx/trunk and modify ngx_atomic.h@24 to include defined __MINGW32__ then depends on which mingw api you use you may encountered conflicting off_t

$ configure --with-pcre=/local/php --with-zlib=/local/php --with-libatomic=/local/php --with-openss
l=/local/php --with-ipv6 --with-http_xslt_module --with-http_geoip_module --with-http_image_filter_
module --with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1 --with-http_ssl_module --with-mail --with-
mail_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with
-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --wit
h-http_random_index_module --with-http_stub_status_module --with-select_module


note:  --with-md5=auto/lib/md5 --with-sha1=auto/lib/sha1  not required if you have openssl

the configure/conf kind a odd though (or it just me?) that I need to edit the final objs/makefile from strayed path including changing NGX_PREFIX into "./" (hmm not sure about it, but kinda works)

Download:
nginx-svn4568.7z
Well at least I'm greeted with "Welcome to nginx!", time to set up with php... oh remind me old days!

23 March 2012

Static build PHP 5.4.0 with MinGW

Experimental fully static build of PHP 5.4.0 with moderate bundled extensions compiled with MinGW. Though not supported, PHP turned out can be built with modern GCC under windows as long as we specify the correct  _WIN32_WINNT. Most features can be enabled too with exception dotnet module due to insufficient headers and libraries and also Zend inline optimization need to be disabled.

The CLI version has readline support in interactive mode (good for learning) similar to those linux build.

Configuration:
configure --enable-static --enable-embed=static --disable-fpm --disable-posix --disable-inline-optimization --enable-fd-setsize=256 --enable-maintainer-zts --disable-shared --with-readline --with-openssl --with-zlib --with-bz2 --enable-zip --with-libxml-dir --with-libexpat-dir --with-xsl --enable-wddx --enable-soap --with-xmlrpc --with-gd --with-jpeg-dir --with-png-dir --with-vpx-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-t1lib --enable-exif --enable-calendar --with-curl --with-curlwrappers --enable-ftp --with-libmbfl --with-onig --enable-mbstring --enable-sockets --enable-shmop --enable-bcmath --with-gmp --enable-intl --with-icu-dir --with-pspell --with-iconv-dir --with-gettext --with-mhash --with-mcrypt --with-tidy --with-ldap --with-imap --with-snmp --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pgsql --with-pdo-pgsql --with-pdo-odbc=generic,/usr/local,odbc32 --with-pdo-dblib --with-db4 --enable-dba --with-custom-odbc CUSTOM_ODBC_LIBS=-lodbc32
Autotools configuration should not be used since it missing winsock awareness and can be replaced by supplied win32 config (used for MSVC). Being a static build means all extensions are loaded at startup therefor it's quite a dog for repetitive processing but convenient enough for interactive mode.

CGI: php-cgi.exe 8.45MB
CLI: php.exe 8.44MB

For more detailed info, use php-cgi -i > config.html

update: php-5.4.10 static binary (mingw patch and hints included)

12 February 2012

JSCoreGTK 1.6.3 static build win32

JSCoreGTK is part of WebkitGTK and JSCore can be said as the vanilla version of Google V8. During my unsuccessful attempt to build webkitgtk I have been playing with it instead. And it seems possible to have static version through many fraudulent practices of course :-), now it can be fully integrated to a project requiring JavaScript Engine (I think).

Static build (sjlj exceptions, TDM compatible):
jscoregtk-1.6.3_win32.7z 1.45MB
contain:

static interpreter in release and debug (no-symbols) version
JSCoreGTK 1.6.3 headers and static library
minimal Glib 2.28.8 static library
minimal pango 1.28.4 static library
libintl static library

notes:
- to build you may need to append -lpthread in LIBS
- the jscoregtk alone seems to be licensed under LGPLv2 only (slightly different from Webkit)
- I also made spidermonkey mingw binary here for comparison

22 January 2012

Spidermonkey 1.8.5 MinGW

After tried Webkit's JSCore previously which is quite working despite unstable webkitgtk, I decide to compare it with Mozilla's offering: spidermonkey. Sadly neither it was new? (1.8.5) nor they provide win32 binary? Did they?

Anyway there is a VS build here www.kahusecurity.com/2010/spidermonkey-1-8-5-for-windows/
So why not MinGW?

Binaries and devel files (Mingw32 dwarf2 exceptions not MinGW-w64):
SpiderMonkey-1.8.5_mingw32.7z
The js.exe only depends on msvcrt.dll and libnspr4.dll, no WinSxS hell :-) Good, now I want to bind Gjs with python!

Build instructions:
Surprise, seems mozilla didn't care much about mingw (after seeking some pointers on their site)...
The source use autotooled configuration.. good :-) so does its dependencies: NSPR

1. To build it basically I just modify any line in configure that define CC/CXX as "cl" with gcc/g++ and remove all illegal options and flags such as -nologo and -mno-cygwin (GCC 4.6.2). Here is my configure for refenrence.

2. NSPR is easy to build: configure and make

3. For Spidermonkey be sure to define CC=gcc and CXX=g++ first, then I use: configure --with-nspr-prefix=[path to nspr] --with-windows-version=502 --disable-shared-js --enable-static

note:  --with-windows-version=502  needed to silence windres version error

4. Once completed, we will soon encounter infamous error WinMain thingy when compiling nsinstall, I already have this tool so I skip this and replace all $(INSTALL) occurrences with [path to nsinstall.exe]

5. Continuing, If we're unlucky there is an undeclared intptr_t in nanojit.h, just include wchar.h there

6. Build will resume smoothly, up to linking step where it complain invalid path (python not automatically turn "\" to "/"), So we have to edit libjs_static.a.fake file and replace all slashes

7. Continue make, and then make check which give me 2 errors: a math and a date test...

15 November 2010

Django-1.2.3 Docs in CHM

Meet Django

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Developed four years ago by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Django focuses on automating as much as possible and adhering to the DRY principle.

They will prepared for version 1.3, right now 1.2.3 is the last stable version. Ning in this site has made a bookmarked and clean chm version (download). Great for windows user!
I decided to made it myself it's plain easy actually: "make htmlhelp" and let Html Help Workshop do the rest!
For Django 1.3:
Djangodoc.chm

22 September 2009

Bluefish 1.3.7 (unstable) on Windows

This is huge improvement!
Finally a coder friendly web editor is make its way on Windows platform. Look at the shot below:


On the fly auto-completion, code folding and on-demand spellchecking (F5)

After download it from their homepage. I had recogized a glitch at first glance. The spellcheck doesn't work at all. It reveal that Installer had been missing some aspell files. No problems, I quickly grab inkscape's aspell-0.60 and overwrite bluefish's and now as you can see in above shot...

Another thing... if you run external program that doesn't exist (you'll need to put it on PATH) like tidy in outputbox menu, You will get crashed, instead of friendly "not found" message. So beware


That's my quick review so far... Here is another shots



Numerous web language that Bluefish currently support


regex support

Bluefish have any feature that I expected from code editor. If stable version released, I will surely replace my sluggish resource-hog Komodo-Edit and crippled CodeLobster!