Do you have additional examples of executing MySql with Wix? - mysql

I'm still working on my Wix installer that includes replacing some MySql commands.
Specifically, I want the installer to run a script that creates a user, and then using that user, I want the installer to run a script that creates a database and creates tables. (It seems that an installer should be able to do this.)
I posted earlier about the user, and haven't been able to figure that out yet.
So skipping that for a moment, let's assume that my user exists. This user happens to not have a password. Without the installer, the command I usually do to run my script that creates the database and tables is:
mysql --user=myname < thisismyscript.sql
This works fine - so I know my script works.
Two problems I see in the Wix, and I'm hoping someone can either explain, or post additional examples (I learn best by seeing others examples).
1) seems to be the lack of a password.
In the .wxs file, I have:
<util:User Id='SQLUser' Name='[SQLUSER]' />
<Component Id='SqlComponent' Guid='7B524167-D8CF-465E-AEE8-6B70CF712A3A' KeyPath='yes'>
<sql:SqlDatabase Id='SqlDatabase' Database='adatabase' User='SQLUser' Server='[SQLSERVER]'
CreateOnInstall='yes' DropOnUninstall='yes' ContinueOnError='yes'>
<sql:SqlScript Id='mynewdb' BinaryKey='mynewdb' ExecuteOnInstall='yes' />
</sql:SqlDatabase>
</Component>
<Binary Id='mynewdb' SourceFile='thisismyscript.sql' />
<Property Id='SQLUSER'>myname</Property>
<Property Id='SQLSERVER'>localhost</Property>
(this is all embeded in the right places in the .wxs file and the file compiles fine... it's just when I run the .msi, my database has not been created.)
The only way I was able to leave the password property blank was to add that Admin tag. I'm not sure what to do here.
The second problem is that within the SQLComponent, I had to write down a database name, but of course, this database doesn't actually exist yet. Is this a problem? (I also tried creating the database manually, so that when the .msi ran it would already be there... but then nothing else happened)
I also ran msiexec with logging, and it appears that my sql script executes... there are no errors that I can see in the log.
Help? This really seems like something an installer should be able to do... and that I'm just doing something wrong...
Thanks in advance!
-Adeena

Neither WiX nor MSI has native support for MySQL. InstallShield has MySQL support.

Related

Error executing SQL script; The process cannot access the file because it is being used by another process:'C:\\Users\\......\....cnf'

I am trying to run a script to import data into MySQL. When I tried, this error shown up. I have searched for a workaround but none is helping. I deleted all the related .cnf file in the said path after a few attempts on trying to run the script but it kept on creating a new one. I have no other means of importing the data besides running that script. Terribly sorry if I somehow really ask a silly question about this but I am new with SQL, stuck and need help on the matter. Thanks in advance.
i have the same error as you, I've manage to solve it on my end by following these steps:
Rather than doing "run sql script", do "open sql script"
After the script open, Execute all (the lightning btn beside the save icon)
Hope this will work for you too!
I ran into this problem as well and, like #Alexandre-St-Amant, the size of my script prohibited opening the script as #vika suggests.
Before noticing #Kwaadpepper's suggestion, I tried using connecting to my database through mysqlsh.exe, then used SOURCE <data_file>. This has the added benefit of allowing linked scripts using SOURCE, solving #Adrian-Moldovan's issue.
Of course, this does not use mysql-workbench to solve the problem.
I had same problem with my sql script.
You may try reinstall the client and workbench. You should follow one version of applications. After that actions my script has worked.
My sql file was really big and I was not able to copy the contents or load the file. Instead, do this :
Server' -> 'Data Import
Dump the data from sql file from here. This worked for me.

Msbuild running in Jenkins target calling HgPull fails with HgProcessException: The command <hg.exe> is not available

I am porting over an MSBuild script from CCnet to run in Jenkins. The MSBuild project is used to create a deployment package. I would rather have Jenkins drive this process itself but that's a longer term aim.
The problem i am having is (as in the title) when we try and use the HgPull target, from the MSBuild mecurial task (http://msbuildhg.codeplex.com/) we get the error message
HgProcessException: The command hg.exe is not available [Path to project]
I have seen on the project web site that someone solved it by adding the LibraryLocation proeprty to the target but that seems to have made no difference. My target currently looks like this:
Target Name="UpdateSources">
<HgPull
LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
Force="true"
Update="true"
LocalPath="$(SourcePath)"
/>
<HgUpdate
LibraryLocation="C:\Program Files\TortoiseHg\hg.exe"
Clean="true"
LocalPath="$(SourcePath)"
/>
I'm rather at a loss. Please let me know if you need any more information added to this post to solve this issue. I'm really quite new to MSBuild so really not sure where to start investigating this.
EDIT:
One thing i forgot to mention was that i have tried running the MSbuild command in a console window on the build server and still get the same result. This is really odd given it works fine in CCNet, what magic is CCNet doing to make this command work?
This is now resolved, unfortunately i'm not sure what changes i made to correct these. I believe it may have been down to path separators and whether they where trailing or not in another part of the config file. It does so annoy me with the lack of resilience/consistency between applications where you need to specify paths with/without trailing slashes.
Just a thought, but try adding 'C:\Program Files\TortoiseHg' to your system path. Maybe CCNet has it specified somewhere that Jenkins doesn't have access to.
Also, just for sanity's sake, verify that hg.exe actually exists at that location.

SignTool error while packaging Windows Store app

During packaging the Windows Store application, I get an unspecified error [APPX1204]:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(1139,9): error APPX1204: Failed to sign 'D:\Projects\VS2012\Stroik\Stroik\AppPackages\Stroik_1.0.0.11_AnyCPU_Test\Stroik_1.0.0.11_AnyCPU.appx'. SignTool Error: An unexpected internal error has occurred.
Build output refers to the part of a file generated by VS2012:
<SignAppxPackage AppxPackageToSign="#(FinalAppxPackageItem)"
CertificateThumbprint="$(PackageCertificateThumbprint)"
CertificateFile="$(PackageCertificateKeyFile)"
HashUri="$(_HashUri)"
EnableSigningChecks="$(EnableSigningChecks)"
>
<Output TaskParameter="ResolvedThumbprint" PropertyName="ResolvedThumbPrint"/>
<Output TaskParameter="AppxPackagePublicKeyFile" PropertyName="AppxPackagePublicKeyFile" />
</SignAppxPackage>
Yesterday packaging proceeded successfully. Today I added aditional logic to my app and changed some data in manifest. Since then I'm reciving presented error. I tried to regenerate Certificate in Packaging menu, delete Store/Temporary Keys (then regenerate), ... much more but nothing helps.
Now I have no idea how to handle it. Furthermore packaging a new project (as it is provided by vs2012) results in the same error.
Have you got any suggestions how to solve it.
If it helps anyone else, I was trying to make the build on a network share (virtualizing windows). Creating it on the Windows partition solved the issue.
I was developing on a Virtual Machine in VirtualBox and tryed to publish to the shared folder.
Change the output folder to a local folder on the virtual maschine solved it.
Granted this is older - see if you can try it with a different live id
You could also try to generate a new app, and diff the manifests between the apps.
Now according to:
http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/f25939fb-c48c-4bd0-938e-6a0afbd2dca0/
you may want to sign out, use IE 'in safe private browsing' and create a new one.
Also ensure that IE is set in "Browsing History->Settings" to get a new version of the page every time.
Login with the new one and give it a try.
I'm not sure if this error is related here or not, but it's a starting point based on the prior feedback on the above post.
This japanese site lists the same error code and seems to have the same resolution as well
http://coelacanth.heteml.jp/blog/windows-8signtool-error-an-unexpected-internal-error-has-occurred/
Its worth a shot, but I'll admit on this one not being 100% sure, just trying to help out : )

Not able to make calls to mod_roster_odbc functions

I tried to use my own custom roster by integrating mod_roster_odbc. I changed the config file too (commented out mod_roster and make a new entry for mod_roster_odbc). After running with this setup, mod_roster_odbc module is getting started ( I put some logs to in start function, those I can see). But none of other function is not getting called as I alter presence or logged out/logged in.
Please help to identify where I am making the mistake.
I think I know the answer to this. many websites tell you to use mod_roster_odbc.erl to create your own rostering. I believe thats your problem. Many of the functions are merged into mod_roster.erl file itself. I dont think this is mentioned anywhere.
So what you need to do is in ejabberd.cfg enable mod_roster_odbc but dont remove the mod_roster.erl file with the odbc file. This file will take care.
Finally you need to create a rosterusers table (or something like it) so that ejabber can query for friend list. After these changes, just restart ejabber server and you should be good to go. hope this helps.

RailsTutorial - Testing - What to put for Database.YML for MySQL?

First, thanks for your help.
As a noob, I've been happily chugging along this well-known tutorial:
http://ruby.railstutorial.org/chapters/static-pages#top
and I'm caught in a section where I enter
rspec spec/
where I receive 2 errors. The 2 errors are in the format of
PagesController GET 'home' should be
successful
Failure/Error: Unable to find matching line from backtrace
Mysql2::Error:Unknown database 'xyz.rb'
where "home" is the name of the action/page. The xyz.rb is the arbitrary
database name I have listed under the test section in database.yml. I
have already raked the database.
I'm pretty sure my problem has to do with how I'm not going with the
sqlite3 in the tutorial but instead with mysql2. The resources I have
managed to find only give guidance on what to input for the development
section in database.yml, but not for the rest of the sections like
"test". So, my question is, what exactly does this error mean, how to
fix it, and how should I configure my database.yml file? I tried
entering a file I see in my db folder like schema.rb, but this renders
the same error.
Thank you very much for your help.
You have two options:
Set up another sqlite database, as is default with a new rails application, or
Create another MySQL database, the same way you set up your development database, with a different name (such as test) and use that for testing.
Here's my database.yml file from the Rails Tutorial that uses SQLite for all the databases; you should be able to copy the test section if you decide to go with #1 above.