Update FWH programs via SQL-database?
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Update FWH programs via SQL-database?
Hello,
I have SQL-programmas installed on servers or NAS.
The exe-files are installed on a shared directory on de server. So each time I do an update, all users have the new version.
The only problem is when someone use the database remotly, I have to installed the programm to that PC localy.
The programm is installed on that PC, and via the correct IP-adres and PORT-forwarding, it connect to the database.
I can olso use a VPN-connection, but only to use that, I don't want to do this.
Now I had an idea to read the exe-file in a blob-field of a table in the database, and when the user is connected, the program check's if this is a new version, and write it to the PC.
I only hve to install it one time on the pc, then the updates are automaticly.
Is this a goed idea? Does anyone allready try this?
I have SQL-programmas installed on servers or NAS.
The exe-files are installed on a shared directory on de server. So each time I do an update, all users have the new version.
The only problem is when someone use the database remotly, I have to installed the programm to that PC localy.
The programm is installed on that PC, and via the correct IP-adres and PORT-forwarding, it connect to the database.
I can olso use a VPN-connection, but only to use that, I don't want to do this.
Now I had an idea to read the exe-file in a blob-field of a table in the database, and when the user is connected, the program check's if this is a new version, and write it to the PC.
I only hve to install it one time on the pc, then the updates are automaticly.
Is this a goed idea? Does anyone allready try this?
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Marc Venken
- Posts: 727
- Joined: Tue Jun 14, 2016 7:51 am
Re: Update FWH programs via SQL-database?
Interesting approuch...
This link seems to save exe to blob.
https://osandamalith.com/2016/06/24/sto ... ide-mysql/
http://forums.fivetechsupport.com/viewt ... =blob+data
http://forums.fivetechsupport.com/viewt ... =blob+data
Maybe it is a help.
Groetjes,
Marc
This link seems to save exe to blob.
https://osandamalith.com/2016/06/24/sto ... ide-mysql/
http://forums.fivetechsupport.com/viewt ... =blob+data
http://forums.fivetechsupport.com/viewt ... =blob+data
Maybe it is a help.
Groetjes,
Marc
Marc Venken
Using: FWH 20.08 with Harbour
Using: FWH 20.08 with Harbour
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: Update FWH programs via SQL-database?
Since 2012 I work this way.
My programs connect to my server database and check for new versions. If it does, the program downloads the package from a BLOB / BINARY field '
I use the ADS for this.
My programs connect to my server database and check for new versions. If it does, the program downloads the package from a BLOB / BINARY field '
I use the ADS for this.
Re: Update FWH programs via SQL-database?
Dear Giovany,
Thanks for any idea.
How can you download the program? Because you will know the new version, when you run the program. How do you download to override the opening program?Giovany Vecchi wrote:Since 2012 I work this way.
My programs connect to my server database and check for new versions. If it does, the program downloads the package from a BLOB / BINARY field '
I use the ADS for this.
Thanks for any idea.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
-
- Posts: 988
- Joined: Thu Nov 24, 2005 3:01 pm
- Location: Madrid, España
Re: Update FWH programs via SQL-database?
Hi Dutch,
Let's start with your outdated exe, and let's call it Current.Exe. At start, via ftp/sql or whatever you want to use, find a new version and download that file as NewVersion.exe. At this point we need to call a third program, Updater.exe that will do:
- First, check that NewVersion.exe Exists. If posible, do a checksum validation if possible.
- Rename Current.exe to something else like OldExe+CurDate()
- Rename NewVersion.exe to Current.exe
- Launch Current.exe and finish
You should add extra steps to revert the situation in case sth fails.
KR,
Let's start with your outdated exe, and let's call it Current.Exe. At start, via ftp/sql or whatever you want to use, find a new version and download that file as NewVersion.exe. At this point we need to call a third program, Updater.exe that will do:
- First, check that NewVersion.exe Exists. If posible, do a checksum validation if possible.
- Rename Current.exe to something else like OldExe+CurDate()
- Rename NewVersion.exe to Current.exe
- Launch Current.exe and finish
You should add extra steps to revert the situation in case sth fails.
KR,
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Re: Update FWH programs via SQL-database?
Dear Carlos,
It means, we must have 2 exe files (1 program/ 1 check update) to check new version.
Thanks so much,
It means, we must have 2 exe files (1 program/ 1 check update) to check new version.
Thanks so much,
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: Update FWH programs via SQL-database?
It uses the same executable, downloads a zip file, unzipped into a folder and the program itself creates a .BAT file, and closes the program after it executes the .BAT file.
.BAT
.BAT
Code: Select all
@ECHO OFF
cls
ECHO AGUARDE A ATUALIZAÇÃO DO PROGRAMA
:APAGA
CHOICE /T 1 /C y /CS /D y
ATTRIB -R -S -H CARTORIO.EXE
DEL CARTORIO.EXE
IF EXIST CARTORIO.EXE GOTO APAGA
COPY C:\SISTEMAS\PROTWIN\TEMP\UPDATE\CARTORIO.EXE
ECHO ARQUIVO DE ATUALIZACAO PROCESSADO
Re: Update FWH programs via SQL-database?
Dear Giovany,
Thank you, I got it.
Thank you, I got it.
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
-
- Posts: 988
- Joined: Thu Nov 24, 2005 3:01 pm
- Location: Madrid, España
Re: Update FWH programs via SQL-database?
Hi Giovany,
I don't delete the former exe because sth can fail and i don't want to leave the user without the app. And renaming is allowed in case the exe is being executed, but deleting is not always an option.
If possible, add some kind of binary validation to the download, like checking the md5 on the new file. Security is never enough!
KR
I don't delete the former exe because sth can fail and i don't want to leave the user without the app. And renaming is allowed in case the exe is being executed, but deleting is not always an option.
If possible, add some kind of binary validation to the download, like checking the md5 on the new file. Security is never enough!
KR
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
- Giovany Vecchi
- Posts: 129
- Joined: Mon Jun 05, 2006 9:39 pm
- Location: Brasil
Re: Update FWH programs via SQL-database?
The running program will check the downloaded files first. After unpacking, the package in addition to the main executable can contain sql script, another executable to run before the upgrade, or perform processes for database actuation when finalizing the program in exclusive mode. All this is you who have to plan to avoid problems.
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Update FWH programs via SQL-database?
Hi,
I also check for the new version in the exe-file.
Than save it with an temporary name to the PC.
Than create a bat-file that delete de original file, rename the new file and call the program again.
The bat-file is called when exiting the exe-file.
Until now I download the file from a website.
Now I wanted to save in in the SQL-database.
The only problem is that the exe-file is to large (8Mb) to save in the blob-file. Do I do some settings in the server?
I also check for the new version in the exe-file.
Than save it with an temporary name to the PC.
Than create a bat-file that delete de original file, rename the new file and call the program again.
The bat-file is called when exiting the exe-file.
Until now I download the file from a website.
Now I wanted to save in in the SQL-database.
The only problem is that the exe-file is to large (8Mb) to save in the blob-file. Do I do some settings in the server?
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: Update FWH programs via SQL-database?
Dear Marc,
I use upx to compress the EXE file. It works well for many years.
http://forums.fivetechsupport.com/viewt ... px#p213562
I use upx to compress the EXE file. It works well for many years.
http://forums.fivetechsupport.com/viewt ... px#p213562
Marc Vanzegbroeck wrote:Hi,
I also check for the new version in the exe-file.
Than save it with an temporary name to the PC.
Than create a bat-file that delete de original file, rename the new file and call the program again.
The bat-file is called when exiting the exe-file.
Until now I download the file from a website.
Now I wanted to save in in the SQL-database.
The only problem is that the exe-file is to large (8Mb) to save in the blob-file. Do I do some settings in the server?
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Update FWH programs via SQL-database?
Dutch,
I'm also using upx to compress the exe-files, but than I'm also getting the message that the file is too big.
I'm also using upx to compress the exe-files, but than I'm also getting the message that the file is too big.
dutch wrote:Dear Marc,
I use upx to compress the EXE file. It works well for many years.
http://forums.fivetechsupport.com/viewt ... px#p213562
Marc Vanzegbroeck wrote:Hi,
I also check for the new version in the exe-file.
Than save it with an temporary name to the PC.
Than create a bat-file that delete de original file, rename the new file and call the program again.
The bat-file is called when exiting the exe-file.
Until now I download the file from a website.
Now I wanted to save in in the SQL-database.
The only problem is that the exe-file is to large (8Mb) to save in the blob-file. Do I do some settings in the server?
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Re: Update FWH programs via SQL-database?
Marc,
Can you try Mediumblob columns instead of Blob?
Can you try Mediumblob columns instead of Blob?
Marc Vanzegbroeck wrote:Dutch,
I'm also using upx to compress the exe-files, but than I'm also getting the message that the file is too big.
dutch wrote:Dear Marc,
I use upx to compress the EXE file. It works well for many years.
http://forums.fivetechsupport.com/viewt ... px#p213562
Marc Vanzegbroeck wrote:Hi,
I also check for the new version in the exe-file.
Than save it with an temporary name to the PC.
Than create a bat-file that delete de original file, rename the new file and call the program again.
The bat-file is called when exiting the exe-file.
Until now I download the file from a website.
Now I wanted to save in in the SQL-database.
The only problem is that the exe-file is to large (8Mb) to save in the blob-file. Do I do some settings in the server?
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Re: Update FWH programs via SQL-database?
Hi Giovany,
How do you call BATCH file from the main program and keep it still run after the main program end?
I try ShellExecute() but it doesn't run.
How do you call BATCH file from the main program and keep it still run after the main program end?
I try ShellExecute() but it doesn't run.
Giovany Vecchi wrote:It uses the same executable, downloads a zip file, unzipped into a folder and the program itself creates a .BAT file, and closes the program after it executes the .BAT file.
.BATCode: Select all
@ECHO OFF cls ECHO AGUARDE A ATUALIZAÇÃO DO PROGRAMA :APAGA CHOICE /T 1 /C y /CS /D y ATTRIB -R -S -H CARTORIO.EXE DEL CARTORIO.EXE IF EXIST CARTORIO.EXE GOTO APAGA COPY C:\SISTEMAS\PROTWIN\TEMP\UPDATE\CARTORIO.EXE ECHO ARQUIVO DE ATUALIZACAO PROCESSADO
Regards,
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
Dutch
FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)