Before knowing about Inno Setup used IzPack to do my installer, due to the need to verify if the port of the service that was about to create was in use, towards a query to the database with the driver jdbc, so if the connection was valid then send a error message to change the port.
So this is the way I did before, but I do not know how to do it in Inno Setup:
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn =
DriverManager.getConnection(
"jdbc:mysql://" + server + ":" + port + "/database", "root", password);
if (conn.isValid(0)) {
error = "A server-type installation already exists in: " + server;
return Status.ERROR;
}
} catch (ClassNotFoundException ex) {
Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
}
Thank you very much.