cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Epic 5.2 and registry

ptc-953926
1-Newbie

Installing Epic 5.2 and registry



Hi Adepters:







Has anyone noticed that when you install
Epic (Arbortext) 5.2 that it doesn’t register itself in the system
registry? That is, if you go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths you won’t find Epic.exe. This is definitely a change from Epic 5.1
and probably earlier and means any application that checks the registry for the
location of Epic.exe is going to fail. We’ve verified this with several
installs of Epic 5.2.








Dave Hintz



UGS Corp.



3 REPLIES 3

Yes, we have an application that won't launch if it can't
find Epic. Epic 5.1 was OK but it won't launch with 5.2 installed.
Code will have to change.





From: Hintz, David L

Sent: Tuesday, June 20, 2006 11:50 AM
To:
adepters@arbortext.com
Subject: Installing Epic 5.2 and
registry




style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">Hi
Adepters:



style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">Has anyone noticed
that when you install Epic (Arbortext) 5.2 that it doesn’t register itself in
the system registry? That is, if you go to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths you won’t
find Epic.exe. This is definitely a change from Epic 5.1 and probably
earlier and means any application that checks the registry for the location of
Epic.exe is going to fail. We’ve verified this with several installs of
Epic 5.2.



style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">Dave
Hintz



style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: Arial">UGS
Corp.


>> To unsubscribe from the list, send an
email to listmanager@maillist.arbortext.com with the following in the body:
unsubscribe adepters - For additional information on the adepters list (how to
subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>>

In our 5.2 release, we switched to a much more modern installer
technology for Windows. Below is some example code (unsupported by the
way) that uses the Installer API from Microsoft to see where we got
installed. You should be able to use this as a start for your own code.



// Example of using the Windows Installer API to locate an
// Arbortext installation. DJW 5/19/06

#include "windows.h"
#include "msi.h"
#include "tchar.h"
#include "stdio.h"

int main(int argc, TCHAR* argv[])
{
// Enumerate all of the installed products by GUID.
TCHAR szProductCode[39]; // 38-character GUID plus terminator
DWORD i = 0;
while (MsiEnumProducts(i++, szProductCode) == ERROR_SUCCESS)
{
TCHAR szProductName[256], szInstallLoc[256],
szVerMajor[256], szVerMinor[256], szVerString[256];

// For each installed product, obtain the name and see
// if it begins with "Arbortext ".
DWORD len = 256;
if (MsiGetProductInfo(szProductCode,
INSTALLPROPERTY_INSTALLEDPRODUCTNAME,
szProductName, &len) != ERROR_SUCCESS)
continue;
if (_tcsncmp(szProductName, _T("Arbortext "), 10) != 0)
continue;

// We have a hit. Fetch the install location and the
// version information.
len = 256;
MsiGetProductInfo(szProductCode,
INSTALLPROPERTY_INSTALLLOCATION,
szInstallLoc, &len);
len = 256;
MsiGetProductInfo(szProductCode, INSTALLPROPERTY_VERSIONMAJOR,
szVerMajor, &len);
len = 256;
MsiGetProductInfo(szProductCode, INSTALLPROPERTY_VERSIONMINOR,
szVerMinor, &len);
len = 256;
MsiGetProductInfo(szProductCode, INSTALLPROPERTY_VERSIONSTRING,
szVerString, &len);

printf("Product name: %s\nInstalled location: %s\n",
szProductName, szInstallLoc);
printf("Version major: %s\nVersion minor: %s\nVersion string:
%s\n",
szVerMajor, szVerMinor, szVerString);
}
return 0;
}



John Dreystadt
Software Development Director
Arbortext - PTC
734-327-6079
-



John's way is a bit nicer than mine; nonetheless, this may be helpful
to some...

Below is an excerpt from a batch file that makes a large assumption:
if the APTPATH environment variable is not set, you want the last
version listed within the "HKEY_LOCAL_MACHINE\SOFTWARE\Arbortext\
Epic Editor" key. It does require your users start your
customization through a batch file...a practice I have elected to
continue in addition to APTCUSTOM's offerings.

It's nice for those multiple Epic version environments, and
customizations thereof. If one doesn't specify their preferred
version (via APTPATH), this will use the most recent* version
(*only because of the registry key order).

<snip>
:GET_APTPATH
IF NOT "%APTPATH%"==" GOTO GET_EPIC
SET REG_FILE=epic.tmp
SET TREE_FILE=tree.tmp
START /w regedit /e %REG_FILE% "HKEY_LOCAL_MACHINE\SOFTWARE\Arbortext\Epic Editor"
TYPE %REG_FILE% | FINDSTR /b "[\"]tree[\"]=" > %TREE_FILE%
IF ERRORLEVEL 1 GOTO NO_APTPATH
FOR /f "tokens=2 delims==" %%x IN (%TREE_FILE%) DO SET APTPATH=%%~x
IF ERRORLEVEL 1 GOTO NO_APTPATH
DEL %REG_FILE%
DEL %TREE_FILE%
IF "%APTPATH%"==" GOTO NO_APTPATH

:GET_EPIC
SET EPIC_EXE=%APTPATH%\bin\epic.exe
IF NOT EXIST "%EPIC_EXE%" GOTO NO_EPIC
</snip>

HTH,
Brent

Announcements