Maybe a bug, let me know and I can submit it

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Maybe a bug, let me know and I can submit it

Post by DavJans » Mon Jun 23, 2014 9:12 pm

I made myself a small little stand alone app. basically on open card it does some stuff then closes itself.

Code: Select all

on openCard
   put "Looking for Local Install.... " into fld "Status"
   set the defaultfolder to "C:/MFC/Tracker/"
   put the files into installedFiles
   if installedFiles <> "" then
      put "Found" after fld "Status"
      put URL ("file:" & "C:/MFC/Tracker/Version.txt") into cVersion
      put cr & "Current version is " & cVersion after fld "Status" 
      put URL ("file:" & "\\mfcpdc2\QC\Metals Fab tracker\Version.txt") into uVersion
      put cr & "Looking for updated files.... " after fld "Status"
      put cr & "Newest version is " & uVersion after fld "Status"
      
      if cVersion = uVersion then
         put cr & "Current version installed!" after fld "Status"
         put cr & "Starting Tracker.... " after fld "Status"
         --open tracker
         launch url ("file:" & "C:/MFC/Tracker/Metals Fab tracker.exe")
         --close launcher
         lock messages
         quit
      else
         --update tracker
         create folder "C:/MFC"
         create folder "C:/MFC/Tracker"
         create folder "C:/MFC/Tracker/Externals"
         create folder "C:/MFC/Tracker/Externals/database_drivers"
         put cr & "New version found...." after fld "Status"
         put cr & "Current version installed" after fld "Status"
         put cr & "Copying files...." after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Metals Fab tracker.exe") into url("binfile:" & "C:/MFC/Tracker/Metals Fab tracker.exe")
         put cr & "Metals Fab tracker.exe copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\revdb.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/revdb.dll")
         put cr & "revdb.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\revdb.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/revxml.dll")
         put cr & "revxml.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbmysql.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbmysql.dll")
         put cr & "dbmysql.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbodbc.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbodbc.dll")
         put cr & "dbodbc.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbpostgresql.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbpostgresql.dll")
         put cr & "dbpostgresql.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbsqlite.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbsqlite.dll")
         put cr & "dbsqlite.dll copied" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Version.txt") into url("binfile:" & "C:/MFC/Tracker/Version.txt")
         --open tracker
         launch url ("file:" & "C:/MFC/Tracker/Metals Fab tracker.exe")
         --close launcher
         lock messages
         quit
      end if
      put installedFiles into fld "temp"
      put cVersion after fld "temp"
   else
      put "Not Found" after fld "Status"
      put  cr & "Installing  MetalsFab Tracker..." after fld "Status"
      --Create directory
      create folder "C:/MFC"
      create folder "C:/MFC/Tracker"
      create folder "C:/MFC/Tracker/Externals"
      create folder "C:/MFC/Tracker/Externals/database_drivers"
      --install tracker
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Metals Fab tracker.exe") into url("binfile:" & "C:/MFC/Tracker/Metals Fab tracker.exe")
         put cr & "Metals Fab tracker.exe installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\revdb.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/revdb.dll")
         put cr & "revdb.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\revdb.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/revxml.dll")
         put cr & "revxml.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbmysql.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbmysql.dll")
         put cr & "dbmysql.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbodbc.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbodbc.dll")
         put cr & "dbodbc.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbpostgresql.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbpostgresql.dll")
         put cr & "dbpostgresql.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Externals\database_drivers\dbsqlite.dll") into url("binfile:" & "C:/MFC/Tracker/Externals/database_drivers/dbsqlite.dll")
         put cr & "dbsqlite.dll installed" after fld "Status"
         put url("binfile:" & "\\mfcpdc2\QC\Metals Fab tracker\Version.txt") into url("binfile:" & "C:/MFC/Tracker/Version.txt")
         --open tracker
         launch url ("file:" & "C:/MFC/Tracker/Metals Fab tracker.exe")
         --close launcher
         lock messages
         quit
      end if
end openCard
It's pretty stone age I'm sure but was what I could dream up in one afternoon. Also it works so there is that...

The problem I have now though, and I don't know of a way around it is, now when I try opening it to edit it with livecode it "runs" instead of just opens, so a few things are happening. First, I cant edit it because it closes livecode as soon as it opens. Second, any other projects I have open also get closed without a prompt to save. (I didn't loose anything important because I save more than you should probably be allowed to). Is this normal behavior or is it a bug? If it is normal then how do I edit my file?

I can open the .livecode file in Notepad++ and delete "quit" but if I do that and save over it will it corrupt the .livecode file?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: Maybe a bug, let me know and I can submit it

Post by sefrojones » Mon Jun 23, 2014 9:17 pm

Before you open the stack in the IDE, make sure you turn off messages by clicking this button :
Capture.PNG
Hope this helps!

-Sefro

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: Maybe a bug, let me know and I can submit it

Post by DavJans » Mon Jun 23, 2014 9:47 pm

Genius!

Thnx Sefro
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Post Reply