I have been bashing my head against this problem for a week and all I have to show for it is a sore head!
I am trying to use iExpress to create a self-extract package for "MyProg". It ought to be really really simple! I am using the install script below as the install script in iExpress. It works fine if I just run the script standalone but it fails with no messages when I run the self-extract exe
' ========= INSTALL THE MyProgram.EXE FILE ======================
Option Explicit
Const ALL_USERS = True
dim fso, tfolder
set fso=CreateObject("Scripting.FileSystemObject")
Const TemporaryFolder = 2
Set tfolder = fso.GetSpecialFolder(TemporaryFolder)
' Set up the target folder
dim newfolder, newfolderpath
newfolderpath = "c:\Program Files\MyProgram"
If Not fso.FolderExists(newfolderpath) Then
Set newfolder = fso.CreateFolder(newfolderpath)
WScript.echo "A new folder has been created at: " & newfolderpath
Else
WScript.echo newfolderpath & " already exists"
End If
' Copy the file to the target folder
dim filespec, toloc
filespec=tfolder & "\MyProgram.exe" ' Where else would I find the newly unpacked file?
toloc="c:\Program Files\MyProgram\"
If fso.FileExists(filespec) Then
fso.CopyFile filespec, toloc, true
WScript.echo filespec & " copied to " & toloc
Else
WScript.echo "Unable to find " & filespec
End If
' ===================================================
Help! What am I doing wrong?
Garth
I am trying to use iExpress to create a self-extract package for "MyProg". It ought to be really really simple! I am using the install script below as the install script in iExpress. It works fine if I just run the script standalone but it fails with no messages when I run the self-extract exe
' ========= INSTALL THE MyProgram.EXE FILE ======================
Option Explicit
Const ALL_USERS = True
dim fso, tfolder
set fso=CreateObject("Scripting.FileSystemObject")
Const TemporaryFolder = 2
Set tfolder = fso.GetSpecialFolder(TemporaryFolder)
' Set up the target folder
dim newfolder, newfolderpath
newfolderpath = "c:\Program Files\MyProgram"
If Not fso.FolderExists(newfolderpath) Then
Set newfolder = fso.CreateFolder(newfolderpath)
WScript.echo "A new folder has been created at: " & newfolderpath
Else
WScript.echo newfolderpath & " already exists"
End If
' Copy the file to the target folder
dim filespec, toloc
filespec=tfolder & "\MyProgram.exe" ' Where else would I find the newly unpacked file?
toloc="c:\Program Files\MyProgram\"
If fso.FileExists(filespec) Then
fso.CopyFile filespec, toloc, true
WScript.echo filespec & " copied to " & toloc
Else
WScript.echo "Unable to find " & filespec
End If
' ===================================================
Help! What am I doing wrong?
Garth