Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 6:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Save user images in single file
PostPosted: April 16th, 2012, 3:45 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Hi
I have an app that allows users to introduce their own images as part of creating an activity. At the moment, the location of each file is logged when the user saves their activity so that they can be found when the activity is opened again. The problem is that when activities are shared, users have to mess around getting the individual images in place on each new PC. I would really like to be able to package images up with some other data when the user saves the file (as any MS Office app can, for example). The app would need to be able to unpack and locate the images again once run elsewhere. Has anyone used a dll or other solution for this?
Thanks
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Save user images in single file
PostPosted: April 16th, 2012, 10:59 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
With zip functionality built into Windows, you could use any number of methods to zip / unzip files for packaging. VBS/ PowerShell or even create a DLL for this purpose. Or if you can find an open source zip engine, just pass the parameters from Opus.

Loads of examples on the web: such as:

http://serverfault.com/questions/18872/ ... 604#201604

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Save user images in single file
PostPosted: April 16th, 2012, 12:41 pm 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Thanks Mack - I'd forgotten windows had a built-in zip function (I still tend to use winzip). The other issue I'll then try and solve is unpacking and opening the activity by clicking on the file. Anyway, this development will have to sit on the boiler for a while.
Cheers for your help.
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Save user images in single file
PostPosted: January 24th, 2013, 8:40 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
OK, this did indeed sit on the boiler for a while. Just picked it up again the other day, so if anyone needs a possible solution for this then...

- I used 7zip to package the data file along with the images required. You can strip 7zip down to the files 7z.exe and 7z.dll if working with commands. There is supposed to be a single 7za file that works standalone, but I haven't found a trustworthy source for it yet.

- There seemed to be an issue with the parameters sent from opus when using LaunchFile. A couple of file paths for the images I wanted packaging could be sent out, but it failed when sending more (than about 5). I got round this by instead writing the 7zip command to a bat file then getting Opus to run this.

- Either way, there was a problem with the command window flashing open when running the 7zip app from inside Opus. I tried all the recommended switches without success. In the end, I got opus to create a vbs file which then ran the batch file invisibly. I should be able to cut out the batch file step and get the vbs to run 7zip.


//Create vbs file
var vbsFile = FilePathDataFiles + "zs.vbs"
var textObj = OpenFile(vbsFile ,true);
textObj.WriteLine("Set WshShell = CreateObject(\"WScript.Shell\")",false)
textObj.WriteLine("WshShell.Run chr(34) & \"" + FileToRun + "\" & Chr(34), 0",false)
textObj.WriteLine("Set WshShell = Nothing",false)
textObj.Close()

LaunchFile(vbsFile)


I then rename the zip file as example.wwi (the file extension I use).

Using a Windows solution may be tidier, but once I'd started down this path I just kept going. I may look for an alternative in the future.

I now have to find a way that clicking on this file encourages Opus to first unpack it then look at the contents, but I've no idea how to get started with this at the moment.

Cheers
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Save user images in single file
PostPosted: January 26th, 2013, 11:33 pm 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Hi

Anyone (Mack?) any idea of how launching a non-Opus file can result in Opus looking at it? My pub now saves files containing data and images. I want users to be able to double click on a file and for Opus to open my pub and know which file was clicked on. I have associated the file type with my pub exe but get a 'Cannot find publication file!!" error. If Opus can't do this, perhaps I need a third party prog (vbs) to write something to the registry then launch to Opus. This is assuming that the other prog can do what Opus can't do and recognise the file opened, and can write to the dw section of the registry. Any thoughts would be appreciated before I go too far down the wrong path.

Thanks
Dan

PS. I got Opus to write the vb to launch 7zip without the command window opening, but both Opus and vb required escape chars, hence the ""\"\"\\"\"\"\"...


var vbsFile = FilePathDataFiles + "Temp\\zs.vbs"
var textObj = OpenFile(vbsFile ,true);
textObj.WriteLine("Set WshShell = CreateObject(\"WScript.Shell\")",false)
textObj.WriteLine("WshShell.Run \"\"\"" + ZipApp + "\"\" a \"\"" + ZipFile + "\"\" \"\"" + ZipParams +"\", 0 ",false)
textObj.WriteLine("Set WshShell = Nothing",false)
textObj.Close()

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Save user images in single file
PostPosted: January 27th, 2013, 1:35 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
If I understand correctly, then yes you can do this - but it's been a few years and I can't recall which application I built it into. It maybe stored somewhere - if I get a chance I'll did around if you cannot get it to work.

But from what I remember, I used Advanced Installer to register the file type in such a way that the 'data' files created by my Opus application would open that application on double click and pass the file name of the 'data' file into Opus command line parameters. The Opus application then used this to read the file contents.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 79 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group