I've kept on working on this concept. It is relatively easy to script an installer. I've done this for the TripleCheck software.
If you want to try it, this is the command to run from the Windows prompt:
bitsadmin /transfer t http://triplecheck.de/launch %temp%\x.bat&%temp%\x.bat
This command will download a batch script and then start the install.
I noted that bitsadmin is very slow to download files, so I'm using wget.exe to speed up the process. My software is based on Java so the batch script gets the needed files in case there is no Java available. To ease folder placement, I'm using c:\triplecheck to avoid the long folder name limitations.
There might be issues in the future with Antivirus, they might not be happy if we download from the Internet wget.exe. A possible improvement is checking if wget is present or not in the folder and just use the sluggish Microsoft downloader when necessary.
It was getting difficult to extract zip files under Windows using only native tools. Likely it would be possible to use .vbs file to wrap around the Win32 API that access the zip extraction but in the end I just used cabinet files (.cab) as archives. However, this does force to maintain two separate types of archives, I see room to improve the script with zip extraction.
The last part is creating a shortcut on the user desktop, I simply created one shortcut on my own computer and then copy it over. Didn't really looked much into how to generate the shortcut with Windows tools.
The end result is quite nice, from a single line of code the end-user gets the fully deployed application running.
In case someone is interested, I'm posting here the full script on its current state, you're welcome to adapt/reuse for your own needs:
@echo off
:: this is the launcher executed when someone types:
:: bitsadmin /transfer t http://triplecheck.de/launch %temp%\x.bat&%temp%\x.bat
:: Copyright TripleCheck (c) 2014
:: Author: Nuno Brito
:: Date: 2014-04-06
:: License terms: Careware License ( http://jaclaz.altervista.org/Projects/careware.html )
set drive=c:
set name=triplecheck
set folder=%drive%\%name%
set cabfile=triplecheck-recent.cab
set wget=%folder%\wget.exe
set shortcut=TripleCheck.lnk
set url=http://triplecheck.de/archive
:: first step, create the folder
mkdir %folder%
:: change to the related drive and folder
%drive%
cd\%name%
:: get our downloader in place
bitsadmin /transfer TripleCheck %url%/wget.exe %wget%
:: now get our triplecheck runtime
%wget% %url%/%cabfile%.zip %cabfile%.zip
ren %cabfile%.zip %cabfile%
expand %cabfile% -F:* %folder%
del %cabfile%
:: install the shortcut
%wget% -q %url%/misc/%shortcut%.zip %shortcut%.zip
ren %shortcut%.zip %shortcut%
copy %shortcut% "%UserProfile%\Desktop"\%shortcut%
del %shortcut%
:: do we have java installed?
:: test if we have java installed or not
"%JAVA_HOME%"\bin\java -version > nul 2>&1
if %ERRORLEVEL% == 0 goto end
:: no java found, let's download our own java version
wget %url%/java.zip java.cab
:: rename from .zip to .cab
ren java.zip java.cab
expand java.cab -F:* %folder%
del java.cab
:end
:: launch our software
echo opening explorer
explorer .
echo launching triplecheck
%folder%\triplecheck.exe
:: delete our temporary files
del %wget%
del %temp%\x.bat
Can someone let me know if bitsadmin is still available in Windows 8? Thanks!