Quantcast
Channel: Flexera Community Forums
Viewing all 4553 articles
Browse latest View live

IDE Severe Regression for IS-2016

$
0
0
Is it just me, or did the IS2016 IDE go into severe regression with the keyboard shortcuts to the clipboard working in the IDE.

I filed a case - 01261269

Go to Installscript editor and select text and go CTRL-C and the paste the text elsewhere in the file. No joy. You can select text, right-click and select copy. Then right-click and select Paste.

Seems like a pretty serious regression, even though there is a workaround.

Device Driver DOES NOT be removed in Windows10 RS2

$
0
0
Hello,
I use Installshileld to make exe to install some device driver.

Since Windows 10 RS2 version, when uninstalling it through Setting-Apps-App&Features, the device driver actually DOES NOT be removed in Device manager.

Is there anyone experienced the same behavior? And do you have any idea to resolve this?

How Do You Deactivate A License That Resided on a Dead Machine?

$
0
0
I have a license for Installshield 2015 and had it licensed on a machine that died on me. I need to reactivate the license on the machine that has now replaced it. I'm not seeing anywhere on the Flexera site to do this online, so how does one deactivate a license when the machine it was licensed to no longer exists?

Thanks,
Eric

check for .NET 3.5 OR 4.0

$
0
0
Hi guys,

after searching for hous I'm wondering if I'm the only who has this issue:

is it possible to have 2 prerequisite (or conditions?) combined by OR ?

I'd like to execute the install process only when .NET 3.5 OR 4.x (or both) are installed on the target system, this means:

