April 27, 2024, 04:07:23 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Creating an Installer Program

Started by billhsln, September 26, 2010, 05:54:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

I have a program that I created which has lots of JPG files in multiple directories, along with a main program and a few other files.   I am planning on writing this all to a DVD (need over 1 GB).  My question is, how would I create a short cut from my program that copies and creates all the files I need?  I will need a short cut for my main program only and would like it to show up on the user's desktop screen.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

For the installer for the programs I write I use InnoSetup http://www.innosetup.com/isdl.php
with ISTool http://www.istool.org/  sitting on top of it.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

WayneA

For the shortcut portion (though I'm not 100% sure what you're doing and what needs to generate a shortcut) heres some code that'll do it. I think this was originally written by fletchie, I've only consolidated it so no non-standard include  files are needed.

$INCLUDE "ishelllink.inc"
Const SW_SHOWNORMAL=1
Const COINIT_APARTMENTTHREADED=2
Const CLSCTX_INPROC_SERVER=1
Const CP_ACP=0
Declare Import,CoInitializeEx(pvReserved As UInt,dwCoInit As UInt),Int
Declare Import,MultiByteToWideChar(CodePage As Int,dwFlags As Int,lpMultiByteStr As String,cchMultiByte As Int,lpWideCharStr As String,cchWideChar As Int),Int
Sub CreateShortCut(fn As String,towhat As String,desc As String,startdir As String,args As String,hotkey As Int,iconfile As String,iconid As Int),Int
'Dim CLSID_ShellLink,IID_IShellLinkA As Guid
'Dim _IID_IPersistFile As Guid
Dim ShellLink As ComRef
Dim pPersistFile As ComRef
Dim wid[520] As IString
CoInitializeEx(0,COINIT_APARTMENTTHREADED)
If (CoCreateInstance(_CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,_IID_IShellLinkA,ShellLink)=0)
set_interface ShellLink,IShellLinkA
set_interface pPersistFile,IPersistFile
ShellLink->QueryInterface(_IID_IPersistFile,pPersistFile)
ShellLink->SetPath(towhat)
ShellLink->SetDescription(desc)
ShellLink->SetArguments(args)
ShellLink->SetHotkey(hotkey)
ShellLink->SetShowCmd(SW_SHOWNORMAL)
If iconfile<>""
ShellLink->SetIconLocation(iconfile,iconid)
EndIf
ShellLink->SetWorkingDirectory(startdir)
MultiByteToWideChar(CP_ACP,0,fn,-1,wid,520)
pPersistFile->Save(wid,1)
pPersistFile->Release()
ShellLink->Release()
CoUninitialize()
Return 1
Else
CoUninitialize()
Return 0
Endif
EndSub
99 little bugs in the code,
99 bugs in the code,
Fix one bug,
Compile again,
104 little bugs in the code...

All code I post is in the public domain.

billhsln

Thanks Larry McCaughn, those 2 programs are exactly what I was looking for.

Thanks to WayneA, your program will also be worth looking into, way beyond me for now, but I can use it to learn.

So, thanks again to both of you.

Bill
When all else fails, get a bigger hammer.

Copex

just incase you don't get along with larry suggestion you could try this one. http://nsis.sourceforge.net/Main_Page

QuoteNSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.

Being a user's first experience with your product, a stable and reliable installer is an important component of succesful software. With NSIS you can create such installers that are capable of doing everything that is needed to set up your software.

NSIS is script-based and allows you to create the logic to handle even the most complex installation tasks. Many plug-ins and scripts are already available: you can create web installers, communicate with Windows and other software components, install or update shared components and more.
-
I really should learn how to use a spell checker! though im not sure how it will help someone who can not spell?
-
Except where otherwise noted, content Posted By Copex is
licensed under a Creative Commons Attribution 3.0 License

http://creativecommons.org/licenses/by/3.0/

billhsln

Will check it out, Copex.  What I am setting up is for a distribution to friends only, since I can not legally distribute scans of the cards.  It is a program to keep track of Pokemon cards and create lists to be used for tournaments.  I have spent over 8 months on it with the help from many people here in this forum.  I think I am up to the point where I would like one of the guys that I know from the League to test what I have made and give criticism and comments on how it works.  It can not be for general distribution due to legalities.  There are only a few files needed in the main directory, but the sub-directories, which have the pictures of the cards, will have over 5,000 pictures and multiple directories.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

Bill
Based upon my understanding of what you are trying to do, this is what I would do:
1st, your program:
when it is run for the first time:
  1. have it create whatever working directories your app needs
  2. have the user indicate the drive letter for the DVD on their pc or have your app search for it by going through drive letters testing for a unique file name.
2nd, the pictures:
  leave them on the DVD in the file structure you desire.

3rd, the installer
have it install into a location of the user's choice
have any support files put in mydocs
have it create a shortcut for your app on the user's desktop


The above is just my best guess without having seen your app and exactly what you are doing.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

I only can tell you what i use last time i make installer for ABasic .
I found on Softpedia program called Mep Installer 2.1.3.
It is a scripting language instaler very similiar to basic but offer great things.

ckoehn

I have had good luck with CreateInstall Free.  I don't have a link handy, you'll have to google it.

Later,
Clint