IonicWind Software

IWBasic => General Questions => Topic started by: billhsln on September 26, 2010, 05:54:40 PM

Title: Creating an Installer Program
Post by: billhsln on September 26, 2010, 05:54:40 PM
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
Title: Re: Creating an Installer Program
Post by: LarryMc on September 26, 2010, 06:37:56 PM
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
Title: Re: Creating an Installer Program
Post by: WayneA on September 26, 2010, 06:40:02 PM
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
Title: Re: Creating an Installer Program
Post by: billhsln on September 26, 2010, 09:59:46 PM
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
Title: Re: Creating an Installer Program
Post by: Copex on September 27, 2010, 04:27:14 AM
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.
Title: Re: Creating an Installer Program
Post by: billhsln on September 27, 2010, 09:43:23 AM
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
Title: Re: Creating an Installer Program
Post by: LarryMc on September 27, 2010, 10:13:36 AM
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
Title: Re: Creating an Installer Program
Post by: aurelCB on September 27, 2010, 12:45:05 PM
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.
Title: Re: Creating an Installer Program
Post by: ckoehn on September 28, 2010, 04:55:55 PM
I have had good luck with CreateInstall Free.  I don't have a link handy, you'll have to google it.

Later,
Clint