football_rules
07-21-2003, 11:37 AM
in a form, im tryin 2 write code to add a certain file to the startup file of the user that is logged in
suppose that file is called
'abc.txt'
and i want 2 add it to the startup folder of this user.............dont know how
please advise..
also, how can i package this particular abc.txt file with my program???? or do i have 2 create a new one then??
HOW??!?!?!?!?!
Optikal
07-21-2003, 11:43 AM
Every setup package creators should allow you to include any files you want in the setup package. You are making a setup package right?
Most installers will also automatically stick the file in whatever folder you want it to.
alternatively
if you wanted to make your program do it when ran you could use...
Dim fso As New FileSystemObject
fso.CopyFile "FILETOCOpy", "PLACETOPUTIT"
this would have to be Operating system specific though, in XP for example you would set the target destination as
c:\documents and settings\all users\Start Menu\Programs\Startup
football_rules
07-21-2003, 11:55 AM
how can i make a setup package
that is want i want 2 do but i jsut thought i would have 2 do the packaging later.....
is there a function in vb to make a setup package??
Optikal
07-21-2003, 12:01 PM
VB comes with the Package and Deployment Wizard to create setup packages. However, I would highly recommend against using it, since it is pretty horrible. InnoSetup is a free one I hear people talk about quite often, a google search should turn up the website. Also there are many good ones if you are willing to pay, such as InstallShield, WISE, VISE, etc.
You can also create MSI files for use with the Windows Installer, which is the method I would use. I haven't had the need to do this yet, but all the documentation can be found here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/about_windows_installer.asp
I have heard people say that creating MSI files with just the MS tools can be quite a hassle, so you might want to stick with InnoSetup.
ssrikant
07-25-2003, 02:52 PM
Althernatively u could jus create a short cut to the location this file is ....unless u have this file at startup alone...u could use windows script host modal object for creating short cut ...
here is the code..
Add windows script host model to ur reference then
dim wshm as IWshShell_Class
Dim SlLk As IWshShortcut_Class
Set SlLink = wshm.CreateShortcut("C:\Documents and Settings\All Users\Start Menu\Programs\Startup\" & Client & ".lnk")
With SlLk
.TargetPath = "c:\Software\exes\" & Client
.WindowStyle = 1
.IconLocation = "c:\Software\setupfiles\client.ico,0"
.Arguments = ""
.Save
End With
here is the actuall link http://visualbasicforum.com/showthread.php?t=87705 t=87705
VB comes with the Package and Deployment Wizard to create setup packages. However, I would highly recommend against using it, since it is pretty horrible. InnoSetup is a free one I hear people talk about quite often, a google search should turn up the website. Also there are many good ones if you are willing to pay, such as InstallShield, WISE, VISE, etc.
You can also create MSI files for use with the Windows Installer, which is the method I would use. I haven't had the need to do this yet, but all the documentation can be found here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/about_windows_installer.asp
I have heard people say that creating MSI files with just the MS tools can be quite a hassle, so you might want to stick with InnoSetup.
football_rules
07-28-2003, 07:43 AM
this code would only work for nt, 2000, and xp
if i want this paste the link to the startup folder in 9x, how would i do that, i mean wat would be the generic link in this line:
Set oShellLink = wshshell.CreateShortcut("C:\Documents and Settings\All Users\Start Menu\Programs\Startup\" & Client & ".lnk")