Updates How to create them?

This forum has been archived and is no longer active.

The new forum is located at:

https://sourceforge.net/apps/phpbb/installjammer/

You may continue to view and search the topics in this forum, but no new posts can be created.

Updates How to create them?

Postby JohnDoe » Fri Sep 09, 2011 7:43 am

So I've read through viewtopic.php?f=5&t=1988&p=10326&hilit=update#p10326 and I still can't really figure it out. I do admit that I'm kinda slow today, because I've had a... tiring evening yesterday, but still...

I added Add Install Info at the end of my installation.

The next install version /changed both: Install version and Version String/ one was fixed with Check for Previous Install action /the action was added somewhere on the Select destination screen, since it didn't work I moved it to the welcome screen /I imagine the installer will remember the data anyways/

I've changed the destination folder to <%PreviousInstallDir%> ... so what did I miss? Or is there a more detailed tutorial on this matter? Any kind of help /except "JFGI"/ will be appreciated...

Thank you very much
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby JohnDoe » Mon Sep 12, 2011 2:09 am

To add more data:

I tried testing the install with the consloe window open:
09/12/2011 10:06:43AM - Executing actions 775D9C37-A867-4A55-AD43-38D31C7C786E - Welcome Screen - Before Pane is Displayed
09/12/2011 10:06:43AM - Displaying pane 775D9C37-A867-4A55-AD43-38D31C7C786E - Welcome Screen
09/12/2011 10:06:43AM - Executing actions 775D9C37-A867-4A55-AD43-38D31C7C786E - Welcome Screen - After Pane is Displayed
09/12/2011 10:06:43AM - Executing action 05F628E7-1859-460B-998E-7042BCD84C8B - Check for Previous Install
09/12/2011 10:06:43AM - Checking conditions for 673687DD-592B-4327-B383-CEFF7EBCB48B - Get Previous Install Info - Before Action is Executed
09/12/2011 10:06:43AM - Checking condition 73452870-851F-4864-94DC-C51EE12D6A13 - Virtual Text Test Condition
09/12/2011 10:06:43AM - Checking to see if virtual text 0 exists
09/12/2011 10:06:43AM - Condition failed
09/12/2011 10:06:43AM - Skipping action 673687DD-592B-4327-B383-CEFF7EBCB48B - Get Previous Install Info - conditions failed

It is rather obvious that the installer doesn't know that there is a previous version installed. Hint anyone? As said I might have overlooked something rather easily, so hints and advice are highly appreciated.
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby JohnDoe » Mon Sep 12, 2011 2:40 am

Ok I have probably narrowed my problem down by now. The installer doesn't recover the original installation folder. But If I added one more check /virtualtext test whether a previous installation exists/ the testApp was promptly installed to C:\Program Files\InstallJammer what, as you might have guessed IS NOT the installation directory of my testApp...

And yes if I set the path "C:\targetRootDir\testAppInstallationDir\" the application installs / updates normally. The problem kinda is I don't want that to happen.

I wish to ask the user for a destionation on fresh installation / new copy and work automatically when there is an update.

An even funnier update: When I deleted the IJ registry the testApp installed as an update and you may guess where... "C:\Program files\InstallJammer"
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby JohnDoe » Mon Sep 12, 2011 3:02 am

If this was only for fun, I'd be slightly amused by this. however since I'm at work I'd very much appreciate if stuff like this wouldn't happen at all. This happened after uninstalling the testApp,deleting Temp and deleting the registry dir.

Error in action ExecuteAction

Error in action InstallUninstaller

error copying "C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164-3959FA587A95/installkit.exe" to "C:/Program Files/InstallJammer/.../uninstall.exe": no such file or directory
while executing
"file copy -force $installkit(stubfile) $installkit(executable)"
(procedure "::installkit::wrap" line 26)
invoked from within
"::installkit::wrap -o {C:/Program Files/InstallJammer/.../uninstall.exe} -w C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164-3959FA587A95/..."
("eval" body line 1)
invoked from within
"eval ::installkit::wrap $args"
(procedure "::InstallJammer::Wrap" line 16)
invoked from within
"::InstallJammer::Wrap -noinstall -o {C:/Program Files/InstallJammer/.../uninstall.exe} -w C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164..."
("eval" body line 1)
invoked from within
"eval ::InstallJammer::Wrap $opts [list $main $uninstall]"
(procedure "::InstallJammer::actions::InstallUninstaller" line 89)
invoked from within
"::InstallJammer::actions::$component $this"
while executing
"$obj execute"
(procedure "::InstallJammer::ExecuteActions" line 69)
invoked from within
"::InstallJammer::ExecuteActions $action -parent $id -conditions $eval"
(procedure "::InstallJammer::actions::ExecuteAction" line 35)
invoked from within
"::InstallJammer::actions::$component $this"
Error in action ExecuteAction

