UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Tutorials / How to?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 15-08-2007, 19:05
new member
 
Join Date: Aug 2007
Posts: 4
Default Visual Studio 2005-Setup program: App Install location and Shortcuts

Have developed a simple Windows application in VS2005, using Visual Basic. It works fine. Problem is related in installing it using a setup program.
The program installs on my (development) machine and also on another machine via the webpage with the install button on it.. A new entry in the Start Menu is created which points to an Application Reference in Documents and Settings/User Name/StartMenu/Programs/Program Name. I cannot find the exe file on my machine (other than the one which was created in developing the application in its project/bin/debug folder) and this is dated before I clicked the install button. Where is the exe?
Also, my main problem which, perhaps is connected with the above, is that I cannot create any shortcuts on the desktop by adding them to the User's Desktop folder in File System Editor.
I have right clicked the Application folder and selected Add Project Output which creates Primary Output file. I then right clicked it to create a shortcut which I dragged to the User's Desktop folder. However, when I install from the webpage, no shortcut appears on the desktop. Have also tried inserting folders containing files in the User's Desktop folder but they still do not appear.
The default location for the Application folder is [ProgramFilesFolder][Manufacturer]\[ProductName] the application is not in this folder.
Have searched high and low for an answer but cannot find one.
Would be most grateful for anyone's help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 19-08-2007, 22:33
Member
 
Join Date: Jul 2007
Posts: 57
Default

Which setup program are you using?

Usually programs are installed in a subdirectory of the c:\Program Files\ directory, for example Skype installs to c:\Program Files\Skype\
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 20-08-2007, 13:17
paul's Avatar
Senior Member
 
Join Date: Nov 2005
Location: Virtual Private Server
Posts: 1,984
Default

I think he get resolved the issue from microsoft; forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2010785&SiteID=1
__________________
OrganizeOne
Darkness does not exist, it is just absence of Light..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 20-08-2007, 18:50
Member
 
Join Date: Jul 2007
Posts: 57
Default

Quote:
Originally Posted by paul View Post
I think he get resolved the issue from microsoft; forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2010785&SiteID=1
OK Thanks Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 21-08-2007, 15:00
new member
 
Join Date: Aug 2007
Posts: 4
Default

Hi Stukely and Paul,

Have tried the following coding and it seems to work. Would be most grateful for your comments on it:




Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



‘Create shortcuts to program and to online database on desktop if they do not exist

CreateShortcuts()



Dim DirInfo As System.IO.DirectoryInfo

‘Creates LIFEnet directory if it does not exist

If Not DirExists("C:\LIFEnet") Then

DirInfo = System.IO.Directory.CreateDirectory("c:\LIFEnet")

End If



‘Creates LIFEnet\Templates directory if it does not exist

If Not DirExists("C:\LIFEnet\Templates") Then

DirInfo = System.IO.Directory.CreateDirectory("C:\LIFEnet\Te mplates")



‘Copies Word Template into directory

Try

My.Computer.Network.DownloadFile("http://63.134.211.113/LIFEnetMail/LIFEnet Letter Template.dot", "C:\LIFEnet\Templates\LIFEnet Letter Template.dot", _

"", "", False, 10000, True)

Catch ex As Exception

MessageBox.Show("Unable to copy Letter Template" & vbCrLf & ex.Message)

End Try

End If



‘Creates LIFEnet\Documents directory if it does not exist

If Not DirExists("C:\LIFEnet\Documents") Then

DirInfo = System.IO.Directory.CreateDirectory("c:\LIFEnet\Do cuments")

End If

End Sub



Private Function DirExists(ByVal DName As String) As Boolean



‘Check if directory exists

Dim sDummy As String

Dim RightStr As String

On Error Resume Next



RightStr = Strings.Right(DName, 1)



If RightStr <> "\" Then DName = DName & "\"

sDummy = Dir$(DName & "*.*", vbDirectory)

DirExists = Not (sDummy = "")



End Function



Public Sub CreateShortcuts()

Dim objShell, strProgramsFolder, strDesktopFolder, objProgramShortcut, objURLShortcut, objFSO

objShell = CreateObject("WScript.Shell")

objFSO = CreateObject("Scripting.FileSystemObject")

strDesktopFolder = objShell.SpecialFolders("Desktop")

strProgramsFolder = objShell.SpecialFolders("Programs")



'Create shortcut to program

If Not objFSO.FileExists(strDesktopFolder & "\LIFEnetMail Program.appref-ms") Then

Dim ProgramPath = strProgramsFolder & "\LIFEnet Software\LIFEnetMail Program.appref-ms"

Dim DesktopPath = strDesktopFolder & "\LIFEnetMail Program.appref-ms"

Try

System.IO.File.Copy(ProgramPath, DesktopPath, True)

Catch e As Exception

Throw e

End Try

End If



'Create shortcut to online database

If Not objFSO.FileExists(strDesktopFolder & "\LIFEnet Online Database.url") Then

objURLShortcut = objShell.CreateShortcut(strDesktopFolder & "\LIFEnet Online Database.url")

objURLShortcut.TargetPath = "http://63.134.211.113/login.asp"

objURLShortcut.Save()

End If



objShell = Nothing

objFSO = Nothing



End Sub






The only thing is that, if the user deletes the shortcuts, they are created again when the program runs. Suppose I could create a text file with, say, an integer value in it (starting with 1). After shortcuts are created, this value is changed to 0 and the program checks this value when it runs. If 1, creates shortcuts, otherwise does nothing.



I am sure there is more elegant way of doing this!



Anyway, would much appreciate you view of the coding.



Regards

Brian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 31-08-2007, 20:17
Member
 
Join Date: Jul 2007
Posts: 57
Default

Hi,

Your installer should create the required short cuts for your program.

Personally I don't like too many icons on my desktop, it just clutters it up.

Cheers Stu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-09-2007, 12:00
new member
 
Join Date: Aug 2007
Posts: 4
Default

Hi Stu,
Decided to create the shortcuts and folders in the program itself:

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



Try
Me.Text = "LIFEnet Mailing Program. Version " & My.Application.Deployment.CurrentVersion.ToString
Catch inv As System.Deployment.Application.InvalidDeploymentExc eption
Me.Text = "LIFEnet Mailing Program. Version " & My.Application.Info.Version.ToString
End Try




CreateShortcuts()
Dim DirInfo As System.IO.DirectoryInfo
If Not DirExists("C:\LIFEnet") Then
DirInfo = System.IO.Directory.CreateDirectory("c:\LIFEnet")
End If
If Not DirExists("C:\LIFEnet\Templates") Then
DirInfo = System.IO.Directory.CreateDirectory("C:\LIFEnet\Te mplates")
Try
My.Computer.Network.DownloadFile("http://63.134.211.113/LIFEnetMail/LIFEnet Letter Template.dot", "C:\LIFEnet\Templates\LIFEnet Letter Template.dot", "", "", False, 10000, True)
Catch ex As Exception
MessageBox.Show("Unable to copy Letter Template" & vbCrLf & ex.Message)
End Try
End If
If Not DirExists("C:\LIFEnet\Documents") Then
DirInfo = System.IO.Directory.CreateDirectory("c:\LIFEnet\Do cuments")
End If
End Sub

Private Function DirExists(ByVal DName As String) As Boolean
Dim sDummy As String
Dim RightStr As String
On Error Resume Next

RightStr = Strings.Right(DName, 1)

If RightStr <> "\" Then DName = DName & "\"
sDummy = Dir$(DName & "*.*", vbDirectory)
DirExists = Not (sDummy = "")

End Function

Public Sub CreateShortcuts()
Dim objShell, strProgramsFolder, strDesktopFolder, objURLShortcut, objFSO
objShell = CreateObject("WScript.Shell")
objFSO = CreateObject("Scripting.FileSystemObject")
strDesktopFolder = objShell.SpecialFolders("Desktop")
strProgramsFolder = objShell.SpecialFolders("Programs")

'Create shortcut to program
If Not objFSO.FileExists(strDesktopFolder & "\LIFEnetMail Program.appref-ms") Then
Dim ProgramPath = strProgramsFolder & "\LIFEnet Software\LIFEnetMail Program.appref-ms"
Dim DesktopPath = strDesktopFolder & "\LIFEnetMail Program.appref-ms"
Try
System.IO.File.Copy(ProgramPath, DesktopPath, True)
Catch e As Exception
Throw e
End Try
End If

'Create shortcut to online database
If Not objFSO.FileExists(strDesktopFolder & "\LIFEnet Online Database.url") Then
objURLShortcut = objShell.CreateShortcut(strDesktopFolder & "\LIFEnet Online Database.url")
objURLShortcut.TargetPath = "http://63.134.211.113/login.asp"
objURLShortcut.Save()
End If

objShell = Nothing
objFSO = Nothing

End Sub

Realise that many people dislike shortcuts on the desktop but thought I should initially create them and then users can delete them if they wish. Trouble is that the present coding will recreate them with every update. May modifiy it to only create shortcuts if the folders do not exist (e.g. when the program is first installed). Thanks again for all your help.

Regards, Brian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-09-2007, 13:45
Member
 
Join Date: Jul 2007
Posts: 57
Default

Hi Brian,

Quote:
Originally Posted by bogorman View Post
May modify it to only create short cuts if the folders do not exist (e.g. when the program is first installed).
Yeah that sounds good.

I would also recommend that you use a domain name, instead of a fixed IP, for downloading the template. That way the code will still work if your IP address ever changes.

Also your directories are hard coded to C: drive. It is possible, although unlikely, that the user may not have a C: drive on their computer.

Good luck, Stu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-09-2007, 14:51
new member
 
Join Date: Aug 2007
Posts: 4
Default shortcuts, etc

Hi Stu,
Yes, I do intend to eventually use a domain name.
Your point about C: is certainly worth considering. However, the database is for a charity and will only be used by about a dozen people. As far as I know (and this can be established when we go "online") they will all use machines with a C: drive.
Thanks again for all your help. Much appreciated
Brian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 18:09.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles

Web Hosting
Web Hosting Service