Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

We had an instance of a Windows 2003 server install of 12.0.1.3352 where the SQLANY12 environment variable was not created, as described in another question in this forum.

When the InstallShield setup from our application started the install process was aborted as the SQLANY12 environment variable was not found and there was no indication that any issue was found in the server or user settings during the 12.0.1 install.

Is there a way to have a warning message displayed during the install that SQLANY12 variable has not been successfully created?

asked 06 Apr '12, 09:34

Derli%20Marcochi's gravatar image

Derli Marcochi
1.6k323877
accept rate: 33%

edited 06 Apr '12, 12:47


How are you creating this install deployment? Are you just using the regular SQL anywhere product install or did you create your own deployment using the Deployment Wizard?

By default, both the full SQL Anywhere setup and the Deployment Wizard installs create a "SQLANY12" environment variable using the regular Windows Installer features, which should create a system-level environment variable on installation and remove it upon uninstallation.

To see this: Open the SQL Anywhere MSI in "Orca" -> "Tables" -> "Environment" -> "*=-SQLANY12"

( To see the table of what the "*=-" code means before the environment variable, see: http://msdn.microsoft.com/en-us/library/windows/desktop/aa368369%28v=vs.85%29.aspx )

Have you tried monitoring the operating system while you are installing SQL Anywhere and checking with a tool such as "Process Monitor" to see if you are hitting any OS-level permissions issues with these installations when creating the environment variable? Have you tried to enable logging of the SQL Anywhere installation by using:

setup.exe "/v: /l*v! logfile"

to see if there are any errors logged when you install?


Is there a way to have a warning message displayed during the install that SQLANY12 variable has not been successfully created?

To answer your question, if you are creating your own MSI, you could potentially modify the MSI actions and launch your own install VBS script at post-install to check whether the variable that you're interested in exists:

(Warning: Untested code! Hopefully this should get you started...)

' ====================================
' == post-install-env-check.vbs
' ====================================

Dim oShell
Set oShell = CreateObject("WScript.Shell")
If Not oShell Is Nothing Then
    Set WshSysEnv = oShell.Environment("SYSTEM")
    If Not IsNull(WshSysEnv("SQLANY12")) Then
        If WshSysEnv("SQLANY12") = "" Then
        MessageBox("WARNING! Variable %SQLANY12% may not be correctly set. " &_
                   "Check permission on HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment ?")
        End If
    Else
        MessageBox("WARNING! Variable %SQLANY12% may not be correctly set. " &_
                   "Check permission on HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment ?")
    End If
    Set WshSysEnv = Nothing
    Set oShell = Nothing
End If

In Orca with the MSI loaded, you would then need to go to the "Binary" table. Add an entry:

Name         Data
EnvCheck     [Binary Data]   (Browse to 'post-install-env-check.vbs')

Go to the "Custom Action" table. Add an entry:

Name         Type            Source
DoEnvCheck   6               EnvCheck

Go to the "InstallExecuteSequence" table. Add an entry:

Action  Condition        Sequence
DoEnvCheck  NOT Installed    6700

Save, and run the MSI.

permanent link

answered 10 Apr '12, 15:14

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

The first install was done with the regular SQL Anywhere install (12.0.1.3352). This was the first time we had this issue during a install so the answer for your question is no, we didn't have any monitoring tool in place while installing SQL Anywhere and it was done with full admin rights.

I was wondering if a message could be displayed from the regular SQL Anywhere Install setup to warn the user when it was not possible to create the environment variable for any specific reason. Thanks anyway for your suggestions!

(11 Apr '12, 16:33) Derli Marcochi
Replies hidden

As I mentioned, the environment variables to be set are handled by the Microsoft Windows Installer process - the MSI information should be correct to set this information for both the full SQL Anywhere install and the Deployment Wizard installs. (i.e. you can see the values in Orca).

If the Windows Installer can't set/generate environment variables, I would expect that the Windows Installer would throw an error (e.g. Event ID 1032 - "Windows Installer Environment Variables Refresh" ) as it is the Windows Installer's responsibility to create (and check for) the variables correctly. You should be able to add additional logging in the Windows Installer process to catch this issue, otherwise using Process Monitor should provide you with enough detail about the exact permissions issue.

(12 Apr '12, 14:59) Jeff Albion
1

It seemed to me that EventID 1032 would only be triggered when an existing environment variable couldn'be updated which is not the case in a fresh install. However, I agree with yout that MSI should take care about this type of events during the install. Thanks Jeff!

(13 Apr '12, 10:34) Derli Marcochi
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×438
×113
×47

question asked: 06 Apr '12, 09:34

question was seen: 3,869 times

last updated: 13 Apr '12, 10:35