deployment basics

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Thu Nov 29, 2012 6:51 pm

oh my gosh!

Yes - changing "of me" to
revCloseDatabase the cDatabaseID of stack "disaster_recovery"
did it!

So the key is to make sure that Livecode is closed and the database is closed properly before trying to open the windows .exe
(I also have kept the other suggestions - for delaying it, etc.)


Thank you!!!!!

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: deployment basics

Post by Klaus » Thu Nov 29, 2012 7:14 pm

:)

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Thu Nov 29, 2012 7:36 pm

nope...not there yet.

Accomplished it once, but now it's back to not working again.

So, let's start again.

I wiped out my database because I thought various threads might be open and I wanted something clean. I created a new database with my app. I also am makiing sure that when the stack closes, the database is closed.

With all of that, when I run my real app on my laptop, I get different IDs each time for the database. First it's 7, then 15, then 19,now it's 31. Each time I open and close, it's different. I would think it should be 1 every time...so this doesn't seem normal lto me.

I have put an answer tag on the close stack so I know that it is closing the database each time (answer 1 before it and answer 2 after). Here is the script I am using to close the database

Code: Select all

 revCloseDatabase the cDatabaseID of stack "disaster_recovery"
Anyway - it's all running fine on my laptop.

Then I have a little test stack - with one button - that I have created as a windows standalone. The button's job is to open the database (the same one used by my real app) and get its ID. That's what succeeded one time - when I was so happy! Now it fails (meaning that it never connects to the database to execute the request for an ID - probably because it thinks the database is open (at least that is my current theory) - which in one way doesn't make sense because on my laptop, I can use the same code to get the ID multiple times and get it every time....(if that is bad because I'm not closing the database, remember that I deleted my old database, so this issue can't be the problem).

So now I'm going back in circles.

When I close Livecode and remove the stack from memory it does NOT go through the close stack script....So is that the problem?

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Thu Nov 29, 2012 8:21 pm

I have this test stack - that has one button. If there is no database, it creates one. If there is a database, it gets the ID.

I destroyed my database so there is no database - and it won't create a new one. So I don't know why it connected to the database once- but it seems that the windows .exe simply won't talk to the database.

Here is the code for my stack

Code: Select all

on databaseConnect
answer "got to connect"
   local tDatabasePath, tDatabaseID

   ## The database must be in a writeable location
   put specialFolderPath("documents") & "/tasks4.sqlite" into tDatabasePath                                                                                                                                                                               
   ## Open a connection to the database
   ## If the database does not already exist it will be created and we will add the table
   if there is not a file tDatabasePath then
      answer "we need to add a database"
      answer tdatabasePath
put revOpenDatabase("sqlite", tDatabasePath, , , , ) into tDatabaseID
answer "did we get here???"
      ## Store the database id as a custom property so other handlers can access it
      set the cDatabaseID of me to tDatabaseID

      databaseCreateTable
   else
answer "there is a path" & tdatabasePath & " is tdatabasepath"
      put revOpenDatabase("sqlite", tDatabasePath, , , , , ) into tDatabaseID
      ## Store the database id as a custom property so other handlers can access it
      put the result into twhat
      answer twhat
 answer tdatabaseID & " is tdatabaseid"
      set the cDatabaseID of me to tDatabaseID

   end if
end databaseconnect

on closecard
   answer "1"
   revCloseDatabase the cDatabaseID of stack "TEST"
   answer "2"
end closecard

on databaseCreateTable

   put "CREATE TABLE basics (id int(10), email char(100), pass char(50), buddy char(100),question char(200), answer char (150),tid char(5),expiration_month int(2), expiration_year  int(4) ,account_type char (10),keep_informed char(5))" into tSQL
   revExecuteSQL the cDatabaseID of me, tSQL

   ## Add a tasks table to the database
   put "CREATE TABLE tasks (id int(10), title char(50), description char(500), completed char(10),topic char(50),temprow int(10),kind char(10))" into tSQL
   revExecuteSQL the cDatabaseID of me, tSQL
   
      ##put "CREATE TABLE tasks_spreadsheet (id int(10), title char(50), description char(500), amount REAL, task_ID int(10), linenumber int(10),topic char(50))" into tSQL_spreadsheet
      ##revExecuteSQL the cDatabaseID of me, tSQL_spreadsheet
               
      answer "Welcome to the Disaster Planning and Recovery App.  This app requires Internet access.   Please register in GetDocs."

      end databaseCreateTable
Here is the code for the button.

Code: Select all

on mouseUp
   answer "I'm here"
   databaseConnect
end mouseUp
That's all there is.

I set it up for windows standalone - nothing else.

In the standalone settings I have Image

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Fri Nov 30, 2012 1:57 am

I have just realized that my .exe sample works fine when executed directly from my computer (i.e. it finds the database) - but doesn't when the files are downloaded from the Internet. Since the .exe is too large to email (and it has additional files) - it seems like downloading it from the internet is necessary.

First, I have made a basic assumption - I believe that I have confirmed that downloading it from the internet brings the extra files - but somehow they are changed.

Next, assuming the exe brings everything it needs, I think that the problem has everything to do with getting the proper certificate for the .exe. I was messing around trying to figure out how to get a certificate, when I realized that once I get it, I don't know what to do with it - because the standalone settings for windows doesn't have any place for a certificate.

Yet, when you download my app from the Internet - it gives a warning notice -and the only way to remove it (and hopefully access the database) is to get one of these certificates.

How does all of this work?

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: deployment basics

Post by Klaus » Fri Nov 30, 2012 11:39 am

Hi,

signing software is done AFTER you build the standalone, so Livecode is not involved here!

Do this:
1. Go here: http://codesigning.ksoftware.net
2. Click "Download kSign (its free!)"
3. Download the "kSign.exe" application and sign your EXE(s).
This is almost self-explaining.

This will get rid of these ugly, paranoid (and completely unjustified!) Windows error/warning dialogs.
Thank you Microsoft! :evil:


Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Fri Nov 30, 2012 4:01 pm

I went to ksigning.com yesterday - didn't see the "free" part - and bought the signing software. I am waiting for approval. In the meantime, today I did the free one, and now my app has "DisasterApp was reported as unsafe" - and deletes it before downloading.

So...I am going to find out about the paid version and hopefully that will cure the unsafe part????

This process requires unending patience.
:roll:

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Fri Nov 30, 2012 6:11 pm

Hey - I'm back!

Got the signing certificate - that's good. What's bad is that it still won't connect to the database. Talked to the digital certificate people and they said it was probably a path issue - but had nothing to do with security.

So, I'm back here. The exe that I create works great IF you open it directly on my laptop. Works great means that it connects to the database.

If you download it, it doesn't connect to the database.

If you ftp it from the internet to somewhere else on my computer, it works - and connects to the database. So there is something with the downloading process that isn't right.

The URL is http://www.toolsforbusiness.info/disast ... er_app.exe. It is supposed to bring with it an external folder (with drivers in it that Livecode makes), two documents, and a tasks4.sqlite database (although I think it's supposed to create this database - so I don't think it's required). It will open up just fine - but it's supposed to have popups getting the databaseID. If the popups don't appear, it isn't reaching the database.

Currently, it still has a security warning on download, even though the software is signed. The signing company says that security warning should go away shortly, but if people decide to download it anyway, should NOT affect anything in the software.

So....why won't it connect to (or create) the database???

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: deployment basics

Post by jacque » Fri Nov 30, 2012 6:55 pm

Some files do not travel well over the internet. Try zipping it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Fri Nov 30, 2012 7:29 pm

broken.

zip Will open and will unzip - but .exe won't connect to the database

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Sat Dec 01, 2012 12:19 am

zipping with RAR works!!!!

zipping with .zip does not

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: deployment basics

Post by Klaus » Sat Dec 01, 2012 1:21 pm

Hi Carolyn,
cusingerBUSCw5N wrote:...Currently, it still has a security warning on download, even though the software is signed.
A big problem is, that Windows thinks that an EXE file that has NOT been correctly installed by a "Setup.exe" etc. is NOT kosher in general!
This is not a Mac, where a user can simply drag and drop an APP into the "Applications" folder from a downloaded DMG, that would be far too easy! 8)

