Setup program

Setup program

Anonymous
Not applicable
489 Views
6 Replies
Message 1 of 7

Setup program

Anonymous
Not applicable
I am writing a setup program for some AutoCAD software I developed. The software and setup program are packaged in a zip file that the user extracts to a temporary folder for installation. The user then double-clicks the setup.exe to install the software. I need to find the path of the temporary folder the user extracted the files to. What is the simplest and safest way to do this? Currently, I am using a Filefind function that uses the GetFileLocation API to locate where the setup.exe is located. But this method could possibly fail if the user had already extracted the setup.exe in two or more folders that may in fact have only some of the program files in them. So again, my question is: How do I know what folder a user has double-clicked a file in?
0 Likes
490 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Just a suggestion but I abandoned all setup program creation after
discovering Inno Setup. There is also something called Acad Install that
works in conjunction with Inno which eases AutoCAD configuration changes.
You really should check it out.

Dale

wrote in message news:4840129@discussion.autodesk.com...
I am writing a setup program for some AutoCAD software I developed. The
software and setup program are packaged in a zip file that the user extracts
to a temporary folder for installation. The user then double-clicks the
setup.exe to install the software. I need to find the path of the temporary
folder the user extracted the files to. What is the simplest and safest way
to do this? Currently, I am using a Filefind function that uses the
GetFileLocation API to locate where the setup.exe is located. But this
method could possibly fail if the user had already extracted the setup.exe
in two or more folders that may in fact have only some of the program files
in them. So again, my question is: How do I know what folder a user has
double-clicked a file in?
0 Likes
Message 3 of 7

Anonymous
Not applicable
Dale,

Thanks for the tip. I will investigate.
0 Likes
Message 4 of 7

Anonymous
Not applicable
I have some sample scripts for Inno etc. that might make it easier to see
what's going on. Just let me know If your interested.


wrote in message news:4840571@discussion.autodesk.com...
Dale,

Thanks for the tip. I will investigate.
0 Likes
Message 5 of 7

GTVic
Advisor
Advisor
You may be able to access the path of setup.exe by looking at the command line parameters. The 0th parameter is usually the file executable and path. If you are writing in VB I don't know if it can access the 0th parameter but you can just use App.Path.

I'd also recommend using an application installer instead ... Autodesk uses the Tarma installer and it is only $99. Not free like the other suggestion but seems to be pretty good. Autodesk uses it for the DWFViewer setup program. http://www.tarma.com
0 Likes
Message 6 of 7

Anonymous
Not applicable
Hi Gordy,

I can confirm Dale's advice,

Be careful with the Inno Setup NGs. Many of the responders only know the
words;
"Read the help file"

The text below is an Inno Setup script I used for installing one of our
programs. I tried to post it as a file, but the file posting on the NG
still doesn't work for me.

Watch the word wrap as Inno Setup uses long lines
It should help you get started.

--


Laurie Comerford
CADApps
www.cadapps.com.au

; Trial Script to work with AcadInstall
; Prepared by Laurie 17 Oct 2002
;Lines for AcadInstall added as per it's help file

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Editing this file
; Step 1
; Do a search and replace for ..\iss\Program with the
; directory from which you are creating the install program
; Step 2

; Step 4
; Do a search and replace of "..\CADAppsLicensing" to the directory
; holding the VBA routines and the CADApps_Licence6.dll
; Step 5
; Save the ISS file with a relevant name
; Step 6
; Compile and test
; Step 7
; Fix any errors as required and go to Step 5

[Setup]
AppName=Batter Drafter
AppVerName=Batter Drafter L3.1
OutputBaseFileName=Batter Drafter L3_1 20030512 Install
AppPublisher=CADApps Australia Pty Ltd
AppPublisherURL=http://www.cadapps.com.au
AppSupportURL=http://www.cadapps.com.au
AppUpdatesURL=http://www.cadapps.com.au
DefaultDirName=c:\Program Files\CADApps
;;DefaultGroupName=3D Lines from Fieldbook
AllowNoIcons=yes
DisableStartupPrompt=Yes
DirExistsWarning=No
LicenseFile=CADApps Licence.txt
InfoBeforeFile=Message before.txt
;;InfoAfterFile=Message After.txt
;; Flags: recursesubdirs
[Messages]
;;ReadyLabel1=Laurie Message Setup is now ready to begin installing [name]
on your computer.
SelectDirDesc=Where should the Program Files be installed?
SelectDirLabel=Select the folder where you would like the Program Files to
be installed, then click Next. Note that the install path to be used shows
in the TOP dialog box

; The line below calls up the option to install the demo project. yet to
see how to actually do it.

[Files]

Source: "F:\VBAPrograms\CADApps_BatterDrafterL3.dvb"; DestDir:
"{app}\programs"; Flags: ignoreversion
Source: "..\Batter Drafter\Menus\*.mnl"; DestDir: "{app}\menus";
Source: "..\Batter Drafter\Menus\*.mns"; DestDir: "{app}\menus";
;; Install the VB runtime files

;; The vbrun60sp5 is the MS method of installing the runtime files
;; It means we do not need to muck about with the others
Source: "..\..\VB Runtime\vbrun60sp5.exe"; DestDir: "{tmp}"

;; Copy and register the CADApps Licence file
Source: "..\..\CA_Licensing\CADApps_Licence7.dll"; DestDir: "{sys}";
Flags: uninsneveruninstall sharedfile regserver
Source: "..\..\CA_Licensing\GMAv7.exe"; DestDir: "{app}\temp"

;; copies all BMPs for toolbar icons, copies all pallettes, copies
Plants.mdb to relevant AutoCAD paths
Source: "..\..\CA_Licensing\Menu update.exe"; DestDir: "{app}\temp"

; Write the installation directory to the registry
[Registry]
Root: HKCU; Subkey: "Software\VB and VBA Program Settings\CADApps\Batter
Drafter"; ValueType: string ; ValueName: "Installation Path" ; ValueData:
"{app}\Programs" ;Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\VB and VBA Program Settings\CADApps\Batter
Drafter"; ValueType: string ; ValueName: "Version" ; ValueData: "L3 1"
;Flags: uninsdeletekeyifempty

[Run]
; Waituntilidle ends up hiding the licence dialog box below the restart
; Nowait puts it on top of the restart as required
; GMAv7.exe gets the MAC address and using the Parameter returns the program
to file for licensing
;Filename: "{tmp}\vbrun60sp5.exe.exe" Description: "Install VB6 run time
files"; Flags: nowait
Filename: "{app}\temp\GMAv7.exe"; Parameters: "Batter Drafter" ;
Description: "Get licence"; Flags: nowait
; Filename: "{app}\temp\Menu update.exe"; Parameters: "{app}\Programs" ;
Description: "Update menus"; Flags: nowait


;
;[UninstallRun]
;Filename: "{app}\Temp\AcadInst.exe"; Parameters: -U
0 Likes
Message 7 of 7

Anonymous
Not applicable
Yes, of course, I've used App.Path before in one of my VB apps. I completely forgot about it.

Many thanks to everyone for their willingness to help me with this problem.
0 Likes