Randem Systems Support Board

InnoScript => InnoScript - General Questions, Report Bugs, Problems etc... => Topic started by: spick56 on June 02, 2008, 10:01:53 PM

Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 02, 2008, 10:01:53 PM
Hi,  
Sorry for being a 'bit' thick but I'm a 'bit' stuck. ;-)  
When I generate the script I get the following result (please note that I've removed some lines to reduce this post's size):  
 
[Tasks]  
Name: CRInstallation; Description: Install Crystal Reports Runtime Files; GroupDescription: Install CR Runtime Files:
Name: DotNetFrameWork; Description: Install .Net Framework; GroupDescription: Install .Net Framework:; Check: InstallDotNET20
.....  
 
[Run]  
Filename: msiexec.exe; Parameters: /package {tmp}CRX_NET_Redistribution.msi /passive; WorkingDir: {tmp}; Flags: skipifdoesntexist; Tasks: CRInstallation
Filename: {tmp}dotnetfx.exe; Parameters: /q:a /c: install /l /q; WorkingDir: {tmp}; Flags: skipifdoesntexist; Tasks: DotNetFrameWork
.....  
 
[Code]  
// To implement these calls they should be used in the Run Section on the line that runs the dotnetfx.exe  
// file. To use add to the line Check: InstallDotNET20  
.....
 
Question  
1) The comment in the [Code] section suggests that I should modify the line in [Run] section but from what I can see that is taken care of by the line in [Task] section therefore should I leave things as shown?  
2) I assume the line in [Tasks] will call InstallDotNET20 function in [Code] section to check presence of .Net Framework and install it but only if it doesn't exist in target or is older. Is that correct and if the target Framework is older can it coexist with the newer (being 2.0 in my case)?  
3) I've downloaded CRX_NET_Redistribution from your site but not yet installed it. I assume that I have to install it on my system before using the resultant script to modify the [Code] section. Is that correct?
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 02, 2008, 10:12:59 PM
The CR files have nothing to do with the code section.
 
It would help to post background information about what you are doing and with what version. I have to guess what you are using or doing and where things came from. Those first few lines in the script would have helped greatly.
 
The task line will call the code section to check to see if the .NET framework 2.0 is installed. I don't understand what you mean by I assume that I have to install it on my system before using the resultant script to modify the [Code] section. The script doesn't modify the code section and you don't need .net installed to check for it. ?????
 
Can what exist with the newer??? You can and should have .NET 1.1,2.0 and 3.0 installed on your system if you have done your MS Updates.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 02, 2008, 11:19:59 PM
Sorry, I'll try again.
I've develped two VB2005 based DLL's and an executable for Vista environment that uses the tow DLL's and of course .Net Framework. The application also uses Crystal Reports 10 that come with VS2005.  
 
So all I want to do is create an installation package that will run on Vista and XP machines. I would like that package installer to determine if .NET 2.0 Framework is installed, and of course install it if it's not, and do similar for Crystal Reports 10, i.e. check if not already installed and do so if required. Below is the script that I've currently got.
 
I've got a bit more information on tying to install the package on my Vista maching (twice), sorry if it further confuses the issue but I thought that it may give you more ideas as to what may be happening.
1) After Inno Setup compiled the script and installation started, part of the way through I saw a 'install CR' checkbox on the Setup screen to which I indicated OK but was a bit confused in light of CR 10 being installed on my PC.
2) On two occasions my firewall gave me a message that installer was trying to communicate with iexplore, which I thought was reasonable.
3) After the 2nd iexplore warning I lost all my desktop icons but the applications that were running continued to do so however I couldn't invoke Start button (for example) but I could use Ctrl-Tab to switch between programs.
4) Towards the end of CR installation it appeared to be back tracking and then signalled end and I then launch the application.
 
I hope it helps and I welcome your comments.
 
Thanks,
     Michael
 
 
