can i install mysql along with our exe with installjammer

This forum has been archived and is no longer active.

The new forum is located at:

https://sourceforge.net/apps/phpbb/installjammer/

You may continue to view and search the topics in this forum, but no new posts can be created.

can i install mysql along with our exe with installjammer

Postby mansi5 » Mon Aug 29, 2011 3:26 am

Hi Sir,


I have created an executable of my project with the help of installjammer.
But while installing on target system i want to check whether mysql is present on the target system,if it is not there then will i be able to insatll mysql before installing my exe with installjammer.

Please tell me what settings are needed or how i can do the same.

Please reply asap.

Thanks in advance.
mansi5
 
Posts: 5
Joined: Sat Aug 27, 2011 5:59 am

Re: can i install mysql along with our exe with installjammer

Postby hsehdar » Wed Aug 31, 2011 11:35 pm

Hi,

I am also using IJ for some time and wanted to help you. Similar situations I have come across. I'm not sure how to check existence of MySQL. In case you want to silently install MySQL it is very simple. Use action Execute External Program to install.

Read manuals to achieve this.

Thank you,
With regards,
Hsehdar
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: can i install mysql along with our exe with installjammer

Postby mansi5 » Thu Sep 01, 2011 11:28 pm

Thanks a lot.....I am able to write script which will identify all the installed softwares on the target system and will install if any particular software is not there but not getting how to use that script with install jammer...if u can help me in that.

Thanks.
mansi5
 
Posts: 5
Joined: Sat Aug 27, 2011 5:59 am

Re: can i install mysql along with our exe with installjammer

Postby hsehdar » Fri Sep 02, 2011 2:14 am

There are couple of ways doing this. For example say the script is using TCL then use action Execute Script with the script returning 0 or 1. Like wise if the script is a batch or shell type then add action Execute External Program and catch the Result Virtual Text or Status Virtual Text accordingly. Based on these result install, repair or uninstall application.

If the script does all the work then execute it using actions shared above.

Hope this is useful.
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: can i install mysql along with our exe with installjammer

Postby mansi5 » Fri Sep 02, 2011 5:25 am

Thanks :)

But what I want is before installing my own application ,i want a message pane to show that mysql is not present in target system,than it ask to install that and on clicking yes on the message pane mysql should install.
I am not getting how should I do this...
I have written a .bat file which will check all installed program on target system and it will install mysql if it is not present.
But not getting how to include message pane in between which will show that mysql is not there and ask permission to install dat.

please reply as soon as possible.
Thanks :)
mansi5
 
Posts: 5
Joined: Sat Aug 27, 2011 5:59 am

Re: can i install mysql along with our exe with installjammer

Postby hsehdar » Sat Sep 03, 2011 11:33 pm

Pretty simple. In the batch file ensure some status say fail or success is printed and also before exit of the batch file ensure it returns say fail=0 and success=1.

1. Add action Execute External Program to execute this batch program. For this action set properties
Clear Progressive Widget: Yes
Console Title: <%AppName%> Setup
Execute as Root: Yes
Execute In Console: No
Include Stderr: Ye
Program Command Line: <%InstallDir%>/bin/mysqlcheck.bat
Progressive Output Widget:
Result Virtual Text: MySQLResult
Show Progressive Output: Yes
Status Virtual Text: MySQLStatus
Wait for Program to Finish Running: Yes
Watch Progressive Output: Yes
Watch Regular Expression: ^:([^ ]+) (.*):$
Watch Virtual Text Status: Bit
Working Directory: <%InstallDir%>/bin/

2. Add next action Message Box to display corresponding message. This message box type is to be YES/NO. Check condition MySQLStatus=true or 1 before displaying. Capture the virtual text result of this message box i.e., either YES or NO. Based on the previous action this action gets executed.

3. Add next action Execute External Program to install MySQL with condition to check if user pressed YES. Based on the previous action this action gets executed. This action is to be added as first action in Install Actions group such that progress bar will be displayed or some status will be displayed.

Hope this is helpful.

FYI: Later you can do this also... the batch file output printed on monitor is captured into virtual text in step 1. This result can be parsed using below TCL script.

set mysqlresult <%MySQLResult%>
if { [string match -nocase [concat \*success\*] $mysqlresult] } {
return 1
}
return 0
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: can i install mysql along with our exe with installjammer

Postby mansi5 » Mon Sep 19, 2011 2:15 am

Hey Thanks a lot....!!!!!!
Now I am doing the same for Linux system.For that I have written a Shell script...in that I have given a command to search mysql on system and under IF condition I have given if mysql is not there then install .rpm package for mysql.
But when I am running this Shell script directly on Linux system then its working fine but when I am using this into installjammer thn while installation of my package control is going to that shell script but if condition is not working fine.

Please have a look and reply as soon as possible.I am in urgent need.

Thanks a lot..:)
mansi5
 
Posts: 5
Joined: Sat Aug 27, 2011 5:59 am

Re: can i install mysql along with our exe with installjammer

Postby hsehdar » Tue Sep 20, 2011 6:42 pm

There is nothing to have a look ;) - no attachments.

Anyways, if shell script works directly then there is nothing like it does not work in IJ. It will have to work.
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: can i install mysql along with our exe with installjammer

Postby mansi5 » Thu Sep 22, 2011 3:20 am

this is my script as follows :


#!/bin/sh
count=`rpm -qa |grep qt-MySQL-3.3.3-13.RHEL4`
echo $count
if [ "$count" == "" ]
then
echo "inside if not exists"
rpm -i MySQL-debuginfo-5.1.57-1.glibc23.i386.rpm
else
echo "exists"
fi
mansi5
 
Posts: 5
Joined: Sat Aug 27, 2011 5:59 am

Re: can i install mysql along with our exe with installjammer

Postby hsehdar » Thu Sep 22, 2011 7:16 pm

Thanks for sharing the shell script. I learnt something new... RPM package command. I work on DEB and this is new. Below is the modified script.

Code: Select all
#!/bin/sh
count=`rpm -qa |grep qt-MySQL-3.3.3-13.RHEL4`
echo $count
if [ "$count" == "" ]
then
rpm -i MySQL-debuginfo-5.1.57-1.glibc23.i386.rpm
echo "MySQL_installed_now"
else
echo "MySQL_already_installed"
fi


You can see that the echo is modified in two places. When executed, in the monitor the echo will be displayed. As said in this earlier post, the script output will be watched and capture by the installer. The captured text will be stored in Result Virtual Text: MySQLResult. Next action to be done is parse this output. So below script will do it. Add an action in IJ with the below script and store its result in another virtual text say MySQLResultStatus.

Code: Select all
set mysqlresult <%MySQLResult%>
if { [string match -nocase [concat \*MySQL_installed_now\*] $mysqlresult] } {
return 1
}
return 0


Use the virtual text MySQLResultStatus to find if MySQL was installed earlier or was it installed by installer now.

FYI: Another way of doing the same is... in your shell script instead of echo use exit 0 or exit 1 then it will be available in Status Virtual Text: MySQLStatus. For next action you can check MySQLStatus condition. This will avoid another action of TCL script.
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron