This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Checking for a file in destination folder
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 23, 2007
11:55 PM
Checking for a file in destination folder
Hi,
This will be the first version of our product that is being released with InstallShield as the installer. Between that and significant changes to the software, we want to prevent the user from installing to a folder containing an old version of the software.
Anyone have any ideas on how I could achieve this? I can write installscript easy enough to decide whether or not the INSTALLDIR path variable contains an old executable, however I can't work out how to actually use that in my sequence.
Any help would be most appreciated!
Regards,
Ben
This will be the first version of our product that is being released with InstallShield as the installer. Between that and significant changes to the software, we want to prevent the user from installing to a folder containing an old version of the software.
Anyone have any ideas on how I could achieve this? I can write installscript easy enough to decide whether or not the INSTALLDIR path variable contains an old executable, however I can't work out how to actually use that in my sequence.
Any help would be most appreciated!
Regards,
Ben
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 24, 2007
12:03 PM
For Installscript, you can do it by creating a check for the existing app using SdAskDestPath() in your OnFirstUIBefore() event.
See the SdAskDestPath and SdAskDestPath2 examples in the InstallScript language reference.
Pseudocode would go something like this:
svDir = c:\\somepath
SdAskDestPath (TITLE_TEXT, "", svDir, 0)
while svDir contains yourapp.exe
endwhile
INSTALLDIR = svDir
Of course, this doesn't include error checking or checking for next/back/cancel buttons, but you get the idea.
See the SdAskDestPath and SdAskDestPath2 examples in the InstallScript language reference.
Pseudocode would go something like this:
svDir = c:\\somepath
SdAskDestPath (TITLE_TEXT, "", svDir, 0)
while svDir contains yourapp.exe
Display error "Cannot overwrite existing installed app"
SdAskDestPath (TITLE_TEXT, "", svDir, 0)
SdAskDestPath (TITLE_TEXT, "", svDir, 0)
endwhile
INSTALLDIR = svDir
Of course, this doesn't include error checking or checking for next/back/cancel buttons, but you get the idea.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 24, 2007
07:27 PM
Would I need to have a completely "Installscript" install? At the moment I have a Basic MSI.