======================================================================================
; InnoScript Version 9.0  Build 6
; Randem Systems, Inc.
; Copyright 2003-2008
; Website:  https://randemsystems.com (https://randemsystems.com)
; Support:  https://randemsystems.support (https://randemsystems.support)
; OS: Windows NT 6.0 build 6001 (Service Pack 1)
 
; Date: June 03, 2008
 
;                  VB Runtime Files Folder:    
; Visual Basic .NET Project File (.vbproj):   C:\Users\michael\Documents\Visual Studio 2005\Projects\Project Pal\ProjectPal SW\ProjectPal\ProjectPal.vbproj
;     Inno Setup Script Output File (.iss):   C:\Users\michael\Documents\Visual Studio 2005\Projects\Project Pal\ProjectPal SW\ProjectPal\InnoScript\ProjectPal Setup-V1.0.b41 Beta.iss
;             Script Template Files (.tpl):   C:\Users\michael\AppData\Local\Randem Systems, Inc.\innoscript\Templates\Beta.tpl
 
[Setup]
AppId=ProjectPal Beta
 
;------------------------------------------------------------------------------------------------------------------------
; Taken from VBPROJ Project File Parameters Root Namespace, Root NameSpace Assembly Version and Company
;---------------------------------------------------------------------------------
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 02, 2008, 11:33:07 PM
Did you mean that CR10 was already installed on your machine? If so you did not need to check the box and CR would not have been attempting an installation.
 
In the [Run] section switch the lines where .NET and CR are. I will change this in the next version. >NET should be installed before the CR installation.
 
Which CR did you attempt to install that gave you the behavior you mentioned, VB2005 or the one from our site? The CR or .NET installation may attempt to access the internet. Did your firewall tell you what URL was being accessed?
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 02, 2008, 11:48:23 PM
Yes I have CR10 on my machine and I probably should have indicate NO. I though it wouldn't/shouldn't do any harm as other users may think the same and also say OK. I'll try it by saying No and see how it goes but thought it was interesting that it caused those problems, or at least (at this stage) I think it was that aspect but I'll still chase it further.
 
I used CR from your site but I'll also try the other one. There's a few issues happening so I'm also just trying to sift through them but all takes time and I also apologize if I'm bombarding you with too many things.
 
I'll do what you suggested and try going a bit further eliminating things, hopefully working down the list.
 
On the point of .Net or CR accessing the internet, I don't think it did but I can't be sure because at the time of losing desktop icons I think that I also may have lost internet connection. I'll keep an eye on that and work my way down the list.
 
Thanks for your prompt (and much appreciated) assistance.
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 02, 2008, 11:55:00 PM
Ok, Vista sometimes does strange things for a Multi-thread OS (getting stuck in one thread).
 
Any check boxes you find in the installation on the components screen will work the same way. If checked they will be installed if not they won't. This gives the user an option in case of a re-install of your software they do not have to do a re-install of components that have already been installed.
 
Questions... That is exactly what the forum is for. No worries.
 
You should really use Virtual PC 2007 (http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&displaylang=en) from Microsoft to test on so that you can start with a clean system every time.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 12:00:30 AM
I'll look into Virtual PC 2007, and of course for now, try a few things more things with the script that you suggested earlier.
 
I'll let you know if/when I get stuck again.
 
Thanks for now.
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 04:53:35 AM
Just a few observations after excluding CR and .NET components from the script.
 
1) seeing that IS uses .NET project file for its information base, I was surprised to see IS assigning c:program files as the path of the main .exe/application in the [Files]  
2) I then found c:program files path checked in Search Folders so I unchecked it and ran Create Script again to find the same path being used in [Files] and the folder automatically checked in Search Folders
3) I also provided a proper search path for other dll's but they too were assigned c:program files path and off course Inno Setup wouldn't compile until I manually fixed the paths
4) If I remove c:program files entry from Search Folders it gets automatically reinstated on script creation; which I can understand if IS uses that path for other searches but then how can I specify the proper path to .exe and .dll files file?
5) one of my dll's actually uses a child dll however that child dll never got included in the script, nor did the application work, until I added it manually
8) if I select Beta then Beta template is automatically added, if I then change that to Release then release template is added; if I select None then Release is always added; not sure if that's right?
9) I may have been doing something wrong earlier in the piece but I got he feeling that sometimes entries from Search Folders were being lost/not shown but I'm not absolutely certain about that
 
Thanks
     /Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 12:03:55 PM
If you placed Program Files in the exclude folder list it would not be searched. You need to tell InnoScript where you do not want it to search and where you do.
 
5) That is exactly why the Add Files tab is there.
 
8) That is the correct operations...
 
9) Never encounter this. The Search Folders tab is constantly being updated after each run so thing will be added and subtracted.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 01:53:19 PM
As part of trying to use templates to replace/modify lines I've tried commenting out some lines that IS produces (being the first block below) and replace them with my lines (being the second block below).
 
- 1st [Files] block
Source: c:usersmichaeldocumentsvisual studio 2005commonfilesdotnetfx.exe; DestDir: {tmp}; Flags:  deleteafterinstall ignoreversion nocompression; Tasks: DotNetFrameWork
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.publishcrystalreportscrredist2005_x86.msi; DestDir: {localappdata}\projectpalbindebugprojectpal.publishcrystalreports; Flags:  ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.exe; DestDir: {app}; Flags:  restartreplace ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebuggemeditor.dll; DestDir: {sys}; Flags:  ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugspellchecker.dll; DestDir: {sys}; Flags:  ignoreversion;  
 
- 2nd [Files] block
Source: c:usersmichaeldocumentsvisual studio 2005commonfilesdotnetfx.exe; DestDir: {tmp}; Flags:  deleteafterinstall ignoreversion nocompression; Tasks: DotNetFrameWork
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleaseprojectpal.exe; DestDir: {app}; Flags:  restartreplace ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleasegemeditor.dll; DestDir: {sys}; Flags:  ignoreversion;
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleaseExtendedRichTextBox.dll; DestDir: {sys}; Flags:  ignoreversion;
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleasespellchecker.dll; DestDir: {sys}; Flags:  ignoreversion;  
 
 
My problem is that even though I'm able to comment out the initial lines (first block above) and replace them with new lines (2nd block above), as per the following script, IS creates a new bunch of lines that are identical to the original/replaced lines.
 
- CONTENTS OF MY SCRIPT
; Remove the following lines
;Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.publishdotnetfxdotnetfx.exe; DestDir: {tmp}; Flags:  deleteafterinstall ignoreversion nocompression; Tasks: DotNetFrameWork
;Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.publishcrystalreportscrredist2005_x86.msi; DestDir: {localappdata}\projectpalbindebugprojectpal.publishcrystalreports; Flags:  ignoreversion;  
;Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.exe; DestDir: {app}; Flags:  restartreplace ignoreversion;  
;Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebuggemeditor.dll; DestDir: {sys}; Flags:  ignoreversion;
;Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugspellchecker.dll; DestDir: {sys}; Flags:  ignoreversion;  
 
; Insert the following lines
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.publishdotnetfxdotnetfx.exe; DestDir: {tmp}; Flags:  deleteafterinstall ignoreversion nocompression; Tasks: DotNetFrameWork
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbindebugprojectpal.publishcrystalreportscrredist2005_x86.msi; DestDir: {localappdata}\projectpalbindebugprojectpal.publishcrystalreports; Flags:  ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleaseprojectpal.exe; DestDir: {app}; Flags:  restartreplace ignoreversion;  
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleasegemeditor.dll; DestDir: {sys}; Flags:  ignoreversion;
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleaseExtendedRichTextBox.dll; DestDir: {sys}; Flags:  ignoreversion;
Source: c:usersmichaeldocumentsvisual studio 2005projectsproject palprojectpal swprojectpalbinreleasespellchecker.dll; DestDir: {sys}; Flags:  ignoreversion;  
 
Q1) So my question is how can I remove/replace lines without IS recreating the same lines?
 
------------------------------
 
I notice that IS placed my dll files in {sys} folder. I believe those files should go to my {app} folder, although I may be wrong there.  
Q2) Assuming I'm right, is the only (automated) way to do that via templates or is there some other way?
 
Again, sorry for all the questions.
 
------------------------------
 
I also noticed that if I have some entries in 'Search Folders' but uncheck them, when I run Create Script those entries get automatically checked.
Q3) I thought the idea behind checked/unchecked was so that yo ucan control (mainly while experimenting) that rather than IS taking control.
 
------------------------------
Q4) When I use Add Files tab, those files always seem to be added to {localappdata}, which would make sense for normal files but it doesn't seem right if they are dll's or exe's in which case {app} folder seems more appropriate, what do you think?
If I did want those files in {app} folder, is templates the way to do that?
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 02:12:32 PM
Q1) InnoScript does not work that way. If you comment out lines all you did was comment out lines. The commented out lines will still be added to the script using the template. It would help if you described what your end result would be then I might suggest the correct wat to get there.
 
Q2) dll files should almost NEVER go in the app folder. That process will cause dll hell for the same dll or a different dll version could be anywhere on disk and when a another copy gets installed it will be treated like it is the only copy. You could roll back a system multiple versions doing things in that manner. The system folder is where they belong. You are attempting to make the installation process convoluted and complicated. Stick to the InnoScript defaults in most cases.
 
Q3) You are incorrect. They get checked because InnoScript finds the files. If you have added the files from those search folders you are telling InnoScript to search there, overriding the entry in the search folder that is unchecked.
 
Q4) If the entry in the Add Files tab is checked it will go to the {localappdata} folder, unchecked it will go to the {app} folder. In the beta version you can select which destination folder these files will be installed into.
 
You are vastly over complicating the installation process. Take a moment and view the documentation. The default installation process that InnoScipt delivers should get you well on your way and in most cases is totaly complete.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 02:58:09 PM
You are right, I am getting myself into a knot although I'm not intentionally trying to complicate the process.
I'll start again and describe each step along the way and maybe you can see where I'm taking the wrong turn.
 
1) I create a new project file in IS and select .NET, Safe Mode, Win Version=None, NT Version=Windows XP, Release type=None, VB Version=8, Registry and Miscellaneous flags checked.
2) I enter my project file and .iss file name and run Create Script.
3) The 'search for files' gets bogged down in trying to find my main application/.exe file; it's searching c:program files.
4) I stop IS and go to Search Folders tab, intending to enter the correct path.
5) When I press Add button I get the dialog and I'm able to select the folder but on pressing OK nothing appears in the Search Folders tab.
6) As I experienced that previously I saved IS project file, exited IS and ran it again but it still doesn't let me enter a folder path.
7) I go back to my previous IS project file and I can see folders in the Search Folders tab and I'm able to enter more folders.
 
So I'm basically stuck here even though it doesn't make sense that I can enter folders in my previous IS project file but not this (new) file!!!
had that gone OK I was going to enter a proper search path/folder and leave it at that. I would repeat that step for each file that IS can't find immediately.
 
I suppose the one reason I got into a knot, apart from still being unsure where some files should go and understanding IS properly, is that I would get into a situation similar to point 5) above and I think that I'm going down the wrong path and I try something else which is perhaps the wrong direction.
 
What do you suggest I now do as I can't see why I shouldn't be able to enter some search paths, or should I in fact be adding files?
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 03:07:00 PM
Try this. Open the new project then add a folder to the search path. If nothing appears, exit the program saving the project. Restart InnoScript to see if the search folders appears. I will start up Vista to see what I can see here.
 
