On-The-Fly Web Install (tm) Most Frequently Asked Questions (FAQs)

Can the control detect an earlier version of a program and upgrade it automatically if needed?
How to detect if the installation has been declined by the user or by the security setting
How to deploy my app by ASP
How to create Shortcuts on Desktop
How to launch an exe file and pass parameters to it
How to display a specific web page after installing a package
0x8000400 download error


Can the control detect an earlier version of a program and upgrade it automatically if needed?

Yes. On the automatic installation web page, On-The-Fly Web Install allows you to use JavaScript or VBScript to check the registry and individual files, and do the upgrade accordingly. You have the full programming control over what you want to do.

Go to Top


How to deploy my app by ASP

Please download this file (by right click and Save Target As) sample1.asp. It contains a sample ASP script to dynamically deploy two files: bounce.exe and readme.txt. To test the ASP sample, place the file on your ASP web server and open it with your IE web browser from a client machine. The sample dynamically generates the installing script below.

<SCRIPT LANGUAGE="VBScript">
Dim strAppDir
strAppDir = "C:\Program Files\web_install\sample1"
Sub DefineObjects()
Install.AddObject "MyApp","APP","AppName=On-The-Fly Install ASP Sample 1; Group=On-The-Fly Install ASP Sample 1; Uninstall=True; AppDir=" & strAppDir
Install.AddObject "File1","FILE","File=readme.txt; Url=http://www.hexatech.com/on_the_fly_install/asp/readme.txt"
Install.AddObject "File2","FILE","IconName=Bouncing Ball; File=bounce.exe; Url=http://www.hexatech.com/on_the_fly_install/asp/bounce.exe"
Install.AddObject "Uninstall","UNINSTALL","UninstallUrl=http://www.hexatech.com/on_the_fly_install/uninstall_sample1.htm"
End Sub
Sub window_onLoad()
DefineObjects
If Install.Install()=0 Then
Install.DoAction "OpenFile","" & strAppDir & "\Bounce.exe"
'window.navigate "http://www.hexatech.com/on_the_fly_install/install_ok.htm"
MsgBox "The app has been installed to: " & strAppDir
Else
'window.navigate "http://www.hexatech.com/on_the_fly_install/install_error.htm"
End If
End Sub
</SCRIPT>

Go to Top


How to create Shortcuts on Desktop

The shortcuts on the desktop are created with DesktopShortcut and DesktopGroup  keywords.

Example (with DesktopGroup):

Install.AddObject "File2", "FILE", "File=bounce.exe; FileSize=18000; IconName=Bouncing Ball; DesktopGroup=MyGroup; DesktopShortcut=My Bouncing Ball; Url=" & AppUrl & "/bounce.exe"

Example (without DesktopGroup):

Install.AddObject "File2", "FILE", "File=bounce.exe; FileSize=18000; IconName=Bouncing Ball; DesktopShortcut=My Bouncing Ball; Url=" & AppUrl & "/bounce.exe"

 

Go to Top


How to launch an exe file and pass parameters to it

The following sample script illustrates launching Regsvr32.exe to unregister Bar.dll.

If the path contains space characters, the path needs to be quoted. Please note in VBScript syntax, a double-quote character (") is represented by two characters ("").

Example:
strValue = Install.DoAction2("ExecFile", "C:\Temp\Regsvr32.exe", "-u
""C:\Program Files\WebToolBar\Bar.dll""")
or
strValue = Install.DoAction2("ExecFile", "C:\Temp\Regsvr32.exe",
"Parameters=-u ""C:\Program Files\WebToolBar\Bar.dll""; Dir=""C:\Program
Files\WebToolBar""")

Go to Top


How to display a specific web page after installing a package

The following script displays a success.htm web page if the installation is ok.

If Install.Install()=0 Then
    window.navigate "http://mydomain.com/success.htm"
Else
    window.navigate "http://mydomain.com/failure.htm"
End if

Go to Top


How to detect if the installation has been declined by the user or by the security setting

You may use the following code to detect if the installer has been loaded; or detect if the installation has been declined by the user or by the security setting

JavasScript:

function init()
{
    if ( !IsInstallerLoaded() ) 
    {     alert("The installation has been cancelled or disallowed by your security setting.");
            return;
    }
   
//continue here...
}

function IsInstallerLoaded()
{
    try { 
        Install.Action("GetSysDir", "","");
        return true;
    } 
    catch(er) {
        return false;
    } 
}

VBScript:

Sub window_onLoad()

    'Check security setting
    If Not IsInstallerLoaded() Then
        MsgBox "The installation has been cancelled or disallowed by your security setting "
        Exit Sub 
    End If

    'proceed to install your app here

End Sub

Function IsInstallerLoaded()
On Error Resume Next

    If InStr(Install.DoAction("GetSysDir", ""), ":")=0 Then
        IsInstallerLoaded = False
        Exit Function
    Else
        IsInstallerLoaded = True
    End If

End Function

Go to Top


0x8000400 download error

Q. So what does it mean when i try to download Bar.dll, but end up with a Bar.dll that is 1KB and the contents of the file are "<html>-2147467259 (0x80004005)</body></html>"

A. This is related to your IIS web server settings. You may create a virtual dir with read-only permissions and put the Bar.dll in it so the browser would download it, not execute it.

Go to Top