So I came to the conclusion that one needs to install a software "the Windows way", which means that some registry entries are made
and an "uninstaller" is also supplied, so you can de-install the software again via the WIndows "Uninstall Software" control panel.

Here two links to installer software that will do all this for you.

A Livecode based commercial installer software:
http://www3.economy-x-talk.com/file.php ... r-building

And a free utility:
http://www.jrsoftware.org/isinfo.php

I think this is neccessary for you to use one of these of Windows will never "like" your software.
So....why won't it connect to (or create) the database???
Your scripts look correct, so I think it has to do with missing DB drivers and/or a pathname problem!?


Best

Klaus

cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

Re: deployment basics

Post by cusingerBUSCw5N » Thu Dec 20, 2012 3:16 am

OK. This problem has been resolved - thanks to tech support.

When you deploy to Windows - you need to make sure that everything is zipped properly AND that the files are kept in the correct folder "EXTERNALS". So, first you create the standalone. Then you create an installation package. In my case, I used Inno Setup 5. Originally, I was selecting the .exe that I created, and then selecting the folder "externals" - but that was WRONG - because it was just taking the files out of the folder and putting them with the .exe - not keeping them in the folder Externals. So, once I selected the folder "Windows" - the installation software then took the whole folder - but kept all the files in the folders where they should be. After I did that, the installation package worked - and my app could access the database.

Bottom line - for Windows, the database function can't work without the EXTERNALS folder.

Likewise, you cannot FTP the .exe standalone :D that you created (and the folders) - and put them on your server and expect the .exe to work - because the .exe that Livecode creates does not bring with it the externals folders. You have to zip the whole thing (in the proper folders) OR do an installation package so that everything comes together and is in the right folders.

Hopefully, my explanation will help someone else. :D

Post Reply

Return to “Windows”