|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
I write stuff in Access VBA for Microsoft Office (some of us have to!)
I can figure out from the registry which version of Access the user has installed, and then I want to choose which version of the database to install. In the language I'm familiar with, what I want to do is: AccessVer=CheckVersion SelectCase AccessVer Case 1 database97Install Case 2 database2000Install Case 3 databaseXPInstall Case else msgbox "Go away, you don't have Access installed" End Select I've got the version from the registry into $4 which, with StrCmp I can use to generate messages, but how to I use this to get the installer to install different versions. Can anyone help - is that what this prefunc stuff is for? Probably very obvious, but I only just got into this. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Get strcmp to target a definate place in the section, e.g.
code: -Stu |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
Very useful but ...
I'm feeling particularly dim about this!
What do I actually put in substitution for ...Files to extract for database97 in here... I mean how do you write that? SetOutPath $INSTDIR File /r AuditorFiles97\*.* |
|
|
|
|
|
#4 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
For example, if you want to extract a file called database.dat, use something like this:
File /oname=database.dat 97.dat This will extract the file database.dat (with the data stored in 97.dat on your PC). If they don't need to have the same filename, you don't have to use /oname=?. If you put 'em in the same directory, you only have to use SetOutPath once, before the version check. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
TQ
Thanks for that Joost (and Stu) - will give it a hack.
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2003
Location: Perth, Western Australia
Posts: 22
|
Hi David,
I'm wondering whether you can post your code to detect what version of Access is installed on the computer. I'm having varying amounts of success trying to write the code myself. Thanks, Dave. |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
Code coming
Will certainly post code when it is done - but just blew up my app with a new 'feature' so got diverted from install routine!
(and just seem to have unsubscribed myself from this thread - the screen said - so hope this is logged!) If you want where I have got to so far, post back, but I have to have something clean by Thursday anyway, so I'll put the finished code up then. So far as I can see the key is this EnumRegKey $R0 HKEY_LOCAL_MACHINE "Software\Microsoft\Office\8.0\Access" 0 StrCmp $R0 "" not8 got8 if you run this for 8=97, 9=2000 and 10=XP you know what is installed (according to the Registry anyway) and can then decide what to install (or nothing if no Access is found). XP seems to run 2000 stuff no probs. but I have to use different mde for 97. |
|
|
|
|
|
#8 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
This Archive directory might help too.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
Neat
TQ - that's a useful ref.
First item on the list gets you the install path for Access - and being blinkered by a deadline right now I forgot about all the other stuff that lies buried below the reg key! |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2003
Location: Perth, Western Australia
Posts: 22
|
Thanks for the reference Kichik - I was looking in the "How to detect if ... is installed" instead, which didn't have any relevant scripts.
David, I can confirm for you that, as you suspected, Access XP is able to run Access 2000 files without conversion, however Access 97 needs Access 97 files. Hope you meet your deadline! Ta, Dave. |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: May 2003
Location: West Sussex, UK
Posts: 6
|
Some code
As promised here is the script that I used to install the right version of an Access App. I'm sure it could be more elegant - but it worked and if I'll stick up the next version if I get there.
One odd thing I couldn't get round was that when I wrote a version with different components, I couldn't figure out how to fix the filesize being reported in the relevant section. With either of two files to be installed (conditional of Access version) the component dialog reported the install filesize as being the sum of both. A small thing to be hacked around later. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|