3.5 ONLY- OK, continue setup
4.x ONLY - OK, continue setup
3.5 AND 4.x (Both)- OK, continue setup
NO 3.5 and NO 4.x - NOT OK, launch .NET 4 installer (or just warn user... but don't conitnue setup until any .of these 2 NET versions is installed )

Thanks!

Cannot register a DLL after Installing into GAC?

$
0
0
Hi,
i am trying to Install a DLL from IS2015 and I have a .Net Dll which i need to put it into GAC and register the DLL, But i am able to put it into GAC (%WINDIR%\Microsoft.NET\assembly\GAC_MSI)folder but i cannot register the DLL from the location.
I have read and tried from the forums but could not achieve this.

What i have Tried:
1. Creted a GlobalAssemblycache folder in IS2015 and tried install/register from the %windir%\Microsoft.NET\assembly\GAC_MSIL
2. created a custom action and tried to execute "Installutil -i mydll.dll"
3. created a supporting batch file and added as new component and tried to execute batch file from command prompt. i added a custom action to run the batch file.
4. Also tried to do with Self-register check in properties of the DLL.
5. Set COM extract to build to TRUE

Can anyone please let me know if i am missing anything to register the DLL in GAC folder after putting DLL to GAC folder?
Thank you for the help!!

.NET 4.6.1 or 4.6.2 Web Prerequisite

$
0
0
Does anyone have a Prerequisite file for .NET framework 4.6.2 or 4.6.1, web install?

How to install device drivers with installshield 2015 LE

$
0
0
I can't find any information about how to install an FTDI device driver using InstallShield 2015 LE (express?). The user manual doesn't have any useful info. Can someone give me a link to an example, please.

appcomptranutil cannot return license (fulfillment) on vmare

$
0
0
Now we testing online activation on client system.

we have problem on license return process on vmware and we tested it with appcomptranutil.exe

we can get license from FNO server using our software and appcomptranutil.exe

now we test license return process and we got different result on physical machine and vmware machine

on phycial machine we can return license to FNO server with no problem

on vmware machine we cannot return license to FNO server and we cannot solve it now.

verbose log show like this
Code:

<ResponseActions>
            <ResponseReturnDeny>
                <TrustedId>12</TrustedId>
                <FulfillmentRecord>
                    <FulfillmentRecordHeader>
                        <VersionNumber>1</VersionNumber>
                    </FulfillmentRecordHeader>
                    <FulfillmentRecordData>
                        <FulfillmentId>FID_25cf4771_150fb01b5f6__7f81</FulfillmentId>
                        <FulfillmentDictionary/>
                    </FulfillmentRecordData>
                </FulfillmentRecord>
                <Reason>6023; Input parameter hostId of TrustedHostEntityBO.createTrustedHostEntityBO cannot be null [Incident# 1931-3198R]</Reason>
            </ResponseReturnDeny>
        </ResponseActions>
    </ResponseData><SignatureData><TrustedSection><TrustedId>12</TrustedId><Signature>07873FB6797F0C8AFA24E35BB2D79EB7AB46096EFB4750096CC6A9665E48087C2ECBFF610A62F7CF503B47183E93441EF0CEB79B127BAB03EA591FA3</Signature></TrustedSection></SignatureData><SignatureVersion>3</SignatureVersion></Response>

appcomptranutil can get license from FNO, and cannot return license only vmware.

Need some help plz.

Change all Components to 64-Bit

$
0
0
Hi

I've created a new MSI with the InstallShield 2013 and now there are a lot of components I should change to 64-Bit. Is it possible to change them all at once?
The components were automatically created and they're all set to "64-Bit Component: No".

Thanks and regards
Marco

Test for 64-bit OS before prerequisites install [InstallScript]

$
0
0
I am writing an InstallScript build, and trying to utilize the built-in prerequisites feature. The problem as you all know is that the prerequisites install themselves before any custom code can be run (even before OnBegin - I just think this is horrible... but here we are.) I would like to check that I am on a 64-bit OS before my prereqs install. This is because my build is 64-bit only. But not all my prereqs are 64-bit only, so what happens is that some of the prereqs install, then we get to the main code and I tell them "sorry - 64 bit only" so it ends up wasting time and installing things they don't need/cannot use.

I cannot (more accurately do not want to) put conditions on the prereqs themselves because things like .NET 4.5.1 prereq are meant to install to either 32- or 64-bit Windows.

I am left with the idea of creating my own prereq, that runs before all the others, to check for 64-bit OS, and then fail the installation if this check fails.

Has anyone done this? If so, how did you do it? I suppose I could create a custom executable in C# that checks this and returns a return code. However it just seems there ought to be an easier way, perhaps using built-in features of the prereq editor?

I might just go back to not using the prereq editor and running these installs myself. Seems more straightforward.

Thanks.
Dave.

check for .NET 3.5 OR 4.0

$
0
0
Hi guys,

after searching for hous I'm wondering if I'm the only who has this issue:

is it possible to have 2 prerequisite (or conditions?) combined by OR ?

I'd like to execute the install process only when .NET 3.5 OR 4.x (or both) are installed on the target system, this means:

3.5 ONLY- OK, continue setup
4.x ONLY - OK, continue setup
3.5 AND 4.x (Both)- OK, continue setup
NO 3.5 and NO 4.x - NOT OK, launch .NET 4 installer (or just warn user... but don't conitnue setup until any .of these 2 NET versions is installed )

Thanks!

Custom code panel UI not visible while installing on Mac OS

$
0
0
Hi,

Install-anywhere panel: custom code working fine with Window and Linux UI but unfortunately, installing on Mac OS, the content of custom code panel not visible.

I am using installanywhere version 2017.

Please see the attached code:
package com.installer.panels;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.InputStream;

import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToggleButton;

import org.apache.commons.io.IOUtils;

import com.installer.utils.InstallerUtils;
import com.zerog.ia.api.pub.CustomCodePanel;
import com.zerog.ia.api.pub.CustomCodePanelProxy;
import com.zerog.ia.api.pub.CustomError;


public class InstallSetSelectionPanel extends CustomCodePanel {
private JToggleButton customButton;
JToggleButton expressButton;
private JLabel customFrstLabel, customScndLabel, expressFrstLabel,
expressScndLabel;
private JPanel upperPanel, lowerPanel;
private String chosenInstallSet;
private Color backgroundColor;
private boolean isSetup = false;
private Icon expressIcon, customIcon;

public static void main(String args[]) {
JFrame frame = new JFrame("");
frame.setSize(500, 500);
frame.setResizable(false);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
InstallSetSelectionPanel obj = new InstallSetSelectionPanel();
obj.upperPanel = new JPanel();
obj.lowerPanel = new JPanel();
obj.initializeGUI();
frame.add(obj.upperPanel, BorderLayout.NORTH);
frame.add(obj.lowerPanel, BorderLayout.CENTER);
// frame.add(BorderLayout.CENTER, lowerPanel);
frame.setVisible(true);
}

private void initializeGUI() {
InputStream in = null;
try {
upperPanel = new JPanel();
upperPanel.setLayout(new GridBagLayout());
in = InstallSetSelectionPanel.class
.getResourceAsStream("/expressIcon.png");
expressIcon = new ImageIcon(IOUtils.toByteArray(in));
GridBagConstraints gBC = new GridBagConstraints();
gBC.fill = GridBagConstraints.HORIZONTAL;
ButtonGroup buttonGroup = new ButtonGroup();
expressButton = new JToggleButton("");
expressButton.setActionCommand("Express");
gBC.gridx = 0;
gBC.gridy = 0;
expressButton.setIcon(expressIcon);
expressButton.setPreferredSize(new Dimension(40, 40));
expressButton.setBorderPainted(true);
buttonGroup.add(expressButton);
expressButton.setSelected(true);
InstallSetSelectionListener listener = new InstallSetSelectionListener();
expressButton.addActionListener(listener);
upperPanel.add(expressButton, gBC);
expressFrstLabel = new JLabel(
" Express (Recommended only to evaluate the product)");
expressFrstLabel.setFont(new Font("", Font.BOLD, 13));
gBC.gridx = 2;
gBC.gridy = 0;
gBC.insets = new Insets(0, 0, 0, 32);
upperPanel.add(expressFrstLabel, gBC);
expressScndLabel = new JLabel(
"<html><font size =3 face=\"Dialog\">&emsp;&emsp;Uses default configuration for installation</font><br><font size =3 face=\"Dialog\">&emsp;&emsp;"
+ "<b>&bull;</b> Uses embedded database for Log</font><br><font size =3 face=\"Dialog\">&emsp;&emsp;<b>&bull;</b> "
+ "Uses Host: localhost,HTTP port: 8080, HTTPS port: 8443</font></html>");
gBC.gridx = 2;
gBC.gridy = 1;
upperPanel.add(expressScndLabel, gBC);
lowerPanel = new JPanel();
lowerPanel.setLayout(new GridBagLayout());
GridBagConstraints gBCLower = new GridBagConstraints();
gBCLower.fill = GridBagConstraints.HORIZONTAL;
in = InstallSetSelectionPanel.class
.getResourceAsStream("/customIcon.png");
customIcon = new ImageIcon(IOUtils.toByteArray(in));
customButton = new JToggleButton("");
customButton.setActionCommand("Custom");

gBCLower.gridx = 0;
gBCLower.gridy = 0;
customButton.setIcon(customIcon);
customButton.setPreferredSize(new Dimension(40, 40));
customButton.setBorderPainted(true);
buttonGroup.add(customButton);
customButton.addActionListener(listener);
gBCLower.insets = new Insets(0, 15, 0, 0);
lowerPanel.add(customButton, gBCLower);
customFrstLabel = new JLabel(
" Custom (Recommended for Development, QA and Production)");
customFrstLabel.setFont(new Font("", Font.BOLD, 13));
gBCLower.gridx = 2;
gBCLower.gridy = 0;
gBCLower.insets = new Insets(0, 0, 0, 0);
lowerPanel.add(customFrstLabel, gBCLower);
customScndLabel = new JLabel(
"<html><font size =3 face=\"Dialog\">&emsp;&emsp;Allows user defined configuration for "
+ "installation</font><br><font size =3 face=\"Dialog\">&emsp;&emsp;<b>&bull;</b> Configuration for Log "
+ "Database</font><br><font size =3 face=\"Dialog\">&emsp;&emsp;<b>&bull;</b> Configuration of host and port "
+ "for web interface</font><br><font size =3 face=\"Dialog\">&emsp;&emsp;<b>&bull;</b> Configuration to install"
+ " as Windows Service</font></html>");
gBCLower.gridx = 2;
gBCLower.gridy = 1;
lowerPanel.add(customScndLabel, gBCLower);
//set color of label according to the selection of install set
if (chosenInstallSet == null) {
expressFrstLabel.setForeground(Color.BLUE);
} else {
if (chosenInstallSet.equals("Express")) {
expressFrstLabel.setForeground(Color.BLUE);
} else {
customFrstLabel.setForeground(Color.BLUE);
}
}
backgroundColor = InstallerUtils.getCurrentUISpecificColor();
final JScrollPane expressScrollpane = new JScrollPane(upperPanel);
expressScrollpane.setBorder(BorderFactory.createEmptyBorder());
add(expressScrollpane, BorderLayout.NORTH);
final JScrollPane customScrollpane = new JScrollPane(lowerPanel);
customScrollpane.setBorder(BorderFactory.createEmptyBorder());
add(customScrollpane, BorderLayout.CENTER);
if (System.getProperty("os.name").startsWith("Windows")) {
upperPanel.setBackground(Color.WHITE);
lowerPanel.setBackground(Color.WHITE);
} else {
upperPanel.setBackground(backgroundColor);
lowerPanel.setBackground(backgroundColor);
}
} catch (Exception e) {

}
}

@Override
public boolean setupUI(CustomCodePanelProxy arg0) {
try {
if (isSetup) {
removeAll();
}
initializeGUI();
isSetup = true;
} catch (Exception e) {
CustomError error = (CustomError) customCodePanelProxy
.getService(CustomError.class);
error.appendError(InstallerUtils.getNotNullErrorMessage(e),
CustomError.ERROR);
error.log();
return false;
}
return true;
}

public boolean okToContinue() {
//set the value of variable to the chosen install set
customCodePanelProxy.setVariable("$CHOSEN_INSTALL_SET$",
chosenInstallSet);
return true;
}

public void panelIsDisplayed() {
}

public String getTitle() {
return "Choose Install Set";
}


private class InstallSetSelectionListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
String actionCommand = e.getActionCommand();
if (actionCommand.equalsIgnoreCase("Express")) {
//change the color of selected button text to blue
expressFrstLabel.setForeground(Color.BLUE);
customFrstLabel.setForeground(Color.BLACK);
expressButton.setPressedIcon(expressIcon);
} else if (actionCommand.equalsIgnoreCase("Custom")) {
customFrstLabel.setForeground(Color.BLUE);
expressFrstLabel.setForeground(Color.BLACK);
customButton.setPressedIcon(customIcon);
}
// repaint();
//set install set
chosenInstallSet = actionCommand;
}
}

}





Any guess of it.

Thanks,
Prashant Rathi

ADO Still best method to run SQL Scripts?

$
0
0
We are currently working to re-write our clunky database package for our software, its been a long time coming. Needless to say, we get 10-15 scripts from development that need to be run (these scripts get modified all the time so just plopping them in the SQL Scripts section wont cut it for automation purposes.

I am wondering, is ADO Still the best course of action? The current process we do is this:

Creating the Connection
Code:

//===========================================================================
// CheckSQL
//===========================================================================

function CheckSQL()

        BOOL        bLoggedIn;
        LONG    nAdCmdText, nFileValue, nRows;
        NUMBER        nResult, nServiceState, nSize, nType, nStringLocation1, nStringLocation2, nCompareFlag, nvRows;
        STRING        sCSDVersion, sDatabaseName, sDataFile, sDriver, sIntSecurity, sLogFile, sMsg, sQuery, sProductVersion, sResult, sReturnString, sSQLEdition, sSubStr;
        STRING  svSQLVer, svSQLEd, svSQLBuild, szSQLVersion, szSQLQueryVersion, svRequiredVersion;

begin

        LogCreateNode(sInstallLog, "OnFirstUIBefore", "CheckSQL", BEFORE);

        // Set ADO objects to be used in this function
        try
                set oCn  = CreateObject("ADODB.Connection");
                set oFld = CreateObject("ADODB.Field");
                set oRs  = CreateObject("ADODB.Recordset");
            set oErr = CreateObject("ADODB.Error");
            set oCmd = CreateObject ("ADODB.Command");
            LogCreateKey(sInstallLog, "CheckSQL", "Message", "ADO objects set properly", BEFORE);
        catch
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not create remote ADODB connection object. Please ensure that MDAC is installed", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not create remote ADODB connection object. Please ensure that MDAC is installed", BEFORE);
                MODE = NORMALMODE;
                MessageBox("Could not create remote ADODB connection object. Please ensure that MDAC is installed. Setup will abort.",SEVERE);
                abort;
        endcatch;
       
        Dlg_SQLServerSelectLogin:
                bSysAdmin = FALSE;
                bSQL2008  = FALSE;

        try
                sDatabaseName = "Master";
                oCn.Provider = "sqloledb";
                oCn.Properties("Connect Timeout").Value = 10; 
                oCn.CommandTimeout = 0;                       
                oCn.ConnectionTimeout = 10;                   
                LogCreateKey(sInstallLog, "CheckSQL", "oCn", "Properties: "+oCn, BEFORE);
        catch
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not set ADO connection properties", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not set ADO connection properties", BEFORE);
                MODE = NORMALMODE;
                  MessageBox("Could not set ADO connection properties. Setup will abort.",SEVERE);
                  abort;
          endcatch;   

    try
                oCn.Properties ("Prompt").Value = 4;
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "oCn property Prompt set to 4", BEFORE);
        catch
                ADOErrorHandler();
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not set oCn properties", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not set oCn properties", BEFORE);
                MODE = NORMALMODE;
                MessageBox (sError, SEVERE);
                abort;
        endcatch;
   
        try
                SQLRTInitialize( SUPPORTDIR ^ "SQLRT.ini");
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "Initialized SQLRT.ini file", BEFORE);
        catch
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Error initializing SQLRT.ini file", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Error initializing SQLRT.ini file", BEFORE);
                MODE = NORMALMODE;
                MessageBox("Could not initialize SQLRT.ini file. Setup will abort",SEVERE);
                abort;
        endcatch;
       
        if(!bSilentInstall) then
                nResult = SQLServerSelectLogin (sSQLServer, sUserID, sPassword, bWindowsLogin);
        endif;
       
        //Change common SQL conventions to computer name = (local) and .
        if (sSQLServer % "(local)")  then
                StrReplace(sSQLServer,"(local)",sComputerName,0);
        endif;
        if (sSQLServer % ".")  then
                StrReplace(sSQLServer,".",sComputerName,0);
        endif;
           
    if (nResult = BACK) then
                  return BACK;
        endif;
       
    sDatabaseName = "master";
    sConnection = "NewSQLConnection1";
    SdShowMsg("Please wait while verifying SQL login credentials",TRUE); 
        nResult = SQLRTConnect2 (sConnection, sSQLServer, bWindowsLogin, sUserID, sPassword, sDatabaseName);       
        SdShowMsg("Please wait while verifying SQL login credentials",FALSE);
 
        // Check if connection works with credentials provided
    if (nResult >=ISERR_SUCCESS ) then
                if (bWindowsLogin) then
                        bIntSecurity = TRUE;
                        LogCreateKey(sInstallLog, "CheckSQL", "WindowsAuthentication", "Yes", BEFORE);
                else
                        LogCreateKey(sInstallLog, "CheckSQL", "SQLAuthentication", "Yes", BEFORE);
                endif;
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "Connection using credentials worked", BEFORE);                         
        else
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Failed to validate authentication to SQL, please re-enter your SQL server login information", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Failed to validate authentication to SQL, please re-enter your SQL server login information", BEFORE);
                MODE = NORMALMODE;
                bSilentInstall = FALSE;
                MessageBox("Failed to validate authentication to SQL. Please re-enter your SQL server login information.",INFORMATION);
                  ResetoCn();
                goto Dlg_SQLServerSelectLogin;
          endif; 
 
        if (sIntSecurity = "SSPI")then
                bIntSecurity = TRUE;
        endif;
   
        // Check for instance name to modify Analysis Service name
        if (sSQLServer % "\\") then
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "SQL instance found", BEFORE);
                nLocation = StrFindEx(sSQLServer, "\\", 0);       
                nLocation = nLocation + 1;
                StrSub (sSubStr, sSQLServer, nLocation, 100);       
                sServiceName = "MSOLAP$"+ sSubStr;
        else
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "No SQL instance found", BEFORE);
                sServiceName = "MSSQLServerOLAPService";
        endif;
        LogCreateKey(sInstallLog, "CheckSQL", "AnalysisServiceName", sServiceName, BEFORE);

        // Change SQLServerAnalysisServices.bat
        sConfigFile = SUPPORTDIR^"SQLServerAnalysisServices.bat";
    sSearchStr = "**SQLANALYSISSERVICE**";
        sReplaceStr = sServiceName;
        EditConfigs (sConfigFile,sSearchStr,sReplaceStr);
        LogCreateKey(sInstallLog, "CheckSQL", "Message", "In "+sConfigFile+", changed "+sSearchStr+" with "+sReplaceStr, BEFORE);
       
        // Check for instance name to modify Analysis Service name
        if (sSQLServer % "\\") then
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "SQL instance found", BEFORE);
                nLocation = StrFindEx(sSQLServer, "\\", 0);       
                nLocation = nLocation + 1;
                StrSub (sSubStr, sSQLServer, nLocation, 100);       
                sServiceName2 = "SQLAgent$"+ sSubStr;
        else
                LogCreateKey(sInstallLog, "CheckSQL", "Message", "No SQL instance found", BEFORE);
                sServiceName2 = "SQLSERVERAGENT";
        endif;
        LogCreateKey(sInstallLog, "CheckSQL", "AgentServiceName", sServiceName2, BEFORE);       
       
        // Change SQLServerAgentServices.bat
        sConfigFile = SUPPORTDIR^"SQLServerAgentServices.bat";
    sSearchStr = "**SQLAGENTSERVICE**";
        sReplaceStr = sServiceName2;
        EditConfigs (sConfigFile,sSearchStr,sReplaceStr);
        LogCreateKey(sInstallLog, "CheckSQL", "Message", "In "+sConfigFile+", changed "+sSearchStr+" with "+sReplaceStr, BEFORE);

        // Try connecting with Native Client 10.0
        sDriver = "Driver={SQL Server Native Client 10.0};";
        if(bIntSecurity) then
                sConnection = sDriver + "Server="+sSQLServer+";Database=master;Trusted_Connection=yes;";
        else
                sConnection = sDriver + "Server="+sSQLServer+";Database=master; Uid="+sUserID+";Pwd="+sPassword +";";
        endif;
     
        try
                oCn.Open(sConnection);
                bLoggedIn = TRUE;
        catch
                LogCreateKey(sInstallLog, "CheckSQL", "ConnectionString", sConnection, BEFORE);
                bLoggedIn = FALSE;
        endcatch;
   
        // Try connecting with Native Client if Native Client 10.0 failed
        if(!bLoggedIn) then
                sDriver = "Driver={SQL Native Client};";
                if(bIntSecurity) then
                        sConnection = sDriver + "Server="+sSQLServer+";Database=master;Trusted_Connection=yes;";
                else
                        sConnection = sDriver + "Server="+sSQLServer+";Database=master; Uid="+sUserID+";Pwd="+sPassword +";";
                endif;
               
                try
                        oCn.Open(sConnection);
                        bLoggedIn = TRUE;
                catch
                        bLoggedIn = FALSE;
                        LogCreateKey(sInstallLog, "CheckSQL", "ConnectionString", sConnection, BEFORE);
                endcatch;
        endif;
               
        if(!bLoggedIn) then
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not open MDAC connection", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not open MDAC connection", BEFORE);
                MODE = NORMALMODE;
                MessageBox ("Could not open MDAC connection. Setup will abort.",INFORMATION);
                abort;
        endif;

       
          if (bLoggedIn) then
                // Check if installer is running remotely, and fail if so
                CheckSQLRemote();

                nResult = StrFindEx(sRemoteName, "\\", 0);
                StrSub ( sRemoteServerName, sRemoteName, 0, nResult);

                if (sRemoteServerName != sComputerName) then
                bRemoteSQLServer = TRUE;
                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Possible server name mismatch found, Machine found: " +sRemoteName+" compared to Local Machine Name: "+sComputerName, BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Possible server name mismatch found, Machine found: " +sRemoteName+" compared to Local Machine Name: "+sComputerName, BEFORE);
            endif;
               
                if (bRemoteSQLServer) then
                nResult = AskYesNo ( "Are you attempting to Install "+PRODUCT_NAME+" databases on a Clustered SQL Server?", YES );
               
                if (nResult = NO) then
                                LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Remote Database Installation is not permitted.  Setup will only install "+PRODUCT_NAME+" databases on a local SQL Server.  Please re-enter your SQL server login information", BEFORE);
                                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Remote Database Installation is not permitted.  Setup will only install "+PRODUCT_NAME+" databases on a local SQL Server.  Please re-enter your SQL server login information", BEFORE);
                                MODE = NORMALMODE;
                                  MessageBox("Remote Database Installation is not permitted.  Setup will only install "+PRODUCT_NAME+" databases on a local SQL Server.  Please re-enter your SQL server login information.",WARNING);
                            ResetoCn();
                            goto Dlg_SQLServerSelectLogin;
                    else
                                LogCreateKey(sInstallLog, "UserInput", "SQLClustering", "Yes", BEFORE);
                endif;
            endif;
           
                // Get SQL Version       
                set oRs = oCn.Execute ("select @@version");
                sSQLVersion = oRs.Fields(0);
               
                nStringLocation1 = StrFindEx (sSQLVersion, "-", 0 );
                StrSub ( svSQLVer, sSQLVersion, 0, nStringLocation1 );
                StrTrim (svSQLVer);
                LogCreateKey(sInstallLog, "SystemInformation", "SQLVersion", svSQLVer, BEFORE);
               
                nStringLocation1 = StrFind (sSQLVersion, "Corporation");
                if nStringLocation1 < 0 then
                        nStringLocation1 = StrFindEx (sSQLVersion, "(c)", 0 );
                        nStringLocation1 = nStringLocation1 + 3;
                else
                nStringLocation1 = nStringLocation1 + 11;
                endif;
                nStringLocation2 = StrFindEx (sSQLVersion, "Edition", 0 );
                StrSub (svSQLEd, sSQLVersion, nStringLocation1, nStringLocation2 - nStringLocation1);
                StrTrim (svSQLEd);
                LogCreateKey(sInstallLog, "SystemInformation", "SQLEdition", svSQLEd + " Edition", BEFORE);               
                oRs.Close;
               
                //Check if SQL is 2012 SP2 or 2014 SP1
                // Compare by Build Number
                szSQLQueryVersion = "SELECT SERVERPROPERTY('productversion')";   
                set oRs = oCn.Execute (szSQLQueryVersion);
                szSQLVersion = oRs.Fields(0);
                oRs.Close;

                //check version
                svRequiredVersion = "11.00.5058.0";
                //svRequiredVersion2 = "12.00.4100.1";
                nCompareFlag = VERSION;
               
                nCompareFlag = VerCompare ( svRequiredVersion , szSQLVersion , nCompareFlag);
                if (nCompareFlag = GREATER_THAN) then
                        LogCreateKey(sInstallLog, "SystemInformation", "ErrorMessage", "This installation requires Microsoft SQL Server 2012 SP2 or 2014 SP1. Setup will abort.", BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "This installation requires Microsoft SQL Server 2012 SP2 or 2014 SP1. Setup will abort.", BEFORE);
                        MessageBox("This installation requires Microsoft SQL Server 2012 SP2 or 2014 SP1. Setup will abort.",SEVERE);
                elseif ((nCompareFlag = LESS_THAN) || (nCompareFlag = EQUALS))  then
                        LogCreateKey(sInstallLog, "SystemInformation", "SQLBuild", szSQLVersion, BEFORE);
                endif;
                 
                  // Check to see of login user has sysadmin rights 
                if (bIntSecurity) then
                        sQuery = "SELECT IS_SRVROLEMEMBER ('SYSADMIN')";
                else
                    sQuery = "SELECT IS_SRVROLEMEMBER ('SYSADMIN', '"+sUserID+"')";
                endif;
                               
                try
                        set oRs = oCn.Execute (sQuery);
                        LogCreateKey(sInstallLog, "CheckSQL", "QueryExecuted", sQuery, BEFORE);
            catch
                        ADOErrorHandler();
                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        MODE = NORMALMODE;
                        MessageBox (sError, SEVERE);
                        abort;
            endcatch;
           
                if (!oRs.EOF) then
                        nFileValue = oRs.Fields(0);
                endif;
                       
                  oRs.Close;

                if (nFileValue = 1) then
                          bSysAdmin = TRUE;
                          LogCreateKey(sInstallLog, "CheckSQL", "Message", "User is a sysadmin in SQL", BEFORE);
                endif;
                   
                  // Abort if user does not have sys admin rights
                if (!bSysAdmin) then
                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Setup has determined that the logon account does not have the permission to perform this installation", BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Setup has determined that the logon account does not have the permission to perform this installation", BEFORE);
                        MODE = NORMALMODE;
                       
                        if (bIntSecurity) then
                                MessageBox ("Setup has determined that the logon account does not have the permission to perform this installation. Please contact your system adminisator to obtain a logon that has sysadmin permissions.",INFORMATION);
                        else
                                MessageBox ("Setup has determined that the logon account " +sUserID+" does not have the permission to perform this installation. Please contact your system adminisator to obtain a logon that has sysadmin permissions.",INFORMATION);       
                        endif;
                       
                        ResetoCn();
                        goto Dlg_SQLServerSelectLogin;
                endif;
               
                // Check if SQL Server collation is SQL_Latin1_General_CP1_CI_AS
                sQuery = "SELECT SERVERPROPERTY('collation') AS 'Collation'";
                               
                try
                        set oRs = oCn.Execute (sQuery);
                        LogCreateKey(sInstallLog, "CheckSQL", "QueryExecuted", sQuery, BEFORE);
                catch
                        ADOErrorHandler();
                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        MODE = NORMALMODE;
                        MessageBox (sError, SEVERE);
                        abort;
                endcatch;
               
                sCollation = oRs.Fields('Collation');
                LogCreateKey(sInstallLog, "CheckSQL", "SQLCollation", sCollation, BEFORE);
                oRs.Close;
               
                if (sCollation != "SQL_Latin1_General_CP1_CI_AS") then
                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Microsoft SQL Server collation SQL_Latin1_General_CP1_CI_AS not found", BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Microsoft SQL Server collation SQL_Latin1_General_CP1_CI_AS not found", BEFORE);
                        MODE = NORMALMODE;                       
                        MessageBox("This installation requires Microsoft SQL Server collation SQL_Latin1_General_CP1_CI_AS. Setup will abort.",SEVERE);
                        abort;
                endif;
               
                // Enable SQL Server Analysis Services
                ServiceGetServiceState(sServiceName, nServiceState);
                if ( nServiceState != SERVICE_RUNNING ) then
                        if(!bSilentInstall) then               
                                if (AskYesNo("The installers needs to enable SQL Server Analysis Services to continue, hit yes to enable and continue installation",YES) = NO) then
                                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "User decided to not enable SQL Server Analysis Services", BEFORE);
                                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "User decided to not enable SQL Server Analysis Services", BEFORE);
                                        MessageBox ("Contact your system administrator for more information to enable SQL Server Analysis Services. Setup will abort.", SEVERE);
                                        abort;
                                endif;
                        endif;
                        // Enable SQL Server Analysis Services
                        ExecuteFile(SUPPORTDIR, "SQLServerAnalysisServices.bat");
                endif;
               
                // Enable SQL Server Agent Service
                //sServiceName = "SQLSERVERAGENT";
                ServiceGetServiceState(sServiceName2, nServiceState);
                if ( nServiceState != SERVICE_RUNNING ) then
                        if(!bSilentInstall) then               
                                if (AskYesNo("The installers needs to enable SQL Server Agent Services to continue, hit yes to enable and continue installation",YES) = NO) then
                                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "User decided to not enable SQL Server Agent Services", BEFORE);
                                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "User decided to not enable SQL Server Agent Services", BEFORE);
                                        MessageBox ("Contact your system administrator for more information to enable SQL Server Agent Services. Setup will abort.", SEVERE);
                                        abort;
                                endif;
                        endif;
                        // Enable SQL Server Analysis Services
                        ExecuteFile(SUPPORTDIR, "SQLServerAgentServices.bat");
                endif;
               
            CloseOCN();
       
        // Find the Master Database path.  Set it as the default path if default not found in the regisy.
                sQuery = "Master..sp_helpfile";
              try
                    set oRs = oCn.Execute (sQuery);
                    LogCreateKey(sInstallLog, "CheckSQL", "QueryExecuted", sQuery, BEFORE);
            catch
                        ADOErrorHandler();
                        LogCreateKey(sInstallLog, "CheckSQL", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                        MODE = NORMALMODE;
                        MessageBox (sError, SEVERE);
                        abort;
                endcatch;
           
                while oRs.EOF = FALSE
               
                          if oRs("usage") = "data only" then
                                sDataFile = oRs("filename");
                        else       
                                sLogFile = oRs("filename");
                        endif;
                       
                          oRs.MoveNext;       
                endwhile;
               
            ParsePath (sReturnString, sDataFile, PATH);   
                  sMasterDataFile = sReturnString;
                 
        else
                ResetoCn();
                goto Dlg_SQLServerSelectLogin;
        endif;
end;                                                                       

//===========================================================================
// ResetoCn
//===========================================================================

function ResetoCn()

begin
       
        try
                set oCn  = NOTHING;
                set oFld = NOTHING;
                set oRs  = NOTHING;
                set oErr = NOTHING;
        catch
                LogCreateNode(sInstallLog, "OnFirstUIBefore", "ResetoCn", BEFORE);
                LogCreateKey(sInstallLog, "ResetoCn", "ErrorMessage", "Setting oCn, oFld, oRs or oErr to NOTHING", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Setting oCn, oFld, oRs or oErr to NOTHING", BEFORE);
        endcatch;
   
    try
                set oCn  = CreateObject("ADODB.Connection"); // Connect to SQL-DMO Restore
                set oFld = CreateObject("ADODB.Field"); // Connect to SQL-DMO Restore
                set oRs  = CreateObject("ADODB.Recordset"); // Connect to SQL-DMO Restore
            set oErr = CreateObject("ADODB.Error"); // Connect to SQL-DMO Restore
        catch
                LogCreateNode(sInstallLog, "OnFirstUIBefore", "ResetoCn", BEFORE);
                LogCreateKey(sInstallLog, "ResetoCn", "ErrorMessage", "Could not create local ADO connection object. Please ensure that MDAC is installed", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not create local ADODB connection object. Please ensure that MDAC is installed", BEFORE);
                MODE = NORMALMODE;
                MessageBox("Could not create local ADO connection object. Please ensure that MDAC is installed. Setup will abort",SEVERE);
                abort;
        endcatch;
end;

//===========================================================================
// CheckSQLMode
//===========================================================================
function CheckSQLMode()

        STRING  sQuery, sSQLMode;

begin

        LogCreateNode(sInstallLog, "OnFirstUIBefore", "CheckSQLMode", BEFORE);
       
        sQuery = "EXEC xp_loginconfig";
        try
                set oRs = oCn.Execute (sQuery);
                LogCreateKey(sInstallLog, "CheckSQLMode", "QueryExecuted", sQuery, BEFORE);
        catch
                ADOErrorHandler();
                LogCreateKey(sInstallLog, "CheckSQLMode", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute query: " + sQuery, BEFORE);
                MODE = NORMALMODE;
                bSilentInstall = FALSE;
                MessageBox (sError, SEVERE);
        endcatch;

        while oRs.EOF = FALSE
                if oRs("name") = "login mode" then
                        sSQLMode = oRs("config_value");
                endif;
                oRs.MoveNext;               
        endwhile;
       
        if (StrCompare ("Mixed",sSQLMode)!=0) then
                LogCreateKey(sInstallLog, "CheckSQLMode", "ErrorMessage", "SQL Server Authentication mode is not set to Mixed Mode", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "SQL Server Authentication mode is not set to Mixed Mode", BEFORE);
                MODE = NORMALMODE;
                MessageBox("SQL Server Authentication mode is not set to Mixed Mode. Please change the Authentication mode to Mixed Mode and re-run setup. Setup will abort", SEVERE);
                abort;
        else
                LogCreateKey(sInstallLog, "CheckSQLMode", "Message", "SQL Server Authentication mode is set to Mixed Mode", BEFORE);
        endif;
end;

//===========================================================================
// CloseOCN
//===========================================================================

function CloseOCN()

begin
        try
                oCn.Close;                                                               
                oCn.Properties("Connect Timeout")= 3600;                                 
                oCn.Open(sConnection);                                                               
                oCn.CommandTimeout = 0;
        catch
                LogCreateNode(sInstallLog, "OnFirstUIBefore", "CloseOCN", BEFORE);
                LogCreateKey(sInstallLog, "CloseOCN", "ErrorMessage", "CloseOCN failed", BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "CloseOCN failed", BEFORE);
        endcatch;
end;

Executing a Script
Code:

//===========================================================================
// ExecuteScript
//===========================================================================

function ExecuteScript(sScriptPath)
   
        OBJECT        oFileSysObj,oFile,oErr;
        STRING        szInfo, sResult,sMessages,szQuery1;
        STRING        strLine,strFileName,strError,svDate,svTime,strTemp;
        NUMBER        nvResult;
        LONG        nvRows,adCmdText,adCmdFile,sLong,nLength;
        INT                n,nErrCount;
        BOOL        nMode,bGO,bGOSPACE;

begin

        //Write to Intall Log
        LogCreateNode(sInstallLog, "DetailedLog", "ExecuteScript", BEFORE);
        LogCreateKey(sInstallLog, "ExecuteScript", "Script", sScriptPath, BEFORE);
       
        // Get script name
        ParsePath(sScriptName,sScriptPath,FILENAME);
       
        //Write To Script Log
        LogCreateText(sScriptLog, "============================================================ "+sScriptName+" ============================================================", 0, AFTER);
        LogCreateText(sScriptLog, "=================================================================================================================================================", 0, AFTER);

    oCn.Close;
    oCn = sConnection;
    oCn.Properties("Connect Timeout")= 28000;
    oCn.CommandTimeout = 0;

    oCn.Open;
        set oFileSysObj = CreateObject("Scripting.FileSystemObject");

        if(!IsObject(oFileSysObj)) then
                MODE = NORMALMODE;
                MessageBox("File system object not installed on target machine.  Install file system Object. Setup will abort", SEVERE);
                abort;
        endif;
       
        nMode = TRUE;
        sSQL = "" ;
       
        try
                //set oFile = oFileSysObj.OpenTextFile(sScriptPath, nMode);
                set oFile = oFileSysObj.OpenTextFile(sScriptPath, nMode(ForReading), false(create),  TristateFalse);
        catch
                LogCreateKey(sInstallLog, "ExecuteScript", "ErrorMessage", "Could not open "+sScriptName+" from " + sScriptPath, BEFORE);
                LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not open "+sScriptName+" from " + sScriptPath, BEFORE);
                MODE = NORMALMODE;
                MessageBox ("Could not open "+sScriptName+" from " + sScriptPath, SEVERE);
                return 0;
        endcatch;
       
        ParsePath(sScriptName,sScriptPath,FILENAME);

        while (!oFile.AtEndOfStream) 
                strLine = oFile.ReadLine;
                StrToUpper ( strTemp , strLine);
                StrTrim(strTemp);
               
                if (strTemp = "GO" || strTemp = "GO ") then
                        LogCreateText(sScriptLog, sSQL, 0, AFTER);
                        try
                                if sSQL != "" then
                                        oCn.Execute(sSQL);
                                endif;
                        catch
                                if (sScriptPath % "KillSQLConnections") then
                                        //do nothing.  known issue.
                                else
                                        ADOErrorHandler();
                                        LogCreateKey(sInstallLog, "ExecuteScript", "ErrorMessage", "Could not execute script: " + sSQL, BEFORE);
                                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute script: " + sSQL, BEFORE);
                                endif;
                        endcatch;
                       
                        sSQL = "";
                else
               
                        if(strLine = "?") then
                                strLine = "";
                        endif;
                        sSQL = sSQL + " " + strLine + "\n";
                       
                endif;
        endwhile;
       
        if (sSQL != "") then
       
                try
                        oCn.Execute(sSQL);
                        LogCreateText(sScriptLog, sSQL, 0, AFTER);                       
                catch
                        ADOErrorHandler();
                        LogCreateKey(sInstallLog, "ExecuteScript", "ErrorMessage", "Could not execute script: " + sSQL, BEFORE);
                        LogCreateKey(sInstallLog, "Errors", "ErrorMessage", "Could not execute script: " + sSQL, BEFORE);
                endcatch;
        endif;
       
        // Write To Script Log
        LogCreateText(sScriptLog, "=================================================================================================================================================", 0, AFTER);
        LogCreateText(sScriptLog, "", 0, AFTER);
        LogCreateText(sScriptLog, "", 0, AFTER);
       
        sScriptName = "";
end;

Any help is appreciated, even if we are starting over. I just want to make sure we are using the best methods, the "newest" info I can find here is from 2012.

launchappandwait faiing on windows 10

$
0
0
It appears that LaunchAppAndWait is failing for me when I try to execute a batch file on windows 10. Basically, doing this:

if (SYSINFO.WINNT.bWinXP != TRUE) then
LAAW_SHELLEXECUTEVERB = "runas";
endif;
nOptions = nOptions|LAAW_OPTION_HIDDEN|LAAW_OPTION_SHOW_HOURGLASS|LAAW_OPTION_WAIT|LAAW_OPTION_USE_SHELLEXECUTE;
SetStatusWindow (-1, szProgram+"("+szCmdLine+")");
nResult = LaunchAppAndWait (szProgram, szCmdLine, nOptions);

Quick Patch do not use the Correct Display Name

$
0
0
In 2016 Express the names and title of the installation in a Quick Patch is just "Patch" and not the name you specify as the Display name in the Identification.

-cpede

Call URL from InstallSheild

$
0
0
Hi Experts,

I need to call a web url using installscript

Can you please suggest the code to call weburl.


Regards,
Manish

Create & Start service using automation interface

$
0
0
Hi guys,

is it possible to create and start service using automation interface? Im trying to automate whole process from msbuilding codes from git repository to setup creation for specific customer, but I dont know if I can pass through that service issue I have.

Thanks for advice.

'Windows error 2 occurred while loading the Java VM' Java 8 Update 131 on Windows.

$
0
0
Hi,
I am facing a build issue with Install Anywhere regarding the Java 8 update 131, I am using InstallAnywhere 2014 SP1,
I have found a Hotfix for the same issue for windows at https://flexeracommunity.force.com/c...dows-Launchers

and followed all the mentioned steps, but Error ‘Windows error 2 occurred while loading the Java VM’.is still coming when uninstalling the build .
This hotfix is not working for me.

Can anyone please suggest the solution for the problem.

Regards,
Shailee

Setup does not wait for PreRequisite to complete before checking the condition again

$
0
0
When running a setup that contains one ore more prerequisites that were built with InstallShield 2016, immediately when the first prerequisite starts installing, the 'Installation of xxx has failed. Continue with setup?' dialog is shown.

I've found that this is caused by the fact that the prerequisite setup now clones itself and launches that clone. While there may well be valid reasons for doing so, one would expect that the original behavior would be maintained and that the cloning setup would wait for the cloned setup to complete, before returning.

Although the /clone_wait command-line option can be added in each of my .prq file, there's no valid reason for introducing such a breaking change. It also requires to rebuild each setup that contains an updated prerequisite, where we used to be able to silently update them and just ship a new version along with an existing setup.

Also, when using /clone_wait, the dialog with the prerequisites that require installing, is closed when the /clone_wait-prerequisite completes.

Is there another way to make setups wait for the clone they (might) create?

SQL Text Replacement Question

$
0
0
Suppose I have literal brackets ([&]) in my SQL script. How do I do text replacement?
For example... suppose I have the line
BACKUP DATABASE [MyDatabaseName]
How would I do text replacement using the property YOUR_DATABASE_NAME?

Thanks.
Viewing all 4553 articles
Browse latest View live