Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2004
    Posts
    25

    Web download, and Install

    Hi, Well this is the code I came up with, but it's not downloading from my web. This is in the On Next event of the last form (Ready to Install).
    What am I doing wrong? Thanks for your help


    local bdbInstall = true;
    local bKeyExists = false;
    local bsql = false;
    local bresult = false;
    local bdb = false;
    local bsuccess = false;

    --sdbInstall = SetupData.GetPackageProperties("EZDB");
    --bdbInstall = Database.Install;

    if bdbInstall then
    bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");

    if bKeyExists == false then
    -- better check internet connection
    result = HTTP.TestConnection("http://www.scheduleez-pro.com/", 20, 80, nil, nil);

    if result then

    --download sql express and database from our web
    --SessionVar.Expand("%TempFolder%\\setup.exe"),
    --"SQLDB.exe server:
    bsql = HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",SessionVar.Expand("%TempFolder%\\SQ LEXPR32.exe"), MODE_BINARY, 20, 80, nil, nil, nil);
    result = Dialog.Message("dOWNLOADING", "ScheduleEZ was not able to download SQL Express. ", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
    if bsql then
    bsql = File.Run(SessionVar.Expand("%TempFolder%\\SQLEXPR3 2.exe"), "", "", SW_SHOWNORMAL, true);
    if bsql then -- we have installed sql server 'now lets download then db
    bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.ex e"), MODE_BINARY, 30, 80, nil, nil, nil);
    if bdb then -- we have successfuly downloaded the db lets execute it
    bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe "), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
    if bsql then
    bsuccess = true;
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end

    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end
    else --- it is installed so lets just do db
    bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.ex e"), MODE_BINARY, 30, 80, nil, nil, nil);
    if bdb then -- we have successfuly downloaded the db lets execute it
    bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe "), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
    if bsql then
    bsuccess = true;
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end
    else
    result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
    end

    end


    end

    if bsuccess then
    Screen.Next();
    end
    -- advance to the next screen

  2. #2
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    I find this difficult to read due to no indentations on the if/end logic lines. If you wrap CODE tags (the # option) around the code then will display correctly.

    There are two things I note.

    a) The File.Run statement uses an argument parameter. I have seen from experience that sometimes this will not work so you should try moving contents of second parameter into first, and leave second parameter blank. Also use a working folder even if it does not obviously require one.

    For example

    Code:
    bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe ") .. "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SessionVar.Expand("%TempFolder%"), SW_SHOWNORMAL, true);
    b) The second is you have syntax errors in your code. 10 lines from bottom you have SessionVar.Expand("%TempFolder%\\EZDB.ex e"). Note the space in EZDB.ex e.

    John

  3. #3
    Join Date
    Sep 2004
    Posts
    25

    It wont' download, haven't even got to run

    Hi, I pasted formated code into the message box, but it didn't hold the formatting. I apologize, but I tried.
    First, I haven't even reached the run part. I get the error when first trying to download, so maybe need to start off with the code line...
    HTTP.download. then go from there.

    Thanks

  4. #4
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    Is there really a space in your download line in SQ LEXPR32.exe ?

    That would cause the download to fail.

    John

  5. #5
    Join Date
    Jun 2005
    Posts
    470
    Quote Originally Posted by Sheritlw View Post
    I get the error when first trying to download
    What error? In the IDE, or runtime? Could it be something external, like a firewall blocking the installer?

    As for the spaces, it's the forum software that puts them in some potentially 'dangerous' strings like 'sql' or 'exe'. If you put code tags around the pasted code (click # icon) , it will not be modified.

  6. #6
    Join Date
    Sep 2004
    Posts
    25

    No spaces

    I am testing the setup on a virtual machine. I went to the path through IE and no problems accessing it. So there must be something wrong in the code.
    I think maybe we should start with getting it to download and then test the rest.
    Code to the point of download is. I will try to reformat after pasting

    local bdbInstall = true;
    local bKeyExists = false;
    local bsql = false;
    local bresult = false;
    local bdb = false;
    local bsuccess = false;

    --sdbInstall = SetupData.GetPackageProperties("EZDB");
    --bdbInstall = Database.Install;

    if bdbInstall then
    bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");

    if bKeyExists == false then
    -- better check internet connection
    result = HTTP.TestConnection("http://www.scheduleez- pro.com/", 20, 80, nil, nil);

    if result then

    bsql = HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",SessionVar.Expand("%TempFolder%\\SQ LEXPR32.exe"), MODE_BINARY, 20, 80, nil, nil, nil);

  7. #7
    Join Date
    Apr 2001
    Location
    Haverhill, Suffolk, UK
    Posts
    360
    I created a new project, removed all before and during screens, put this in my ON POST INSTALL actions, compiled and run. Had no problem downloading the SQLEXP32 file from your server.

    Code:
    local bKeyExists = false;
    
    -- Commented out as my system does have SQLExpress installed and registry was reporting true - I want to forced the download.
    --bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");
    
    if bKeyExists == false then
      -- better check internet connection
      result = HTTP.TestConnection("http://www.scheduleez-pro.com/", 20, 80, nil, nil);
      if result then
        bsql = HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",SessionVar.Expand("%TempFolder%\\SQLEXPR32.exe"), MODE_BINARY, 20, 80, nil, nil, nil);
      end
    end
    Note that I used the # option (second icon from right above message area when creating message) after I had highlighted the code I wanted to include in the code area. This retains the formatting as you can see.

    If this does not work for you then there must be a firewall problem somewhere.

    Rgds John

Similar Threads

  1. Download from web, installing
    By Sheritlw in forum Setup Factory 7.0
    Replies: 1
    Last Post: 03-19-2007, 05:19 PM
  2. Setup Factory and VS 2005
    By vazir786 in forum Setup Factory 7.0
    Replies: 4
    Last Post: 01-13-2006, 08:47 PM
  3. Install application from web
    By janeto in forum Setup Factory 7.0
    Replies: 2
    Last Post: 11-23-2004, 08:16 PM
  4. Conditional File Download During Install
    By greenace in forum Setup Factory 6.0
    Replies: 1
    Last Post: 05-06-2003, 12:11 PM
  5. HOWTO: Download and Install Files from the Web
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-23-2002, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts