Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Migrating from Installscript to Basic MSI


15 replies to this topic

ruffasdagut

ruffasdagut
  • Full Members
  • 3 posts

Posted 18 June 2007 - 20:54

I have a product, a windows service which has the ability to self upgrade. Currently it downloads an installscript setup.exe. When launched the setup.exe stops the service lays down the files and starts the service back up. While this scheme works I have run into some issues where the installscript crashes and leaves my service turned off.

I have been experimenting with a basic msi project and found their rollback and built in service features very interesting, and a possible fix to the crashing installer leaving our service off, but I haven't been able to figure out a clean way to migrate from installscript to msi. Ideally our service needs to be able to download the new msi. Then the msi needs to remove the installscript install and install itself.

I currently have both the old installscript, and a replacement msi built, but when I run the msi when the installscript is already installed as expected I get two instances of my product in add/remove programs.

Any advice would be greatly appreciated.

Thanks
Phil


Christoph

Christoph
  • Full Members
  • 81 posts

Posted 27 June 2007 - 13:56

I've done the migration myself a long time ago and with my experience I can tell you that most of the time you need to define the basic msi project completely from scratch again.

However, you can reuse some of your (complex) installscript code within custom actions(test on exit code!).

Success!!!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 June 2007 - 14:43

The MSI setups knows nothing about the InstalLScript setup, they are two separate worlds, so there's no automatic uninstall, as you have already found out. So you would have to add a custom action to your MSI setup that runs the uninstall command for the InstallScript setup.

ruffasdagut

ruffasdagut
  • Full Members
  • 3 posts

Posted 27 June 2007 - 15:07

Thanks for the updates. Using a custom action is where I was headed as well. I have been researching them and is it better to use a vbscript or to put a function in my c++ exe to do the uninstall? I have been reading online and there seems to be some division as to whether vb/j scripts are safe to use in custom actions.

Thanks
Phil

Christoph

Christoph
  • Full Members
  • 81 posts

Posted 27 June 2007 - 15:09

Any reasons why you aren't considering Installscript Custom Actions?
Like to use them the most.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 June 2007 - 15:16

Actually I think you would call the InstallScript setup's setup.exe to uninstall so in this case the custom action type would be EXE.

ruffasdagut

ruffasdagut
  • Full Members
  • 3 posts

Posted 27 June 2007 - 15:18

No I am open to any solution. I just need it to to be reliable one.

This installer has to run and do its work in a totally unattended fashion. I was just fishing for advice on what other people have used. While I test the different options.

fredrik.strom

fredrik.strom
  • Full Members
  • 39 posts

Posted 12 July 2007 - 13:18

QUOTE (Stefan Krueger @ 2007-06-27 15:16)
Actually I think you would call the InstallScript setup's setup.exe to uninstall so in this case the custom action type would be EXE.

How exactly is this done? And were in the sequence should i put the call?


Regards F

Edited by fredrik.strom, 12 July 2007 - 13:25.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 July 2007 - 13:23

I would probably put the custom action near the RemoveExistingProducts standard action which basically does the same for MSI setups.

fredrik.strom

fredrik.strom
  • Full Members
  • 39 posts

Posted 16 July 2007 - 09:06

ok, thx for the input.

Can i use a property as an argument to an CustomAction for the
Filename&CommandLine argument?

I have the uninstall path and arguments in the registry and have found it using a system search...


The registry entry looks like
C:\WINDOWS\ISUNINST.EXE -a -f"C:\Program Files\My Prodduct\Uninst.isu" -c"C:\Program Files\Common Files\My Shared\biaunst.dll"

But only C:\WINDOWS\ISUNINST.EXE is retrieved from the system search into the defined property. Is this a known behaviour?

Edited by fredrik.strom, 16 July 2007 - 09:20.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 July 2007 - 09:31

QUOTE
Can i use a property as an argument to an CustomAction for the
Filename&CommandLine argument?

Yes, custom action type 50. But you will need to split the command line parameters from the exe.
QUOTE
But only C:\WINDOWS\ISUNINST.EXE is retrieved from the system search into the defined property. Is this a known behaviour?

No. Did you select "raw" as type of registry data?

fredrik.strom

fredrik.strom
  • Full Members
  • 39 posts

Posted 16 July 2007 - 10:12

Ok, thx again.

I think i was using "filepath as specified by a registy entry", when i changed to just "registry entry" i get the data.





Regards F

Edited by fredrik.strom, 16 July 2007 - 11:42.


fredrik.strom

fredrik.strom
  • Full Members
  • 39 posts

Posted 16 July 2007 - 11:43

OK, i see the problem now, can I use a proprty for the command line as well?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 July 2007 - 11:46

Yes you can.

fredrik.strom

fredrik.strom
  • Full Members
  • 39 posts

Posted 16 July 2007 - 12:38

Thx for the help, now it works like a charm. It is totally silent during the uninstall though. Is it possible to send information to the status bar, during the uninstall?


Is it a bad idea to put Custom Actions in the UI sequence?
/F

Edited by fredrik.strom, 16 July 2007 - 13:23.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 July 2007 - 17:43

I think it shouldn't be silent by default. Does it have a progress bar when you uninstall from Add/Remove Programs control panel?

This KB article may also be useful:
INFO: What Command Line Parameters Are Available for IsUninst.exe?

QUOTE
Is it a bad idea to put Custom Actions in the UI sequence?
You can have custom actions in the UI sequence but you shouldn't modify the target system in the UI sequence.