shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

Packaged app cache is not cleared by default (windows) #227

Closed dredknight closed 8 years ago

dredknight commented 8 years ago

Hello everyone,

The setting

Packaging an app into exe file one create a *.shy package file with Shoes 3.31. The name is chosen depending on the name of the folder your a packaging. In my case it is Skillwheel.shy.

The issue

Lets say I package version 1.0 of my APP. which has a square menu. It gets packaged. It works. A few days later I decide to improve the app add some stuff and change the design. I make the main menu be circular.

Version 1.1 of the app is now packaged into exe. Then I go execute that exe and .... I see the old 1.0 app version. If I get the exe file sent to a new Windows system (no shoes installed) and run the exe I see the v. 1.1 of the app!

Solution

I found out that when you execute an exe file the SHY file gets cached in the APP DATA folder.

C:\Users\AppData\Local\Temp\skillwheel.shy

When I delete the file manually I can successfully open another exe file of other programmes and see them as they are :). Beforehand No matter what shoes EXE files I run I always see the cached *SHY file output

ccoupe commented 8 years ago

Another choice would be to create a shy with a different name, skillwheel-0.shy, skillwheel-1.shy ....

The cached files in AppData\Local\Temp are not alway cleaned out or copied over. This may not be fixable because the purpose of packaging is to Install Shoes and then the shy. IFF they don't exist.

To test a newer exe on a system that has Shoes : Uninstall Shoes first. Or just copy the shy (any where) and open it with the Shoes front page "Open an App" or from the command line $ shoes.exe \path\to\mynew.shy or even better cshoe.exe \path\to\shy

Shoes 3.3.1 will provide the support for a different type of windows package - see https://github.com/Shoes3/exe-shoes (readme.md is not current). It's a lot more work for the developer but gives them all the control they could want.

dredknight commented 8 years ago

Thanks @ccoupe! I will try with different shy names.

When I get better in Shoes I will jump into packager. :)

ccoupe commented 8 years ago

There's one more issue to beware of with 3.3.1 beta. I think I mentioned it on the blog. Don't use it for packaging because it will use 3.3.0 for the packaged app. That's going to end badly if it gets mixed with 3.3.1 on the same system.

dredknight commented 8 years ago

I think I just hit such issue. When I make a default package it is working. But when I add "Extra functionality" and all I do is add icons then the EXE is not working.

The following error pops up:

Error in line 0 | 2016-03-20 18:34:37 +0200 No such file or directory @ rb_sysopen - C:/Users/DREDKN~1/AppData/Local/Temp/shoes-skillwheelv30-custom.4264/UsersdredknightDesktop killwheelv30.shy skillwheelv30-install.rb:15:in initialize' skillwheelv30-install.rb:15:inopen' skillwheelv30-install.rb:15:in block in <main>' eval:1:ininstance_eval' eval:1:in block in <main>' -e:1:incall'

Where the original path is -> C:/Users/DREDKN~1/AppData/Local/Temp/shoes-skillwheelv30-custom.4264/Skillwheelv30.shy

But somehow the S get substituted with "UsersdredknightDesktop "

ccoupe commented 8 years ago

I applaud your willingness to test that code. https://github.com/Shoes3/shoes3/wiki/Custom-Install-Scripts.

There is are several ways to tell the packager to download from the beta locations. The easy way is from the Maintain Shoes -> Package URLs Just change shoes.mvmanila.com to walkabout.mvmanila.com and update . Then you need to trigger a download to replace the cached 3.3.0 exe. Remove Appdata\Local\Shoes\walkabout\package* Then attempt to package and it should download from the beta site.

I find it much easier to use https://github.com/Shoes3/shoes3/wiki/Command-line-packager but you have to get get a Shoe 3.3.1 exe in that appdata\local\shoes\walkabout\package.

ccoupe commented 8 years ago

There's also something about /DREDKN~1/ that cause me some concern, Ruby may not expand that. Depends on ruby version and whether that is a mounted drive.

UsersdredknightDesktop killwheelv30.shy

It looks like there is a space where there should be a / and and serveral missing /.

dredknight commented 8 years ago

@ccoupe I just tried to update the repository. Then click update. After that when I refresh the Package URLs page they get reverted back to the old ones.

When I update the DL link I see a URL link shortcut being created in the packager folder but it is not used by the packager at any way.

P.S. Iwill try with command line

dredknight commented 8 years ago

I tried the CMD packager. SHY file was successfully built!

But the packager itself gave error

Error in <unknown> line 0 | 2016-03-22 23:23:41 +0200
uninitialized constant PackShoes

pack.rb:18:in `<main>'
C:/Program Files (x86)/Shoes/lib/shoes.rb:500:in `eval'
C:/Program Files (x86)/Shoes/lib/shoes.rb:500:in `visit'
eval:1:in <main>'

Here is what I did

cshoes.exe --ruby pack.rb

Here is the code

opts = {}
opts['app'] = 'E:/shy/skillwheel31.shy'
opts['advopts'] =  false
opts['expandshy'] = true
#opts['custominstaller'] = '/full/path/to/my/install_script.rb'
opts['installer-icon'] = '/home/ccoupe/Projects/shoes3/static/shoes-icon-federal
es.png'
opts['png'] = 'E:/Dropbox/Ruby/icons/icon.png'
opts['ico'] = 'E:/Dropbox/Ruby/icons/icon.ico'
#opts['icns'] = '/home/ccoupe/Projects/icons/ytm/ytm.icns'
#opts['gempack'] = '/home/ccoupe/Projects/gems/gempacks/kevin.tar.gz'
opts['arch'] = 'win32' # win32 armhf x86_64 i686 or osx
opts['dnlhost'] = 'walkabout.mvmanila.com'  # no http://
opts['dnlpath'] = "/public/select/#{opts['arch']}.rb"
opts['shoesdist'] = "C:/Users/dredknight/AppData/Local/Shoes/package/shoes-3.3.1-gtk3-32.exe"
opts['packtmp'] = 'E:/tmp/.shoes'
opts['relname'] = 'walkabout'
PackShoes.repack_exe opts
ccoupe commented 8 years ago

Missing line 1:

require 'shoes/packshoes'

Also you don't want my linux path to opts['installer-icon']

ccoupe commented 8 years ago

The wiki has been corrected to include require 'shoes/packshoes' My error. Thanks for reporting the bug.

dredknight commented 8 years ago

All right. I packed (as skillwheel31.shy so it wont overlap with the old one) and send it to other people but the result is the same. I will ask them to play with windows 10 UAC and let you know if there is any effect.

No change the windows 8 error is this one http://oi66.tinypic.com/awnlk.jpg.

It seems it is not UAC.

dredknight commented 8 years ago

I got update!

I asked the person with Windows 8 issue to install the 3.3.1 shoes separately and then to run the exe file.

It worked like a charm.

ccoupe commented 8 years ago

That approach - install Shoes first - works on Win 10 too. The problem is a packaged app tries to install Shoes if it doesn't exist by copying a resource of of the app.exe and then install those files into Common Files (x86) without enough authorization from the user . However, Win 10 thinks that's something a virus would do (arguable it is).

dredknight commented 8 years ago

Alright. I am closing this one. If I have any news I will write in #196 thread!