I wrote a batch script to execute after my installation that is made with Inno Setup. The problem is that I have the following command line for my service creation:
Sep 17, 2017 I want to silent install MySQL 5.7 from Inno Setup so i have use this link, but this for MySQL 5.5 not for 5.7. I have MySQInstallerConsole form command prompt to.
The letters with accents are the problem of this code, I can't execute it if I open the bat file in cmd, but when I type the service is created normally. How can I fix that?
juniorgarcia
juniorgarciajuniorgarcia
2 Answers
Rather than calling SC directly, it's cleaner (and easier to deal with any errors or service dependencies) to use the API. Note that this example assumes that you're using ANSI Inno, but it's fairly straightforward to modify this for Unicode.
Personally, though, I prefer to build install/start/stop/uninstall commands into the service executable itself, making it self-registering. Obviously this isn't possible to do yourself for a third-party service, but you could check to see if it already supports something like this.
One final point is that you must not hard-code the path to a C: folder. You should be using
{app}
instead.MiralMiral
You could try to add this command to
[RUN]
section (as TLama suggested) or create AfterInstall
function in [CODE]
section.RobeNRobeN
Not the answer you're looking for? Browse other questions tagged serviceinno-setup or ask your own question.
I'd like to compile a setup that will connect to a remote database using the credentials provided by the user, then install few db components using .sql script.
Is that possible using Inno Setup?
More details:
I'd like to have a custom form, asking the user to enter the database address and credentials, then run a command that will execute an sql script that will update the remote database server.
If the update is successful - complete the installation with success.
This is rather general question - I have a lot of customized setups that should connect to different servers/run different scripts - the idea is to build a generic form that will provide this functionality.
oferofer
1 Answer
I don't think you can have a completely generic form, as for different servers you may need either a single connection string, or a server name and an (optional) port; for some servers you will use system authentication, for others a user name password tuple.
Having said that I will give you a small demo Inno script that asks for server name and port, user name and password, then makes a few tests, then executes an application that is extracted (by code) to the temp directory and will be deleted by the installer. You can use this as a starting point for your scripts. Having a few of such snippets, and including them in your scripts as necessary will probably be all you need:
Beware: I haven't fully tested this, so there may be more code necessary to properly clean everything up. Error handling is definitely missing!
mghiemghie