forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Create a desktop icon / shortcut

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Fri Mar 04, 2011 5:41 pm    Post subject: Create a desktop icon / shortcut Reply with quote

I was looking for a simple way to create a desktop icon for a program which I have installed just by copying the EXEs and DLLs into a new folder. May be that someone here can use it:

Code:
      subroutine create_vbs()

c     creates and runs a Visual-Basic-Script for a shortcut

      IMPLICIT NONE
      INCLUDE <WINDOWS.INS>

      integer*4      j
      character*256  path_1,path_2,string,getenv@
c
c     in this example, MYPROG is the name of the programme for which
c     a desktop icon should be created
c
      path_1 = ' '
      path_2 = ' '
      path_1 = getenv@('USERPROFILE')
      path_2 = getenv@('PROGRAMFILES')
      call append_string@(path_2,'\MYPROG')

      open(10,file='shortcut.vbs',err=900,status='unknown')
      write(10,'(A)',err=900)
     *  'Set oWS = WScript.CreateObject("WScript.Shell")'
      string = ' '
      string = 'sLinkFile = "'
      call append_string@(string,path_1)
      call append_string@(string,'\DESKTOP\MYPROG.LNK"')
      write(10,'(A)',err=900)string
      write(10,'(A)',err=900)
     *  'Set oLink = oWS.CreateShortcut(sLinkFile)'
      string = ' '
      string = 'oLink.TargetPath = "'
      call append_string@(string,path_2)
      call append_string@(string,'\MYPROG.EXE"')
      write(10,'(A)',err=900)string
      write(10,'(A)',err=900)'oLink.Description = "MYPROG"'
      string = ' '
      string = 'oLink.IconLocation = "'
      call append_string@(string,path_2)
      call append_string@(string,'\MYPROG.EXE, 0"')
      write(10,'(A)',err=900)string
      string = ' '
      string = 'oLink.WorkingDirectory = "'
      call append_string@(string,path_2)
      call append_string@(string,'"')
      write(10,'(A)',err=900)string
      write(10,'(A)',err=900)'oLink.Save'
900   close(10)

      call cissue@('shortcut.vbs',j)

      open(10,file='shortcut.vbs',err=910,status='old')
910   close(10,status='delete')
      return
      end

Regards - Wilfried
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Mar 04, 2011 6:37 pm    Post subject: Reply with quote

Wilfried,

Nice example.

Many users on the forum use an Installer program. The one I use is Jordan Russell Software's "InnoSetup". Google for InnoSetup or Jordan Russell and you'll find it. Even better is that it is freeware.

InnoSetup can be configured with a script so that it installs wherever you choose (e.g. in C:\Program Files\etc) and whether you want to do such things as install fonts, DLLs, icons (desktop, Start menu etc), shortcuts , file associations and other registry entries and so on. Really clever is that it can also install salflibc.dll for you, create folders, and copy example files. All of this is then packed up into a single EXE file, which unpacks itself when you run it. Since the Setup EXE file is a zipped type of file, it can be a lot smaller than you would think.

I recommend that you try it.

Regards

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group