How can i check the mysql server is installed or not before installing the application in Inno setup compiler - inno-setup

I need inno setup compiler script to check whether mysql server is installed or not before installing the application.

MySQL is quit differ than other ones, we can also use MySQL with out installing into our system by running required services time to time from the downloaded zip archives, extracted files may be placed any where on the system...Tlama Already mentioned this.
Here we have two cases to Check
Case 1:-MySQL is installed or not
Direxists function(Here you can Check whether MySQL directory exists in program files or not )
MySQL directory path :{pf}\MySQL
Filexists function(with this you can check required MySQL files are there in the users systems )
Query the registry with the MySQL registry Key names
HKEY_USERS\S-1-5-21-1707045092-1792370289-147592793-1000\Software\MySQL
HKEY_USERS\S-1-5-21-1707045092-1792370289-147592793-1000\Software\MySQL AB
HKEY_CURRENT_USER\Software\MySQL
HKEY_CURRENT_USER\Software\MySQL AB
check whether these are existed in registry or not.
if Every thing is existed, that's fine. Go for your application installation
if no check for case 2 also
Case 2:- Is there any files or directories with the name of MySQL in the entire system and required services of Mysql are running or not
a. first check whether is there any file or folder exists with the name of MySQL in the users machine by using below commands, to execute commands you can use Exec function
with the below one you can find whether MySQL(file/directory) is there in c drive or not, but not in entire system
C:\>tree |find "mysql" >filename
b)now change the drive to D,E,F by using
below command will give you , all disk drives in the machine
C:\>wmic logicaldisk get caption >filename
then check each and every drive in the above filename
C:\>D:
d:\>tree |find "mysql" >filename
each time Loadstringfromfile to some string and then check the length of string is zero or not.
if not zero, you need to check for required services are running or not by using (you can skip some above steps for simplicity)
tasklist |find "required service of MySQL" >filename
if all drives finished and if did not found any thing, no worries simply prompt user to download MySQL (Use ITD(Innoo tools downloader)) or else you can pack MySQL msi with your application but your application become bulky(Contains more memory).

Related

Writing a file to an Ubuntu 18.04 directory using postgres query tool

I have a Python program calling postgres queries then showing the results on the screen. So far Python and postgres both run on Windows. Now I want to move the database to Ubuntu.
I therefore want to write a file from postgres query tool to an Ubuntu 18.04 directory. Under Windows (old setting), writing the file from postgres query tool works without complications. Using the new postgres database on Ubuntu, I have added postgres to my personal (=mm) user group and changed the permissions of the corresponding folder (755). Even added a file temp.csv and changed the permissions of that file as well (755). Still, when trying...
create table temp (test text);
insert into temp(test) VALUES ('Sample text');
copy (select * from temp) to '/home/mm/temp.csv';
... I get ...
ERROR: could not open file "/home/mm/temp.csv" for writing: Keine Berechtigung [=No permission]
SQL Status:42501
Hinweis:COPY TO instructs the PostgreSQL server process to write a file. You may want a client-side facility such as psql's \copy.
I could write to a samba directory with "free for all" permissions, but I don't want to do that for data security reasons.
Does anyone have an idea?

Installshield 2013 Installscript MSI: Wrong .msi location during Repair

