This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Powershell not working
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 07, 2016
09:18 AM
Powershell not working
when I put powershell into a custom action, the script doesn't work. it is a simple script to use 7 zip to zip up a file. I put 2 message boxes in the script for trouble shooting. one before it zips, the other after it is done. the first one fires off. then IS just says installation is complete even though the zip never shows up. the reason I am putting this in the IS forum and not powershell, is if I run the script manually on the target server, it runs correctly (takes about 2 min to zip)
any thoughts?
Odie
Farm bureau Insurance of Michigan
any thoughts?
Odie
Farm bureau Insurance of Michigan
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 07, 2016
09:26 AM
I know ive had powershell script problems in the past and it was always because Installshield start powershell in 32bit mode when on 64bit machines.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 07, 2016
10:58 AM
On the nose!!!
I found this that will change it to 54 bit if it is in 32 bit mode. works great
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# am I running in 32 bit shell?
if ($pshome -like "*syswow64*") {
write-warning "Restarting script under 64 bit powershell"
# relaunch this script under 64 bit shell
# if you want powershell 2.0, add -version 2 *before* -file parameter
& (join-path ($pshome -replace "syswow64", "sysnative") powershell.exe) -file `
(join-path $psscriptroot $myinvocation.mycommand) @args
# exit 32 bit script
exit
}
# start of script for 64 bit powershell
write-warning "hello from $pshome"
rite-warning "My original arguments $args"
thanks
Odie:)
I found this that will change it to 54 bit if it is in 32 bit mode. works great
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# am I running in 32 bit shell?
if ($pshome -like "*syswow64*") {
write-warning "Restarting script under 64 bit powershell"
# relaunch this script under 64 bit shell
# if you want powershell 2.0, add -version 2 *before* -file parameter
& (join-path ($pshome -replace "syswow64", "sysnative") powershell.exe) -file `
(join-path $psscriptroot $myinvocation.mycommand) @args
# exit 32 bit script
exit
}
# start of script for 64 bit powershell
write-warning "hello from $pshome"
rite-warning "My original arguments $args"
thanks
Odie:)
PlinyElder wrote:
I know ive had powershell script problems in the past and it was always because Installshield start powershell in 32bit mode when on 64bit machines.