Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delivering Database, ? Desktop Shortcut... 2

Status
Not open for further replies.

Dalain

Technical User
Jan 10, 2003
104
CA
This may not be the right Forum, but I am ready to deliver a database to my employer. The database is one MDE about 7MB. I have been using a Zip self-extractor, to place the file in the proper directory.

The problem is, how do I place/create a Shortcut to this file on his desktop automaticaly. I have noticed that every user’s desktop in actually in a different location, according to the User that is currently log on. This Database will be use on both Win98 and Win2000 systems.

I am using Access 2000 Professional.

Thanks in advance.

Pierre
 
Thanks Christiaan, But that wasn't quite what I was looking for.

I want the User to Double Click a Setup.exe type file which will extract the My Databse to C:\Database and the ShortCut to C:\windows\Desktop or to c:\Documents and Settings\Username\Desktop. Depending on the OS

The only I can see now is to create a self extractor for each OS, Is there another way?

Thanks

Pierre

 
If this Setup.exe type file is created using VBA try ising something like this:

Dim strInstallDir As String
strInstallDir = "C:\windows\Desktop"
If Dir(strInstallDir, vbDirectory) <> &quot;&quot; Then
'Copy shortcut to strInstallDir
Else
'Copy shortcut somewhere else
End If
 
How would you create a .exe using VBA?
I am not able to create .exe files with the version of Access I am using.


Pierre

 
I use a Visual Basic Script file to do the shortcut installation. Here's an example - a couple of things to bear in mind are that I use the user's NT username as their database username, and that my clients are using Windows 2000. Here's the VBS:

Code:
Set WshNetwork = WScript.CreateObject(&quot;WScript.Network&quot;)
Dim strI
strI = InputBox(&quot;Enter your database username here. This is usually the same as your NT username.&quot; & chr(10) & chr(13) & chr(10) & chr(13) & &quot;PLEASE NOTE: leaving this blank will cancel the installation!&quot;, &quot;Database shortcut creation - personalisation&quot;, WshNetwork.UserName)
If Len(strI)>0 Then
    Dim WSHShell
    Set WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
    Dim MyShortcut, MyDesktop, DesktopPath
    DesktopPath = WSHShell.SpecialFolders(&quot;Desktop&quot;)
    Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & &quot;\Database - production.lnk&quot;)
    MyShortcut.TargetPath = &quot;C:\Program Files\Microsoft Office\Office\MSACCESS.EXE&quot; 'Put your user's default Access location here
    MyShortcut.Arguments = &quot;\\server\share\folder\db.mdb /wrkgrp \\server\share\db\system.mdw /user &quot; & strI 'Customise as required
    MyShortcut.WorkingDirectory = &quot;C:\Program Files\Microsoft Office\Office\&quot; 'Customise as required
    MyShortcut.WindowStyle = 3
    MyShortcut.IconLocation = &quot;\\server\share\folder\db.ico&quot; 'Customise as required
    MyShortcut.Save
    Msgbox &quot;Installation completed successfully.&quot;, 64, &quot;DB installation&quot;
Else
    Msgbox &quot;Installation was cancelled.&quot;, 48, &quot;DB installation&quot;
End if

The user can then just double-click the VBS to create a personalised desktop shortcut - saves you the time and hassle of having to build a setup EXE.

Alternatively, if you really want an EXE you could surf over to and look for the free/lite vesion of their excellent Setup Generator. [pc2]
 
Well this does look like what I am looking for. I will have to play with it, to see if I can adapt to my needs.


Thanks

Pierre
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top