PDA

View Full Version : Installation Path



bagofgloom
02-27-2013, 10:51 AM
Currently our application is uninstalled and reinstalled every time a new version is sent out. This is done by checking to see if a previous version is installed.

Is there a way to determine where the user installed the application?

Currently I am using the SetupBuilder variable %_SB_INSTALLDIR% to determine where the applications uninstall is.

This only works if the user didn't change the install directory.

In our case the default install path is going to change because our companies name is changing.

If the previous install directory is C:\Program Files\Company Name\Product and it will be changed to C:\Program Files\Company\Product. %_SB_INSTALLDIR% for the uninstall does not work because the path is incorrect.

linder
02-27-2013, 11:33 AM
Hello,

Yes, no problem. You have several different options. I would suggest to use the "Detect Previous Version..." script function.

The "Detect Previous Version" function lets you detect the path of a previously distributed version of your product. This function even lets you retrieve the full uninstall string (if available) and the installed version number (if available).

Does this help?

Friedrich

bagofgloom
02-27-2013, 12:06 PM
Yes. That is exactly what I am looking for. Thanks.

bagofgloom
02-27-2013, 02:16 PM
On a side not how do I change the Author? I have removed the Technologies from the end of the company name but the MSI Summary Information Stream still has Technologies at the end of the Author.

bagofgloom
02-27-2013, 03:27 PM
Using Detect Previous Version... appeared to work but after further inspection it left everything in the old folder except for the uninstall exe. This has never happened before. Usually it does a great job of uninstalling everything in the folder and deleting it. Not sure what I did wrong. Here is a screen shot of how I have run program setup and Detect Previous Version....

linder
02-28-2013, 01:04 AM
Hello,

Not sure where you call the above and what the runtime values are.

But to uninstall a previous version from an install, you can do something like the following (see attached screenshot).

Friedrich

linder
02-28-2013, 01:09 AM
Hello,

"MSI Summary Information Stream" is not used in .EXE projects.

Friedrich

bagofgloom
02-28-2013, 02:17 PM
The uninstall runs right after they have answered all of the dialog boxes.

I don't use %_SB_INSTALLDIR% because I am wanting to install the application in a totally different directory. That is why I use %PREVIOUSVERSION% as my uninstall directory. I changed the name of the variable to something that made more sense %PREV_INSTALLDIR%. I don't have a variable called %_SB_TMP%.

I have attached an image that shows the steps I take to uninstall the application.

Thanks

bagofgloom
02-28-2013, 05:15 PM
I also tried using the Run Command Line. Same issue. Everything is left behind except for the uninstaller exe. I have verified the path is correct however I am not sure why nothing is getting uninstalled. Here is how I have the Run Command Line setup.

linder
03-01-2013, 12:34 AM
Hello,

Do you have a custom uninstall? What happens when you run the uninstall.exe from the Windows Command Line?

The uninstall removes all items that are in your uninstall .log. So you 1) have a bug in your custom uninstall code (if you have a custom uninstall) -or- 2) you launch the wrong uninstall .log from your uninstall.exe. It's 1) or 2) <g>.

Friedrich

linder
03-01-2013, 12:37 AM
BTW, and it's also possible that you have BACKUP files in place (perhaps from a test install)? In this case, the uninstall removes the original files and restores the backup files.

Backup log file items look like this:

|019|C:\yada\BACKUP\yada.0001

And make sure that your install writes the install file(s) action to the uninstall.log. You can open the uninstall .log with an ASCII text editor to check this.

Friedrich

bagofgloom
03-01-2013, 02:14 PM
We do not have a custom uninstall. The issue was with the log file. The wrong one was being used. Thanks.

The uninstall now removes everything in the folders but is not removing the application folder in Program Files. When I uninstall from the All Programs Menu that removes the application folder. When I run the command from a command line prompt the application folder is not removed.

Is there any additional command line switches that I should be using?

linder
03-02-2013, 03:20 AM
I assume that the folder is simply "locked" when you run the uninstall from the Windows command line prompt. In this case, Windows set the default Windows folder to your application folder under the Program Files folder tree and so it gives an access denied error (because your command line prompt "locks" the directory).

This is not related to SetupBuilder; it's a simple access denied error and the program itself can't do anything.

Friedrich

linder
03-02-2013, 03:47 AM
Hi,

I have developed and uploaded a simple quick and dirty demo for you.

http://www.lindersoft.com/projects/UninstallDemo.zip

Compile it and run UninstallDemo.exe. This will install one "dummy" sb7.htm file into the "UninstallDemo" folder under the "Program Files" folder tree. Then run UninstallDemo.exe again. This time it will detect your previously installed application and offers an uninstall. The uninstall will remove the file and its own subfolder.

Friedrich

bagofgloom
03-20-2013, 08:07 PM
Sorry I have been out of town. The script you supplied worked perfectly. However I still cannot figure out why mine is not removing the folders. It looks identical to yours. I must be doing something wrong. I can send you my script if you would like to take a look at it.

bagofgloom
04-02-2013, 01:52 AM
I am getting ready to release a new install this week so any help would be appreciated.

linder
04-02-2013, 02:03 AM
Hello,

There is no bug in SetupBuilder that causes this issue so I don't have any further suggestion, sorry. What you can do is to contact our Consulting to check if they can review your project script and to try to find out what you are doing wrong. Unfortunately, this is a paid service :(.

Friedrich

linder
04-02-2013, 02:25 AM
One quick idea. Perhaps Windows has set the current directory to your application folder and this locks the directory in your case. Try to use "Call DLL..." to execute the SetCurrentDirectory Windows API and set the current directory to another folder.

Friedrich