I've got a pretty simple installscript MSI project - it copies some files into a folder, updates a few registry keys and that's pretty much it.
When I try to use the Repair function (either by re-launching the installer, or by choosing the app's Modify option under Apps & Features), I get the following message, when it gets to the "Copying new files" stage:
"The feature you are trying to use is on a network resource that is unavailable.
Click OK to try again, or enter an alternate path to a folder containing the installation package 'project.msi' in the box below."
The path in which it looks for the .msi file is %TEMP%\[SOME_RANDOM_HEXADECIMAL_STRING]
This random hexadecimal string doesn't seem to be specifically related to the project. It's neither the Product Code nor the Upgrade Code nor the Package Code.
When I look for it in the registry, I find it in the values of the following keys:
Computer\HKEY_CLASSES_ROOT\Installer\Products\[SCRAMBLED_PRODUCT_CODE]\SourceList\LastUsedSource
Computer\HKEY_CLASSES_ROOT\Installer\Products\[SCRAMBLED_PRODUCT_CODE]\SourceList\Net\3
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\[ANOTHER_SCRAMBLED_PRODUCT_CODE]\SourceList\LastUsedSource
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\[ANOTHER_SCRAMBLED_PRODUCT_CODE]\SourceList\Net\3
Looking at the %TEMP% folder, I can find the .msi file in a folder that has another random hexadecimal string as its name. That folder does not appear in the registry at all.
I don't want my clients to go looking for .msi files every time they want to repair an installation of my product. How can I let the installer know the .msi file's location?
The source files you installed from are probably just missing since your temp folder has been cleaned out (where the install originally ran from).
There used to be a cache the whole MSI - feature you could enable on a release-configuration basis (Cache MSI Locally). This would "solve" this problem I believe by caching the whole MSI in a safe location (see section 3). Many do this, despite the increased disk space used.
Another option is to install from an administrative installation (essentially an extract of your setup's files - run via setup.exe /a or msiexec.exe /a MySetup.msi - which has been put available on a network share, always available for repair or modify operations). This is what corporate deployment uses to support repair and modify operations.

Moving neo4j database from Windows to Ubuntu

I created neo4j database using cypher queries through browser and some python (py2neo) routines.
Now, I have to transfer this database to another neo4j instance on my Linux desktop.
What I did-
Zip the contents of folder default.graphdb.
Unzipped the contents of the zip file to data/graph.db in my linux installation.
Also the user:pass of the database are same.
But when I goto the browser, I can't find any of that data. The directory does point to the folder that I extracted to (/home/goelakash/neo4j-community-2.3.0/data/graph.db).
How do I get that database?
EDIT - messages.log
https://drive.google.com/file/d/0B3JPglmAz1b5ak1vRWR5Z0p5UVE/view?usp=sharing
The data files should be located directly in data/graph.db. So check e.g. if there is a file called neostore.nodestore.db. If so, check the permissions - the system user running Neo4j needs to have full recursive read/write permission on the graph.db folder.
Also make sure that you're using the same version of Neo4j on Windows and Linux (or upgrade the store following the reference manual).
For more insight attach the startup sequence form data/graph.db/messages.log.

How to prevent an exe file from running if it is not installed with a setup file?

How to prevent an executable from executing, if it is not installed using a proper setup file? (i.e) if it is just copied from another system? I created the executable and its corresponding setup, so what should I do from my end to prevent my software getting copied from one system to another simply?
You could test if a certain registry key exists.
You can test the OS Version. (Client yes, Server no)
You generate a Hardware specific id and compare this online with a database before (first / every) run.

How do I get Sybase File Path, Transaction Log, & installation details?

I need to Retirve the following Details using Sybase SQL Query.
1) Database Data File Path
2) Database Transaction Log File Path
3) Path where SybaseSoftware Installed
4) Patch Installed on Sybase
Thanks.
That info is easy for a DBA to obtain in 30 seconds; with a GUI Admin tool in a few clicks.
Why do you want to obtain the details of the server installation VIA SQL ? If you are a coder you do not need that info to do your job; that info is the domain of the DBA, and changes as they administer the server. More important, the changes are transparent to the coder. Even if you did know it, it will not help or hinder you in your work.
Online Sybase Manuals
The "data and log file paths" in particular, are protected from direct access by developers (it is a secured ANSI SQL RDBMS).
Update
Evidently you did not bother to look up the manuals.
Open a session with the server, so that you can execute SQL commnands via "Sybase SQL Query". From your PC, Run either isql (character) or DBISQL (GUI); they are both on the Sybase PC Installation CD, you can also download them free.
Devices ("Data File Paths"):
sp_helpdevice
go
There are many Databases per server. There are many Devices per server. You will have to figure out (a) which Devices contain the Database you are interested in (b) Data Devices vs Log Devices.
sp_helpdb
go
Log Devices ("Database Transaction Log File Path")
(same as (1) )
"Sybase Installation" or $HOME directory (on the server). There are two methods, the first is much easier:
via host system
.
Log into the host system of the server, as the sybase user
You are already located in the sybase $HOME directory
It is the installation directory
(the original installer may have created directory trees for each version or EBF ("patch level"), but that is easy to figure out using Unix/DOS commands)
.
via islq/DBISQL
.
sp_configure "configuration file"
go
.
This will give you the path to the configuration file. It is almost always, the file path to the $SYBASE or sybase>$HOME directory. You can move up or sideways in the directory tree, using Unix/DOS commands, and figure it out from there.
.
The version of the Sybase ASE is the only item from your list that is relevant to coders. It (including current EBF ("patch level") is obtained via:
SELECT ##VERSION
go

Resources