Yes, you should enter the search folders to speed up  InnoScript's searches or else it has to search the most of the whole disk.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 03:59:08 PM
Sorry for the delay, I had to step out for a few minutes.
 
I did what you suggested and I still wasn't able to enter any folders. I then exited IS and ran it again and no folder was in the list.  
I then manually added a few folders to the list (directly in the file using Notepad) and then opened the project using IS and could see the folders, and was also able to add more folders.
 
A couple of hours ago I tried adding folders using Notepad and was also able to then see them in the list (via IS) but wasn't able to add more folders.
 
That's the bit of inconsistency that keeps throwing me off so I get confused.
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 04:04:02 PM
Ok, I found a solution (I hope) but it will only be available in the 9.1 Build 4 Beta version for now. I may go back to update the 9.0.6 version after verification.
 
You are not crazy... Well not on this issue anyway
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 04:17:05 PM
Actually I also found something on that point.
 
I wen't back to my project file and tried entering a folder in the Search Folders, to see if I could reproduce the result that I had with the new project file, and I still wasn't able to enter the folder.
 
On checking other tabs I found that, as part of my experimentation earlier on, I had left c:\Users\michael in the Excluded Folders, which is a parent to the folder that I wanted to include. As soon as I removed that entry I was then able to enter the folder in Search Folders, which makes sense.  
 
In such a case it probably would have been handy to get a message and that would remove any/that confusion, for us and not for you of course.  
 
/Michael
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 04:21:29 PM
Ok, I am uploading the fix for the search tabs (Version 9.0.7). When it is done,  If you have Check For Updates checked it will download and install on your next launch of InnoScript.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 04:26:28 PM
Sounds great.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 04:28:00 PM
It's ready.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 04:55:27 PM
Got it and it looks good.
 
I have (hopefully) one last question on this matter. When I add all dll's in the Added Files tab and don't have them checked they go in the right place and that is {sys}.
 
If I don't add my .exe application in the Added Files tab it gets assigned c:program files path. If I add it to the list and have it checked, it goes to localappdata and if not checked it goes to {sys} folder, as expected.
 
I thought the right place for the main executable/application (.exe) would be the {app} folder, is that right?
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 05:00:06 PM
Yes, the main exe goes to the {app} folder. It is the default.
 
Generally the default destination locations should not be changed unless you really know what you doing. In the Beta version this is much clearer.
 
You should not be adding anything in the add files folder other than custom dll/exe that InnoScript does NOT mark as missing.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 03, 2008, 05:32:46 PM
And that's what I thought. When I wrote that post the path assigned to the main application was definately c:program files, which was wrong.
After removing that entry from Add Files tab and creating the script again, I get proper 'source' path and appropriate destination {app}, which was not the case to beging with as that was the rerason for adding the file to Add Files.
 
It's like as if IS reacts slightly differently when creating the script, based on (perhaps) reminance of previous script builds.
 
 
P.S. When I compile the IS script using Inno Setup I get the following message for each file in {sys}:
Warning: Unsafe flag usage on file gemeditor.dll: The ignoreversion flag should not be used on files installed to the Windows System directory ({sys}).
Shoudl I take any notice of it?
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: Randem on June 03, 2008, 10:35:33 PM
InnoScript takes no information from previous scripts or builds.
 
Why are you using the Add Files tab anyway? You should only use it to add support files such as databases, text, image or any third party file that InnoScript does not report as missing.
 
I have no idea what your script looks like or how it came to be. Post your pjt and iss files. How did this file gemeditor.dll get into the script?
 
You are asking me to be clairvoyant.
Title: I'm a bit confused about the comment in [Code] section re: conditio...
Post by: spick56 on June 04, 2008, 01:15:46 AM
Now I keep getting the right path assigned to the main app/exe file when I create the script, as per my last post, so I guess I must have been doing something wrong earlier on.
 
Anyway, all appears OK now so thanks a lot for all your help and patience.
 
/Michael