Error in action InstallUninstaller

error copying "C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164-3959FA587A95/installkit.exe" to "C:/Program Files/InstallJammer/.../uninstall.exe": no such file or directory
while executing
"file copy -force $installkit(stubfile) $installkit(executable)"
(procedure "::installkit::wrap" line 26)
invoked from within
"::installkit::wrap -o {C:/Program Files/InstallJammer/.../uninstall.exe} -w C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164-3959FA587A95/..."
("eval" body line 1)
invoked from within
"eval ::installkit::wrap $args"
(procedure "::InstallJammer::Wrap" line 16)
invoked from within
"::InstallJammer::Wrap -noinstall -o {C:/Program Files/InstallJammer/.../uninstall.exe} -w C:/DOCUME~1/user/LOCALS~1/Temp/ijtmp_3773DB7E-AE95-42C0-B164..."
("eval" body line 1)
invoked from within
"eval ::InstallJammer::Wrap $opts [list $main $uninstall]"
(procedure "::InstallJammer::actions::InstallUninstaller" line 89)
invoked from within
"::InstallJammer::actions::$component $this"
while executing
"$obj execute"
(procedure "::InstallJammer::ExecuteActions" line 69)
invoked from within
"::InstallJammer::ExecuteActions $action -parent $id -conditions $eval"
(procedure "::InstallJammer::actions::ExecuteAction" line 35)
invoked from within
"::InstallJammer::actions::$component $this"
while executing
"$obj execute"
(procedure "::InstallJammer::ExecuteActions" line 69)
invoked from within
"::InstallJammer::ExecuteActions $id -when $when"
(procedure "::InstallJammer::RaiseEventHandler" line 93)
invoked from within
"::InstallJammer::RaiseEventHandler .wizard"
(command bound to event)
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby JohnDoe » Mon Sep 12, 2011 4:51 am

Now I have reverted everything I changed, but the setup is still corrupt. Is there any other place /except windows registry/ that I should look to to be able to _delete_ the data that isn't even supposed to exist...?

Edit: Changed Platform Information/Windows/Default Install Mode : to standard. Now the setup doesn't throw and error. It just freezes at the install path setting screen. Console window freezes as well so no reliable bug report for now.
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby JohnDoe » Mon Sep 12, 2011 7:28 am

Since there are no replies, and the help file is strangely confusing /reminds me of one or two college books.../ I guess I'll try to write a real step-by-step walkthrough once I get the hang of it /that is IF i get a hang of it/.
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby hsehdar » Mon Sep 12, 2011 7:02 pm

I did not read all the updates posted. Just posting what I understood from subject and certain replies.

ApplicationID is always constant. The InstallID is not constant. For one ApplicationID there can be more than one InstallID if installed multiple times.

IJ registers each InstallID into local registry after installing the application. So the same application installed more than once will have couple of registries. This register is found in C:\Program Files\InstallJammer Registry directory. While updating there is no need to register.

Step1:
IJ can be commanded not to write into registry. How to do it by adding action Set Virtual Text as shown in the image.

[img]Set_InstallRegistry_To_No.png[/img]

Step2:
Now there is a need to fetch the InstallID of the using the ApplicationID. There is not ready action for this. Hence this script. Add action Execute Script with below script and capture the Result Virtual Text (say MyPreviousInstallID).

Code: Select all
set appid <%ApplicationID%>

set ids [::InstallAPI::ReadInstallInfo -array a -applicationid $appid]

foreach id $ids {
    puts "InstallID = $id"
    return $id
}

The resultant virtual text will have the corresponding InstallID.

Step3:
Now to get the installation paths from previous installation add action Get Previous Install Info with following Advanced Properties

Application ID: <%ApplicationID%>
Install ID: <%MyPreviousInstallID%>
Virtual Text Prefix: PreviousInstall

That is it. Get all the previous install information. Hope this helps. Need be come back.
Attachments
Set_InstallRegistry_To_No.png
Action - Set Virtual Text
Set_InstallRegistry_To_No.png (42.28 KiB) Viewed 19824 times
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: Updates How to create them?

Postby JohnDoe » Tue Sep 13, 2011 8:44 am

It did help a bit, thank you very much... Not all my problems have been solved for now, but I'm guessing I'll fix it after I have learned the TCL... not that there is much of a choice :D

What I need from the setup:
Fresh Install, after copying run 2 jar files in a sequence - wait for each to finish.

Update: {Never overwrite files}, {Always overwrite files}, and the last group is {Overwrite depends on version x date}...

For convenience: Determine whether there is a previous version and TargetDir:= Previous TargetDir

And log everything of course :)
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Re: Updates How to create them?

Postby hsehdar » Tue Sep 13, 2011 7:36 pm

Previous reply may not be clear. So here is one logic/idea which works with IJ.

Have two projects in IJ
1. Installer
2. Upgrade

These both have unique Application ID(s). Steps to follow


1. Open Installer project go to Startup Actions group add action Check for Previous Install
2. In Startup Actions group add action Get Previous Install Info with Advanced Properties
Application ID: <%ApplicatonID%>
Install ID: <%PreviousInstallID%>
Virtual Text Prefix: PreviousInstall
3. In Install Actions group add first action as Execute External Program with condition string <%PreviousInstallExists%> is TRUE and in the advanced properties set Program Command Line: "<%PreviousInstallUninstaller%>" /mode silent
Until here what is done - check previous installation and uninstallation before installing. This will enforce single installation of application.
4. In the Installer project go to Application Information on left pane
5. Expand Application Information on right pane
6. Copy the Application ID displayed
7. Save and close the project
8. Open the Upgrade project expand Application Information and paste in Upgrade Application ID - this is from Installer
9. Add action Set Virtual Text to Startup Actions group with Advanced Properties
Auto Update: Yes
Language: None
Substitute Value: Yes
Value: No
Virtual Text: InstallRegistryInfo
10. Add action Execute Script with below script and capture the Result Virtual Text (say MyPreviousInstallID).
Code: Select all
set appid <%UpgradeApplicationID%>
set ids [::InstallAPI::ReadInstallInfo -array a -applicationid $appid]
foreach id $ids {
    puts "InstallID = $id"
    return $id
}

11. Add action Get Previous Install Info with following Advanced Properties
Application ID: <%ApplicationID%>
Install ID: <%MyPreviousInstallID%>
Virtual Text Prefix: PreviousInstall
12. Add next action Set Virtual Text
Auto Update: Yes
Language: None
Substitute Value: Yes
Value: <%PreviousInstallDir%>
Virtual Text: InstallDir

From step 8 - set IJ not register Upgrade into its registry, get previous install information for upgrading and change InstallDir to previous install directory.

Coming back to the question. Answer is simple. Use action Execute External Program with advanced properties set
Program Command Line: java -jar /path/jarFileName.jar
Status Virtual Text: jarExecutionStatus
Result Virtual Text: jarExecutionResults
Similarly add next action with condition string <%jarExecutionStatus%> is TRUE. So this gets executed only when the first jar file was executed successfully.

Hope jar file execution returns status to operating system and hence to IJ. If not returning then use jarExecutionResults to get output. In this case add action Execute Script with below script
set jarExeResults <%jarExecutionResults%>
if { [string match -nocase [concat \*FAILED\*] $jarExeResults] } {
##In the string jarExeResults word FAILED found hence returning status as 0
return 0
}
##In the string jarExeResults word FAILED was not found hence returning status as 1
return 1

Hope both problems are solved.
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: Updates How to create them?

Postby JohnDoe » Fri Sep 16, 2011 1:37 am

hsedar> Thank you very much, it really did help me quite a lot. Although I seem to be having difficulties with creating a rollback. Actions are set, but for some strange reason the "Cancel group" doesn't execute at all. Anyone have any ideas on why?

Edit: Mind you I'm not really talking about the installer rollback feature /not sure whether and how it works with my current settings /... For now: I use xcopy to back-up the whole target folder /since the app is round 108-130MB it's not that critical/ and I want the installer to restore files from the backup folder on Cancel
JohnDoe
 
Posts: 10
Joined: Fri Sep 09, 2011 7:32 am

Next

Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron